Lines Matching defs:utils

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