hmac-md5.h | hmac-md5.h | |||
---|---|---|---|---|
skipping to change at line 22 | skipping to change at line 22 | |||
} HMAC_MD5_CTX; | } HMAC_MD5_CTX; | |||
/* intermediate HMAC state | /* intermediate HMAC state | |||
* values stored in network byte order (Big Endian) | * values stored in network byte order (Big Endian) | |||
*/ | */ | |||
typedef struct HMAC_MD5_STATE_s { | typedef struct HMAC_MD5_STATE_s { | |||
UINT4 istate[4]; | UINT4 istate[4]; | |||
UINT4 ostate[4]; | UINT4 ostate[4]; | |||
} HMAC_MD5_STATE; | } HMAC_MD5_STATE; | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/* One step hmac computation | /* One step hmac computation | |||
* | * | |||
* digest may be same as text or key | * digest may be same as text or key | |||
*/ | */ | |||
void _sasl_hmac_md5(const unsigned char *text, int text_len, | void _sasl_hmac_md5(const unsigned char *text, int text_len, | |||
const unsigned char *key, int key_len, | const unsigned char *key, int key_len, | |||
unsigned char digest[HMAC_MD5_SIZE]); | unsigned char digest[HMAC_MD5_SIZE]); | |||
/* create context from key | /* create context from key | |||
*/ | */ | |||
skipping to change at line 51 | skipping to change at line 55 | |||
*/ | */ | |||
void _sasl_hmac_md5_import(HMAC_MD5_CTX *hmac, HMAC_MD5_STATE *state); | void _sasl_hmac_md5_import(HMAC_MD5_CTX *hmac, HMAC_MD5_STATE *state); | |||
#define _sasl_hmac_md5_update(hmac, text, text_len) _sasl_MD5Update(&(hmac) ->ictx, (text), (text_len)) | #define _sasl_hmac_md5_update(hmac, text, text_len) _sasl_MD5Update(&(hmac) ->ictx, (text), (text_len)) | |||
/* finish hmac from intermediate result. Intermediate result is zeroed. | /* finish hmac from intermediate result. Intermediate result is zeroed. | |||
*/ | */ | |||
void _sasl_hmac_md5_final(unsigned char digest[HMAC_MD5_SIZE], | void _sasl_hmac_md5_final(unsigned char digest[HMAC_MD5_SIZE], | |||
HMAC_MD5_CTX *hmac); | HMAC_MD5_CTX *hmac); | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | ||||
#endif /* HMAC_MD5_H */ | #endif /* HMAC_MD5_H */ | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 8 lines changed or added | |||
md5.h | md5.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
documentation and/or software. | documentation and/or software. | |||
*/ | */ | |||
/* MD5 context. */ | /* MD5 context. */ | |||
typedef struct { | typedef struct { | |||
UINT4 state[4]; /* state (ABCD) */ | UINT4 state[4]; /* state (ABCD) */ | |||
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ | UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ | |||
unsigned char buffer[64]; /* input buffer */ | unsigned char buffer[64]; /* input buffer */ | |||
} MD5_CTX; | } MD5_CTX; | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
void _sasl_MD5Init PROTO_LIST ((MD5_CTX *)); | void _sasl_MD5Init PROTO_LIST ((MD5_CTX *)); | |||
void _sasl_MD5Update PROTO_LIST | void _sasl_MD5Update PROTO_LIST | |||
((MD5_CTX *, unsigned char *, unsigned int)); | ((MD5_CTX *, unsigned char *, unsigned int)); | |||
void _sasl_MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); | void _sasl_MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); | |||
void _sasl_hmac_md5 PROTO_LIST ((unsigned char *, int, unsigned char *, int , caddr_t)); | void _sasl_hmac_md5 PROTO_LIST ((unsigned char *, int, unsigned char *, int , caddr_t)); | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | ||||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 4 lines changed or added | |||
prop.h | prop.h | |||
---|---|---|---|---|
skipping to change at line 43 | skipping to change at line 43 | |||
unsigned nvalues; /* total number of value strings */ | unsigned nvalues; /* total number of value strings */ | |||
unsigned valsize; /* total size in characters of all value strings */ | unsigned valsize; /* total size in characters of all value strings */ | |||
}; | }; | |||
/* | /* | |||
* private internal structure | * private internal structure | |||
*/ | */ | |||
#define PROP_DEFAULT 4 /* default number of propvals to assume */ | #define PROP_DEFAULT 4 /* default number of propvals to assume */ | |||
struct propctx; | struct propctx; | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/* create a property context | /* create a property context | |||
* estimate -- an estimate of the storage needed for requests & responses | * estimate -- an estimate of the storage needed for requests & responses | |||
* 0 will use module default | * 0 will use module default | |||
* returns a new property context on success and NULL on any error | * returns a new property context on success and NULL on any error | |||
*/ | */ | |||
struct propctx *prop_new(unsigned estimate); | struct propctx *prop_new(unsigned estimate); | |||
/* create new propctx which duplicates the contents of an existing propctx | /* create new propctx which duplicates the contents of an existing propctx | |||
* returns SASL_OK on success | * returns SASL_OK on success | |||
* possible other return values include: SASL_NOMEM, SASL_BADPARAM | * possible other return values include: SASL_NOMEM, SASL_BADPARAM | |||
skipping to change at line 127 | skipping to change at line 131 | |||
*/ | */ | |||
int prop_format(struct propctx *ctx, const char *sep, int seplen, | int prop_format(struct propctx *ctx, const char *sep, int seplen, | |||
char *outbuf, unsigned outmax, unsigned *outlen); | char *outbuf, unsigned outmax, unsigned *outlen); | |||
/* add a property value to the context | /* add a property value to the context | |||
* ctx -- context from prop_new()/prop_request() | * ctx -- context from prop_new()/prop_request() | |||
* name -- name of property to which value will be added | * name -- name of property to which value will be added | |||
* if NULL, add to the same name as previous prop_set/setvals ca ll | * if NULL, add to the same name as previous prop_set/setvals ca ll | |||
* value -- a value for the property; will be copied into context | * value -- a value for the property; will be copied into context | |||
* if NULL, remove existing values | * if NULL, remove existing values | |||
* vallen -- length of value, if < 0 then strlen(value) will be used | * vallen -- length of value, if <= 0 then strlen(value) will be used | |||
* returns SASL_OK on success | * returns SASL_OK on success | |||
* possible error return values include: SASL_BADPARAM, SASL_NOMEM | * possible error return values include: SASL_BADPARAM, SASL_NOMEM | |||
*/ | */ | |||
int prop_set(struct propctx *ctx, const char *name, | int prop_set(struct propctx *ctx, const char *name, | |||
const char *value, int vallen); | const char *value, int vallen); | |||
/* set the values for a property | /* set the values for a property | |||
* ctx -- context from prop_new()/prop_request() | * ctx -- context from prop_new()/prop_request() | |||
* name -- name of property to which value will be added | * name -- name of property to which value will be added | |||
* if NULL, add to the same name as previous prop_set/setvals ca ll | * if NULL, add to the same name as previous prop_set/setvals ca ll | |||
* values -- array of values, ending in NULL. Each value is a NUL termina ted | * values -- array of values, ending in NULL. Each value is a NUL termina ted | |||
* string | * string | |||
* returns SASL_OK on success | * returns SASL_OK on success | |||
* possible error return values include: SASL_BADPARAM, SASL_NOMEM | * possible error return values include: SASL_BADPARAM, SASL_NOMEM | |||
*/ | */ | |||
int prop_setvals(struct propctx *ctx, const char *name, | int prop_setvals(struct propctx *ctx, const char *name, | |||
const char **values); | const char **values); | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | ||||
#endif /* PROP_H */ | #endif /* PROP_H */ | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 9 lines changed or added | |||
sasl.h | sasl.h | |||
---|---|---|---|---|
/* This is a proposed C API for support of SASL | /* This is a proposed C API for support of SASL | |||
* | * | |||
*********************************IMPORTANT****************************** | *********************************IMPORTANT******************************* | |||
* send email to chris.newman@innosoft.com and sasl-bugs@andrew.cmu.edu * | * send email to chris.newman@innosoft.com and cyrus-bugs@andrew.cmu.edu * | |||
* if you need to add new error codes, callback types, property values, * | * if you need to add new error codes, callback types, property values, * | |||
* etc. It is important to keep the multiple implementations of this * | * etc. It is important to keep the multiple implementations of this * | |||
* API from diverging. * | * API from diverging. * | |||
*********************************IMPORTANT****************************** | *********************************IMPORTANT******************************* | |||
* | * | |||
* Basic Type Summary: | * Basic Type Summary: | |||
* sasl_conn_t Context for a SASL connection negotiation | * sasl_conn_t Context for a SASL connection negotiation | |||
* sasl_ssf_t Security layer Strength Factor | * sasl_ssf_t Security layer Strength Factor | |||
* sasl_callback_t A typed client/server callback function and context | * sasl_callback_t A typed client/server callback function and context | |||
* sasl_interact_t A client interaction descriptor | * sasl_interact_t A client interaction descriptor | |||
* sasl_secret_t A client password | * sasl_secret_t A client password | |||
* sasl_rand_t Random data context structure | * sasl_rand_t Random data context structure | |||
* sasl_security_properties_t An application's required security level | * sasl_security_properties_t An application's required security level | |||
* | * | |||
skipping to change at line 124 | skipping to change at line 124 | |||
* | * | |||
* If the server forbids the use of "@" in user names for other | * If the server forbids the use of "@" in user names for other | |||
* purposes, this simplifies security validation. | * purposes, this simplifies security validation. | |||
*/ | */ | |||
#ifndef SASL_H | #ifndef SASL_H | |||
#define SASL_H 1 | #define SASL_H 1 | |||
#define SASL_VERSION_MAJOR 2 | #define SASL_VERSION_MAJOR 2 | |||
#define SASL_VERSION_MINOR 1 | #define SASL_VERSION_MINOR 1 | |||
#define SASL_VERSION_STEP 12 | #define SASL_VERSION_STEP 14 | |||
#include "prop.h" | #include "prop.h" | |||
/* The following ifdef block is the standard way of creating macros | /* The following ifdef block is the standard way of creating macros | |||
* which make exporting from a DLL simpler. All files within this DLL | * which make exporting from a DLL simpler. All files within this DLL | |||
* are compiled with the LIBSASL_EXPORTS symbol defined on the command | * are compiled with the LIBSASL_EXPORTS symbol defined on the command | |||
* line. this symbol should not be defined on any project that uses | * line. this symbol should not be defined on any project that uses | |||
* this DLL. This way any other project whose source files include | * this DLL. This way any other project whose source files include | |||
* this file see LIBSASL_API functions as being imported from a DLL, | * this file see LIBSASL_API functions as being imported from a DLL, | |||
* wheras this DLL sees symbols defined with this macro as being | * wheras this DLL sees symbols defined with this macro as being | |||
skipping to change at line 232 | skipping to change at line 232 | |||
*/ | */ | |||
typedef struct sasl_secret { | typedef struct sasl_secret { | |||
unsigned long len; | unsigned long len; | |||
unsigned char data[1]; /* variable sized */ | unsigned char data[1]; /* variable sized */ | |||
} sasl_secret_t; | } sasl_secret_t; | |||
/* random data context structure | /* random data context structure | |||
*/ | */ | |||
typedef struct sasl_rand_s sasl_rand_t; | typedef struct sasl_rand_s sasl_rand_t; | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/**************************** | /**************************** | |||
* Configure Basic Services * | * Configure Basic Services * | |||
****************************/ | ****************************/ | |||
/* the following functions are used to adjust how allocation and mutexes wo rk | /* the following functions are used to adjust how allocation and mutexes wo rk | |||
* they must be called before all other SASL functions: | * they must be called before all other SASL functions: | |||
*/ | */ | |||
/* memory allocation functions which may optionally be replaced: | /* memory allocation functions which may optionally be replaced: | |||
*/ | */ | |||
skipping to change at line 1178 | skipping to change at line 1182 | |||
* | * | |||
* returns: | * returns: | |||
* SASL_OK -- success (returns input if no layer negotiated) | * SASL_OK -- success (returns input if no layer negotiated) | |||
* SASL_NOTDONE -- security layer negotiation not finished | * SASL_NOTDONE -- security layer negotiation not finished | |||
* SASL_BADMAC -- bad message integrity check | * SASL_BADMAC -- bad message integrity check | |||
*/ | */ | |||
LIBSASL_API int sasl_decode(sasl_conn_t *conn, | LIBSASL_API int sasl_decode(sasl_conn_t *conn, | |||
const char *input, unsigned inputlen, | const char *input, unsigned inputlen, | |||
const char **output, unsigned *outputlen); | const char **output, unsigned *outputlen); | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | ||||
#endif /* SASL_H */ | #endif /* SASL_H */ | |||
End of changes. 4 change blocks. | ||||
7 lines changed or deleted | 15 lines changed or added | |||
saslplug.h | saslplug.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
#ifndef MD5_H | #ifndef MD5_H | |||
#include "md5.h" | #include "md5.h" | |||
#endif | #endif | |||
#ifndef HMAC_MD5_H | #ifndef HMAC_MD5_H | |||
#include "hmac-md5.h" | #include "hmac-md5.h" | |||
#endif | #endif | |||
#ifndef PROP_H | #ifndef PROP_H | |||
#include "prop.h" | #include "prop.h" | |||
#endif | #endif | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/* callback to lookup a sasl_callback_t for a connection | /* callback to lookup a sasl_callback_t for a connection | |||
* input: | * input: | |||
* conn -- the connection to lookup a callback for | * conn -- the connection to lookup a callback for | |||
* callbacknum -- the number of the callback | * callbacknum -- the number of the callback | |||
* output: | * output: | |||
* pproc -- pointer to the callback function (set to NULL on failure ) | * pproc -- pointer to the callback function (set to NULL on failure ) | |||
* pcontext -- pointer to the callback context (set to NULL on failure) | * pcontext -- pointer to the callback context (set to NULL on failure) | |||
* returns: | * returns: | |||
* SASL_OK -- no error | * SASL_OK -- no error | |||
* SASL_FAIL -- unable to find a callback of the requested type | * SASL_FAIL -- unable to find a callback of the requested type | |||
skipping to change at line 859 | skipping to change at line 863 | |||
int max_version, | int max_version, | |||
int *out_version, | int *out_version, | |||
sasl_auxprop_plug_t **plug, | sasl_auxprop_plug_t **plug, | |||
const char *plugname); | const char *plugname); | |||
/* add an auxiliary property plug-in | /* add an auxiliary property plug-in | |||
*/ | */ | |||
LIBSASL_API int sasl_auxprop_add_plugin(const char *plugname, | LIBSASL_API int sasl_auxprop_add_plugin(const char *plugname, | |||
sasl_auxprop_init_t *auxpropfunc); | sasl_auxprop_init_t *auxpropfunc); | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | ||||
#endif /* SASLPLUG_H */ | #endif /* SASLPLUG_H */ | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 8 lines changed or added | |||
saslutil.h | saslutil.h | |||
---|---|---|---|---|
/* saslutil.h -- various utility functions in SASL library | /* saslutil.h -- various utility functions in SASL library | |||
*/ | */ | |||
#ifndef SASLUTIL_H | #ifndef SASLUTIL_H | |||
#define SASLUTIL_H 1 | #define SASLUTIL_H 1 | |||
#ifndef SASL_H | #ifndef SASL_H | |||
#include "sasl.h" | #include "sasl.h" | |||
#endif | #endif | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
/* base64 decode | /* base64 decode | |||
* in -- input data | * in -- input data | |||
* inlen -- length of input data | * inlen -- length of input data | |||
* out -- output data (may be same as in, must have enough space) | * out -- output data (may be same as in, must have enough space) | |||
* outmax -- max size of output buffer | * outmax -- max size of output buffer | |||
* result: | * result: | |||
* outlen -- actual output length | * outlen -- actual output length | |||
* | * | |||
* returns SASL_BADPROT on bad base64, | * returns SASL_BADPROT on bad base64, | |||
* SASL_BUFOVER if result won't fit | * SASL_BUFOVER if result won't fit | |||
skipping to change at line 81 | skipping to change at line 85 | |||
/* erase a security sensitive buffer or password. | /* erase a security sensitive buffer or password. | |||
* Implementation may use recovery-resistant erase logic. | * Implementation may use recovery-resistant erase logic. | |||
*/ | */ | |||
LIBSASL_API void sasl_erasebuffer(char *pass, unsigned len); | LIBSASL_API void sasl_erasebuffer(char *pass, unsigned len); | |||
#ifdef WIN32 | #ifdef WIN32 | |||
LIBSASL_API int getopt(int argc, char **argv, char *optstring); | LIBSASL_API int getopt(int argc, char **argv, char *optstring); | |||
LIBSASL_API char * getpass(const char *prompt); | LIBSASL_API char * getpass(const char *prompt); | |||
#endif /* WIN32 */ | #endif /* WIN32 */ | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | ||||
#endif /* SASLUTIL_H */ | #endif /* SASLUTIL_H */ | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 8 lines changed or added | |||