Lines Matching refs:utils

84 static char *convert16(unsigned char *in, int inlen, const sasl_utils_t *utils)  in convert16()  argument
90 out = utils->malloc(inlen*2+1); in convert16()
121 text = sparams->utils->malloc(sizeof(server_context_t)); in crammd5_server_mech_new()
123 MEMERROR( sparams->utils ); in crammd5_server_mech_new()
146 ret= sparams->utils->malloc(15); in gettime()
172 sparams->utils->rand(sparams->utils->rpool, in randomdigits()
176 sparams->utils->rand(sparams->utils->rpool,(char *) temp,4); in randomdigits()
183 … ret = sparams->utils->malloc(15); /* there's no way an unsigned can be longer than this right? */ in randomdigits()
204 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step1()
207 SETERROR(sparams->utils, "CRAM-MD5 does not accpet inital data"); in crammd5_server_mech_step1()
216 MEMERROR( sparams->utils ); in crammd5_server_mech_step1()
221 text->challenge = sparams->utils->malloc(200 + 1); in crammd5_server_mech_step1()
223 MEMERROR(sparams->utils); in crammd5_server_mech_step1()
235 sparams->utils->free(time); in crammd5_server_mech_step1()
236 sparams->utils->free(randdigits); in crammd5_server_mech_step1()
272 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step2()
275 SETERROR( sparams->utils,"need authentication name"); in crammd5_server_mech_step2()
280 userid = (char *) sparams->utils->malloc(pos+1); in crammd5_server_mech_step2()
282 MEMERROR( sparams->utils); in crammd5_server_mech_step2()
290 result = sparams->utils->prop_request(sparams->propctx, password_request); in crammd5_server_mech_step2()
294 result = sparams->canon_user(sparams->utils->conn, in crammd5_server_mech_step2()
299 result = sparams->utils->prop_getnames(sparams->propctx, in crammd5_server_mech_step2()
307 sparams->utils->seterror(sparams->utils->conn,0, in crammd5_server_mech_step2()
310 sparams->utils->seterror(sparams->utils->conn,0, in crammd5_server_mech_step2()
321 sparams->utils->seterror(sparams->utils->conn,0, in crammd5_server_mech_step2()
324 sparams->utils->seterror(sparams->utils->conn,0, in crammd5_server_mech_step2()
331 sec = sparams->utils->malloc(sizeof(sasl_secret_t) + len); in crammd5_server_mech_step2()
343 sparams->utils->hmac_md5_precalc(&md5state, /* OUT */ in crammd5_server_mech_step2()
352 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step2()
355 sparams->utils->seterror(sparams->utils->conn, 0, in crammd5_server_mech_step2()
368 sparams->utils->hmac_md5_import(&tmphmac, (HMAC_MD5_STATE *) &md5state); in crammd5_server_mech_step2()
369 sparams->utils->MD5Update(&(tmphmac.ictx), in crammd5_server_mech_step2()
372 sparams->utils->hmac_md5_final((unsigned char *) &digest, &tmphmac); in crammd5_server_mech_step2()
375 digest_str = convert16((unsigned char *) digest, 16, sparams->utils); in crammd5_server_mech_step2()
382 sparams->utils->seterror(sparams->utils->conn, 0, in crammd5_server_mech_step2()
385 sparams->utils->seterror(sparams->utils->conn, 0, in crammd5_server_mech_step2()
405 if (userid) sparams->utils->free(userid); in crammd5_server_mech_step2()
406 if (sec) _plug_free_secret(sparams->utils, &sec); in crammd5_server_mech_step2()
408 if (digest_str) sparams->utils->free(digest_str); in crammd5_server_mech_step2()
430 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step()
433 SETERROR(sparams->utils, "CRAM-MD5 input longer than 1024 bytes"); in crammd5_server_mech_step()
454 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step()
457 sparams->utils->log(NULL, SASL_LOG_ERR, in crammd5_server_mech_step()
469 const sasl_utils_t *utils) in crammd5_server_mech_dispose() argument
475 if (text->challenge) _plug_free_string(utils,&(text->challenge)); in crammd5_server_mech_dispose()
477 utils->free(text); in crammd5_server_mech_dispose()
501 int crammd5_server_plug_init(const sasl_utils_t *utils, in crammd5_server_plug_init() argument
509 utils->log(NULL, SASL_LOG_ERR, "CRAM version mismatch"); in crammd5_server_plug_init()
511 SETERROR( utils, "CRAM version mismatch"); in crammd5_server_plug_init()
540 text = params->utils->malloc(sizeof(client_context_t)); in crammd5_client_mech_new()
542 MEMERROR(params->utils); in crammd5_client_mech_new()
554 const sasl_utils_t *utils) in make_hashed() argument
575 utils->hmac_md5((unsigned char *) nonce, noncelen, in make_hashed()
579 in16 = convert16(digest, 16, utils); in make_hashed()
610 params->utils->log(params->utils->conn, SASL_LOG_ERR, in crammd5_client_mech_step()
613 params->utils->seterror(params->utils->conn, 0, in crammd5_client_mech_step()
622 params->utils->log(params->utils->conn, SASL_LOG_ERR, in crammd5_client_mech_step()
625 SETERROR( params->utils, "SSF requested of CRAM-MD5 plugin"); in crammd5_client_mech_step()
632 auth_result=_plug_get_authid(params->utils, &authid, prompt_need); in crammd5_client_mech_step()
640 pass_result=_plug_get_password(params->utils, &password, in crammd5_client_mech_step()
649 params->utils->free(*prompt_need); in crammd5_client_mech_step()
658 _plug_make_prompts(params->utils, &text->h, prompt_need, in crammd5_client_mech_step()
661 convert_prompt(params->utils, &text->h, in crammd5_client_mech_step()
665 convert_prompt(params->utils, &text->h, in crammd5_client_mech_step()
671 _plug_make_prompts(params->utils, prompt_need, in crammd5_client_mech_step()
687 PARAMERROR(params->utils); in crammd5_client_mech_step()
691 result = params->canon_user(params->utils->conn, authid, 0, in crammd5_client_mech_step()
700 params->utils); in crammd5_client_mech_step()
704 params->utils->log(params->utils->conn, SASL_LOG_ERR, in crammd5_client_mech_step()
707 SETERROR(params->utils, "whoops, make_hashed failed us this time"); in crammd5_client_mech_step()
714 result = _plug_buf_alloc(params->utils, &(text->out_buf), in crammd5_client_mech_step()
737 if (in16) _plug_free_string(params->utils, &in16); in crammd5_client_mech_step()
740 if (free_password) _plug_free_secret(params-> utils, &password); in crammd5_client_mech_step()
746 const sasl_utils_t *utils) in crammd5_client_mech_dispose() argument
753 convert_prompt(utils, &text->h, NULL); in crammd5_client_mech_dispose()
755 if (text->out_buf) utils->free(text->out_buf); in crammd5_client_mech_dispose()
757 utils->free(text); in crammd5_client_mech_dispose()
780 int crammd5_client_plug_init(const sasl_utils_t *utils, in crammd5_client_plug_init() argument
788 utils->log(NULL, SASL_LOG_ERR, "CRAM version mismatch"); in crammd5_client_plug_init()
790 SETERROR( utils, "CRAM version mismatch"); in crammd5_client_plug_init()