Lines Matching defs:utils

123 int _plug_ipfromstring(const sasl_utils_t *utils, const char *addr,
139 if(!utils || !addr || !out) {
140 if(utils) PARAMERROR( utils );
150 if(utils) PARAMERROR( utils );
175 if(utils) PARAMERROR( utils );
181 PARAMERROR( utils );
188 if(utils) PARAMERROR( utils );
200 PARAMERROR( utils );
215 PARAMERROR( utils );
228 PARAMERROR( utils );
237 int _plug_iovec_to_buf(const sasl_utils_t *utils, const struct iovec *vec,
245 if(!utils || !vec || !output) {
246 if(utils) PARAMERROR( utils );
251 *output = utils->malloc(sizeof(buffer_info_t));
253 MEMERROR(utils);
265 ret = _plug_buf_alloc(utils, &out->data, &out->reallen, out->curlen);
268 MEMERROR(utils);
284 int _plug_buf_alloc(const sasl_utils_t *utils, char **rwbuf,
287 if(!utils || !rwbuf || !curlen) {
288 PARAMERROR(utils);
293 *rwbuf = utils->malloc(newlen);
296 MEMERROR(utils);
310 *rwbuf = utils->realloc(*rwbuf, needed);
313 MEMERROR(utils);
323 int _plug_strdup(const sasl_utils_t * utils, const char *in,
332 if(!utils || !in || !out) {
333 if(utils) PARAMERROR(utils);
340 *out = utils->malloc(len + 1);
342 MEMERROR(utils);
354 void _plug_free_string(const sasl_utils_t *utils, char **str)
358 if (!utils || !str || !(*str)) return;
362 utils->erasebuffer(*str, len);
363 utils->free(*str);
368 void _plug_free_secret(const sasl_utils_t *utils, sasl_secret_t **secret)
370 if(!utils || !secret || !(*secret)) return;
373 utils->erasebuffer((char *)(*secret)->data, (*secret)->len);
375 utils->erasebuffer((*secret)->data, (*secret)->len);
377 utils->free(*secret);
403 int _plug_get_simple(const sasl_utils_t *utils, unsigned int id, int required,
420 SETERROR(utils, "Unexpectedly missing a prompt result");
429 ret = utils->getcallback(utils->conn, id, &simple_cb, &simple_context);
440 PARAMERROR(utils);
451 int _plug_get_password(const sasl_utils_t *utils, sasl_secret_t **password,
468 SETERROR(utils, "Unexpectedly missing a prompt result");
473 *password = (sasl_secret_t *) utils->malloc(sizeof(sasl_secret_t) +
476 MEMERROR(utils);
490 ret = utils->getcallback(utils->conn, SASL_CB_PASS,
494 ret = pass_cb(utils->conn, pass_context, SASL_CB_PASS, password);
499 PARAMERROR(utils);
510 int _plug_challenge_prompt(const sasl_utils_t *utils, unsigned int id,
527 SETERROR(utils, "Unexpectedly missing a prompt result");
536 ret = utils->getcallback(utils->conn, id,
546 PARAMERROR(utils);
557 int _plug_get_realm(const sasl_utils_t *utils, const char **availrealms,
573 SETERROR(utils, "Unexpectedly missing a prompt result");
582 ret = utils->getcallback(utils->conn, SASL_CB_GETREALM,
591 PARAMERROR(utils);
602 int _plug_make_prompts(const sasl_utils_t *utils,
626 SETERROR( utils, "make_prompts() called with no actual prompts" );
631 prompts = utils->malloc(alloc_size);
633 MEMERROR( utils );
643 (prompts)->challenge = convert_prompt(utils, h,
657 (prompts)->challenge = convert_prompt(utils, h,
671 (prompts)->challenge = convert_prompt(utils, h, gettext("Password"));
712 int _plug_decode(const sasl_utils_t *utils,
737 ret = _plug_buf_alloc(utils, output, outputsize,
754 int _plug_parseuser(const sasl_utils_t *utils,
766 PARAMERROR( utils );
774 ret = _plug_strdup(utils, user_realm, realm, NULL);
777 ret = _plug_strdup(utils, serverFQDN, realm, NULL);
781 ret = _plug_strdup(utils, input, user, NULL);
785 ret = _plug_strdup(utils, r, realm, NULL);
788 *user = utils->malloc(r - input);
793 MEMERROR( utils );
799 *user = utils->malloc(r - input + 1);
803 MEMERROR( utils );
859 convert_prompt(const sasl_utils_t *utils, void **h, const char *s)
871 if (utils == NULL || utils->conn == NULL)
877 utils->free(list->prompt);
879 utils->free(list);
885 ret = utils->getcallback(utils->conn, SASL_CB_LANGUAGE, &simple_cb,
900 buf = local_to_utf(utils, s_locale);
903 list = utils->malloc(sizeof (prompt_list));
905 utils->free(buf);
928 * If utils is NULL, local_to_utf will use the standard memory allocation
935 local_to_utf(const sasl_utils_t *utils, const char *s)
954 if (utils == NULL)
957 if (_plug_strdup(utils, s, &buf, NULL) != SASL_OK)
969 if (utils == NULL)
972 buf = utils->malloc(buf_size);
988 if (utils == NULL)
991 tmp = utils->realloc(buf, buf_size);
1011 if (utils == NULL)
1014 tmp = utils->realloc(buf, buf_size + 1);
1023 if (utils == NULL)
1026 utils->free(buf);