Lines Matching refs:utils

85 static char *convert16(unsigned char *in, int inlen, const sasl_utils_t *utils)  in convert16()  argument
91 out = utils->malloc(inlen*2+1); in convert16()
122 text = sparams->utils->malloc(sizeof(server_context_t)); in crammd5_server_mech_new()
124 MEMERROR( sparams->utils ); in crammd5_server_mech_new()
147 ret= sparams->utils->malloc(15); in gettime()
173 sparams->utils->rand(sparams->utils->rpool, in randomdigits()
177 sparams->utils->rand(sparams->utils->rpool,(char *) temp,4); in randomdigits()
184 … ret = sparams->utils->malloc(15); /* there's no way an unsigned can be longer than this right? */ in randomdigits()
205 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step1()
208 SETERROR(sparams->utils, "CRAM-MD5 does not accpet inital data"); in crammd5_server_mech_step1()
217 MEMERROR( sparams->utils ); in crammd5_server_mech_step1()
222 text->challenge = sparams->utils->malloc(200 + 1); in crammd5_server_mech_step1()
224 MEMERROR(sparams->utils); in crammd5_server_mech_step1()
236 sparams->utils->free(time); in crammd5_server_mech_step1()
237 sparams->utils->free(randdigits); in crammd5_server_mech_step1()
273 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step2()
276 SETERROR( sparams->utils,"need authentication name"); in crammd5_server_mech_step2()
281 userid = (char *) sparams->utils->malloc(pos+1); in crammd5_server_mech_step2()
283 MEMERROR( sparams->utils); in crammd5_server_mech_step2()
291 result = sparams->utils->prop_request(sparams->propctx, password_request); in crammd5_server_mech_step2()
295 result = sparams->canon_user(sparams->utils->conn, in crammd5_server_mech_step2()
300 result = sparams->utils->prop_getnames(sparams->propctx, in crammd5_server_mech_step2()
308 sparams->utils->seterror(sparams->utils->conn,0, in crammd5_server_mech_step2()
311 sparams->utils->seterror(sparams->utils->conn,0, in crammd5_server_mech_step2()
322 sparams->utils->seterror(sparams->utils->conn,0, in crammd5_server_mech_step2()
325 sparams->utils->seterror(sparams->utils->conn,0, in crammd5_server_mech_step2()
332 sec = sparams->utils->malloc(sizeof(sasl_secret_t) + len); in crammd5_server_mech_step2()
344 sparams->utils->hmac_md5_precalc(&md5state, /* OUT */ in crammd5_server_mech_step2()
353 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step2()
356 sparams->utils->seterror(sparams->utils->conn, 0, in crammd5_server_mech_step2()
369 sparams->utils->hmac_md5_import(&tmphmac, (HMAC_MD5_STATE *) &md5state); in crammd5_server_mech_step2()
370 sparams->utils->MD5Update(&(tmphmac.ictx), in crammd5_server_mech_step2()
373 sparams->utils->hmac_md5_final((unsigned char *) &digest, &tmphmac); in crammd5_server_mech_step2()
376 digest_str = convert16((unsigned char *) digest, 16, sparams->utils); in crammd5_server_mech_step2()
383 sparams->utils->seterror(sparams->utils->conn, 0, in crammd5_server_mech_step2()
386 sparams->utils->seterror(sparams->utils->conn, 0, in crammd5_server_mech_step2()
406 if (userid) sparams->utils->free(userid); in crammd5_server_mech_step2()
407 if (sec) _plug_free_secret(sparams->utils, &sec); in crammd5_server_mech_step2()
409 if (digest_str) sparams->utils->free(digest_str); in crammd5_server_mech_step2()
431 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step()
434 SETERROR(sparams->utils, "CRAM-MD5 input longer than 1024 bytes"); in crammd5_server_mech_step()
455 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR, in crammd5_server_mech_step()
458 sparams->utils->log(NULL, SASL_LOG_ERR, in crammd5_server_mech_step()
470 const sasl_utils_t *utils) in crammd5_server_mech_dispose() argument
476 if (text->challenge) _plug_free_string(utils,&(text->challenge)); in crammd5_server_mech_dispose()
478 utils->free(text); in crammd5_server_mech_dispose()
502 int crammd5_server_plug_init(const sasl_utils_t *utils, in crammd5_server_plug_init() argument
510 utils->log(NULL, SASL_LOG_ERR, "CRAM version mismatch"); in crammd5_server_plug_init()
512 SETERROR( utils, "CRAM version mismatch"); in crammd5_server_plug_init()
541 text = params->utils->malloc(sizeof(client_context_t)); in crammd5_client_mech_new()
543 MEMERROR(params->utils); in crammd5_client_mech_new()
555 const sasl_utils_t *utils) in make_hashed() argument
576 utils->hmac_md5((unsigned char *) nonce, noncelen, in make_hashed()
580 in16 = convert16(digest, 16, utils); in make_hashed()
611 params->utils->log(params->utils->conn, SASL_LOG_ERR, in crammd5_client_mech_step()
614 params->utils->seterror(params->utils->conn, 0, in crammd5_client_mech_step()
623 params->utils->log(params->utils->conn, SASL_LOG_ERR, in crammd5_client_mech_step()
626 SETERROR( params->utils, "SSF requested of CRAM-MD5 plugin"); in crammd5_client_mech_step()
633 auth_result=_plug_get_authid(params->utils, &authid, prompt_need); in crammd5_client_mech_step()
641 pass_result=_plug_get_password(params->utils, &password, in crammd5_client_mech_step()
650 params->utils->free(*prompt_need); in crammd5_client_mech_step()
659 _plug_make_prompts(params->utils, &text->h, prompt_need, in crammd5_client_mech_step()
662 convert_prompt(params->utils, &text->h, in crammd5_client_mech_step()
666 convert_prompt(params->utils, &text->h, in crammd5_client_mech_step()
672 _plug_make_prompts(params->utils, prompt_need, in crammd5_client_mech_step()
688 PARAMERROR(params->utils); in crammd5_client_mech_step()
692 result = params->canon_user(params->utils->conn, authid, 0, in crammd5_client_mech_step()
701 params->utils); in crammd5_client_mech_step()
705 params->utils->log(params->utils->conn, SASL_LOG_ERR, in crammd5_client_mech_step()
708 SETERROR(params->utils, "whoops, make_hashed failed us this time"); in crammd5_client_mech_step()
715 result = _plug_buf_alloc(params->utils, &(text->out_buf), in crammd5_client_mech_step()
738 if (in16) _plug_free_string(params->utils, &in16); in crammd5_client_mech_step()
741 if (free_password) _plug_free_secret(params-> utils, &password); in crammd5_client_mech_step()
747 const sasl_utils_t *utils) in crammd5_client_mech_dispose() argument
754 convert_prompt(utils, &text->h, NULL); in crammd5_client_mech_dispose()
756 if (text->out_buf) utils->free(text->out_buf); in crammd5_client_mech_dispose()
758 utils->free(text); in crammd5_client_mech_dispose()
781 int crammd5_client_plug_init(const sasl_utils_t *utils, in crammd5_client_plug_init() argument
789 utils->log(NULL, SASL_LOG_ERR, "CRAM version mismatch"); in crammd5_client_plug_init()
791 SETERROR( utils, "CRAM version mismatch"); in crammd5_client_plug_init()