gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mechtools.c File Reference
#include "mechtools.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <gsasl.h>
#include <gc.h>
Include dependency graph for mechtools.c:

Go to the source code of this file.


static int unescape_authzid (const char *str, size_t len, char **authzid)
int _gsasl_parse_gs2_header (const char *data, size_t len, char **authzid, size_t *headerlen)
static char * escape_authzid (const char *str)
int _gsasl_gs2_generate_header (signed char nonstd, char cbflag, const char *cbname, const char *authzid, size_t extralen, const char *extra, char **gs2h, size_t *gs2hlen)
void _gsasl_hex_encode (const char *in, size_t inlen, char *out)
static char hexdigit_to_char (char hexdigit)
static char hex_to_char (char u, char l)
void _gsasl_hex_decode (const char *hexstr, char *bin)
signed char _gsasl_hex_p (const char *hexstr)
int _gsasl_hash (Gsasl_hash hash, const char *in, size_t inlen, char *outhash)
int _gsasl_hmac (Gsasl_hash hash, const char *key, size_t keylen, const char *in, size_t inlen, char *outhash)
int _gsasl_pbkdf2 (Gsasl_hash hash, const char *password, size_t passwordlen, const char *salt, size_t saltlen, unsigned int c, char *dk, size_t dklen)

Function Documentation

◆ _gsasl_gs2_generate_header()

int _gsasl_gs2_generate_header ( signed char  nonstd,
char  cbflag,
const char *  cbname,
const char *  authzid,
size_t  extralen,
const char *  extra,
char **  gs2h,
size_t gs2hlen 

◆ _gsasl_hash()

int _gsasl_hash ( Gsasl_hash  hash,
const char *  in,
size_t  inlen,
char *  outhash 

◆ _gsasl_hex_decode()

void _gsasl_hex_decode ( const char *  hexstr,
char *  bin 

Definition at line 262 of file mechtools.c.

References hex_to_char().

Referenced by _gsasl_scram_client_step(), and gsasl_hex_from().

◆ _gsasl_hex_encode()

void _gsasl_hex_encode ( const char *  in,
size_t  inlen,
char *  out 

Definition at line 226 of file mechtools.c.

References c, and p.

Referenced by gsasl_hex_to(), and set_saltedpassword().

◆ _gsasl_hex_p()

signed char _gsasl_hex_p ( const char *  hexstr)

Definition at line 274 of file mechtools.c.

References NULL.

Referenced by _gsasl_scram_client_step(), and gsasl_hex_from().

◆ _gsasl_hmac()

int _gsasl_hmac ( Gsasl_hash  hash,
const char *  key,
size_t  keylen,
const char *  in,
size_t  inlen,
char *  outhash 

◆ _gsasl_parse_gs2_header()

int _gsasl_parse_gs2_header ( const char *  data,
size_t  len,
char **  authzid,
size_t headerlen 

◆ _gsasl_pbkdf2()

int _gsasl_pbkdf2 ( Gsasl_hash  hash,
const char *  password,
size_t  passwordlen,
const char *  salt,
size_t  saltlen,
unsigned int  c,
char *  dk,
size_t  dklen 

◆ escape_authzid()

static char* escape_authzid ( const char *  str)

Definition at line 136 of file mechtools.c.

References NULL, and p.

Referenced by _gsasl_gs2_generate_header().

◆ hex_to_char()

static char hex_to_char ( char  u,
char  l 

Definition at line 252 of file mechtools.c.

References hexdigit_to_char().

Referenced by _gsasl_hex_decode().

◆ hexdigit_to_char()

static char hexdigit_to_char ( char  hexdigit)

Definition at line 242 of file mechtools.c.

Referenced by hex_to_char().

◆ unescape_authzid()

static int unescape_authzid ( const char *  str,
size_t  len,
char **  authzid 

Definition at line 51 of file mechtools.c.


Referenced by _gsasl_parse_gs2_header().