Lines Matching defs:utils

83 static char *convert16(unsigned char *in, int inlen, const sasl_utils_t *utils)
89 out = utils->malloc(inlen*2+1);
120 text = sparams->utils->malloc(sizeof(server_context_t));
122 MEMERROR( sparams->utils );
145 ret= sparams->utils->malloc(15);
171 sparams->utils->rand(sparams->utils->rpool,
175 sparams->utils->rand(sparams->utils->rpool,(char *) temp,4);
182 ret = sparams->utils->malloc(15); /* there's no way an unsigned can be longer than this right? */
203 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
206 SETERROR(sparams->utils, "CRAM-MD5 does not accpet inital data");
215 MEMERROR( sparams->utils );
220 text->challenge = sparams->utils->malloc(200 + 1);
222 MEMERROR(sparams->utils);
234 sparams->utils->free(time);
235 sparams->utils->free(randdigits);
271 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
274 SETERROR( sparams->utils,"need authentication name");
279 userid = (char *) sparams->utils->malloc(pos+1);
281 MEMERROR( sparams->utils);
289 result = sparams->utils->prop_request(sparams->propctx, password_request);
293 result = sparams->canon_user(sparams->utils->conn,
298 result = sparams->utils->prop_getnames(sparams->propctx,
306 sparams->utils->seterror(sparams->utils->conn,0,
309 sparams->utils->seterror(sparams->utils->conn,0,
320 sparams->utils->seterror(sparams->utils->conn,0,
323 sparams->utils->seterror(sparams->utils->conn,0,
330 sec = sparams->utils->malloc(sizeof(sasl_secret_t) + len);
342 sparams->utils->hmac_md5_precalc(&md5state, /* OUT */
351 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
354 sparams->utils->seterror(sparams->utils->conn, 0,
367 sparams->utils->hmac_md5_import(&tmphmac, (HMAC_MD5_STATE *) &md5state);
368 sparams->utils->MD5Update(&(tmphmac.ictx),
371 sparams->utils->hmac_md5_final((unsigned char *) &digest, &tmphmac);
374 digest_str = convert16((unsigned char *) digest, 16, sparams->utils);
381 sparams->utils->seterror(sparams->utils->conn, 0,
384 sparams->utils->seterror(sparams->utils->conn, 0,
404 if (userid) sparams->utils->free(userid);
405 if (sec) _plug_free_secret(sparams->utils, &sec);
407 if (digest_str) sparams->utils->free(digest_str);
429 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
432 SETERROR(sparams->utils, "CRAM-MD5 input longer than 1024 bytes");
453 sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
456 sparams->utils->log(NULL, SASL_LOG_ERR,
468 const sasl_utils_t *utils)
474 if (text->challenge) _plug_free_string(utils,&(text->challenge));
476 utils->free(text);
500 int crammd5_server_plug_init(const sasl_utils_t *utils,
508 utils->log(NULL, SASL_LOG_ERR, "CRAM version mismatch");
510 SETERROR( utils, "CRAM version mismatch");
539 text = params->utils->malloc(sizeof(client_context_t));
541 MEMERROR(params->utils);
553 const sasl_utils_t *utils)
574 utils->hmac_md5((unsigned char *) nonce, noncelen,
578 in16 = convert16(digest, 16, utils);
609 params->utils->log(params->utils->conn, SASL_LOG_ERR,
612 params->utils->seterror(params->utils->conn, 0,
621 params->utils->log(params->utils->conn, SASL_LOG_ERR,
624 SETERROR( params->utils, "SSF requested of CRAM-MD5 plugin");
631 auth_result=_plug_get_authid(params->utils, &authid, prompt_need);
639 pass_result=_plug_get_password(params->utils, &password,
648 params->utils->free(*prompt_need);
657 _plug_make_prompts(params->utils, &text->h, prompt_need,
660 convert_prompt(params->utils, &text->h,
664 convert_prompt(params->utils, &text->h,
670 _plug_make_prompts(params->utils, prompt_need,
686 PARAMERROR(params->utils);
690 result = params->canon_user(params->utils->conn, authid, 0,
699 params->utils);
703 params->utils->log(params->utils->conn, SASL_LOG_ERR,
706 SETERROR(params->utils, "whoops, make_hashed failed us this time");
713 result = _plug_buf_alloc(params->utils, &(text->out_buf),
736 if (in16) _plug_free_string(params->utils, &in16);
739 if (free_password) _plug_free_secret(params-> utils, &password);
745 const sasl_utils_t *utils)
752 convert_prompt(utils, &text->h, NULL);
754 if (text->out_buf) utils->free(text->out_buf);
756 utils->free(text);
779 int crammd5_client_plug_init(const sasl_utils_t *utils,
787 utils->log(NULL, SASL_LOG_ERR, "CRAM version mismatch");
789 SETERROR( utils, "CRAM version mismatch");