Next: Error Handling, Previous: Session Functions, Up: Top
in: a UTF-8 encoded string.
flags: any SASLprep flag, e.g.,
GSASL_ALLOW_UNASSIGNED
.out: on exit, contains newly allocated output string.
stringpreprc: if non-NULL, will hold precise stringprep return code.
Prepare string using SASLprep. On success, the
out
variable must be deallocated by the caller.Return value: Returns
GSASL_OK
on success, orGSASL_SASLPREP_ERROR
on error.Since: 0.2.3
in: input byte array
inlen: size of input byte array
out: pointer to newly allocated output byte array
outlen: pointer to size of newly allocated output byte array
Encode data as base64. The string is zero terminated, and OUTLEN holds the length excluding the terminating zero. The OUT buffer must be deallocated by the caller.
Return value: Returns
GSASL_OK
on success, orGSASL_MALLOC_ERROR
if input was too large or memory allocation fail.Since: 0.2.2
in: input byte array
inlen: size of input byte array
out: pointer to newly allocated output byte array
outlen: pointer to size of newly allocated output byte array
Decode Base64 data. The OUT buffer must be deallocated by the caller.
Return value: Returns
GSASL_OK
on success,GSASL_BASE64_ERROR
if input was invalid, andGSASL_MALLOC_ERROR
on memory allocation errors.Since: 0.2.2
filename: filename of file containing passwords.
username: username string.
key: newly allocated output character array.
Retrieve password for user from specified file. The buffer
key
contain the password if this function is successful. The caller is responsible for deallocating it.The file should be on the UoW "MD5 Based Authentication" format, which means it is in text format with comments denoted by # first on the line, with user entries looking as "usernameTABpassword". This function removes CR and LF at the end of lines before processing. TAB, CR, and LF denote ASCII values 9, 13, and 10, respectively.
Return value: Return GSASL_OK if output buffer contains the password, GSASL_AUTHENTICATION_ERROR if the user could not be found, or other error code.
data: output array to be filled with unpredictable random data.
datalen: size of output array.
Store unpredictable data of given size in the provided buffer.
Return value: Returns
GSASL_OK
iff successful.
data: output array to be filled with strong random data.
datalen: size of output array.
Store cryptographically strong random data of given size in the provided buffer.
Return value: Returns
GSASL_OK
iff successful.
in: input character array of data to hash.
inlen: length of input character array of data to hash.
Compute hash of data using MD5. The
out
buffer must be deallocated by the caller.Return value: Returns
GSASL_OK
iff successful.
key: input character array with key to use.
keylen: length of input character array with key to use.
in: input character array of data to hash.
inlen: length of input character array of data to hash.
Compute keyed checksum of data using HMAC-MD5. The
outhash
buffer must be deallocated by the caller.Return value: Returns
GSASL_OK
iff successful.