Lines Matching defs:utils

122 int _plug_ipfromstring(const sasl_utils_t *utils, const char *addr,
138 if(!utils || !addr || !out) {
139 if(utils) PARAMERROR( utils );
149 if(utils) PARAMERROR( utils );
174 if(utils) PARAMERROR( utils );
180 PARAMERROR( utils );
187 if(utils) PARAMERROR( utils );
199 PARAMERROR( utils );
214 PARAMERROR( utils );
227 PARAMERROR( utils );
236 int _plug_iovec_to_buf(const sasl_utils_t *utils, const struct iovec *vec,
244 if(!utils || !vec || !output) {
245 if(utils) PARAMERROR( utils );
250 *output = utils->malloc(sizeof(buffer_info_t));
252 MEMERROR(utils);
264 ret = _plug_buf_alloc(utils, &out->data, &out->reallen, out->curlen);
267 MEMERROR(utils);
283 int _plug_buf_alloc(const sasl_utils_t *utils, char **rwbuf,
286 if(!utils || !rwbuf || !curlen) {
287 PARAMERROR(utils);
292 *rwbuf = utils->malloc(newlen);
295 MEMERROR(utils);
309 *rwbuf = utils->realloc(*rwbuf, needed);
312 MEMERROR(utils);
322 int _plug_strdup(const sasl_utils_t * utils, const char *in,
331 if(!utils || !in || !out) {
332 if(utils) PARAMERROR(utils);
339 *out = utils->malloc(len + 1);
341 MEMERROR(utils);
353 void _plug_free_string(const sasl_utils_t *utils, char **str)
357 if (!utils || !str || !(*str)) return;
361 utils->erasebuffer(*str, len);
362 utils->free(*str);
367 void _plug_free_secret(const sasl_utils_t *utils, sasl_secret_t **secret)
369 if(!utils || !secret || !(*secret)) return;
372 utils->erasebuffer((char *)(*secret)->data, (*secret)->len);
374 utils->erasebuffer((*secret)->data, (*secret)->len);
376 utils->free(*secret);
402 int _plug_get_simple(const sasl_utils_t *utils, unsigned int id, int required,
419 SETERROR(utils, "Unexpectedly missing a prompt result");
428 ret = utils->getcallback(utils->conn, id, &simple_cb, &simple_context);
439 PARAMERROR(utils);
450 int _plug_get_password(const sasl_utils_t *utils, sasl_secret_t **password,
467 SETERROR(utils, "Unexpectedly missing a prompt result");
472 *password = (sasl_secret_t *) utils->malloc(sizeof(sasl_secret_t) +
475 MEMERROR(utils);
489 ret = utils->getcallback(utils->conn, SASL_CB_PASS,
493 ret = pass_cb(utils->conn, pass_context, SASL_CB_PASS, password);
498 PARAMERROR(utils);
509 int _plug_challenge_prompt(const sasl_utils_t *utils, unsigned int id,
526 SETERROR(utils, "Unexpectedly missing a prompt result");
535 ret = utils->getcallback(utils->conn, id,
545 PARAMERROR(utils);
556 int _plug_get_realm(const sasl_utils_t *utils, const char **availrealms,
572 SETERROR(utils, "Unexpectedly missing a prompt result");
581 ret = utils->getcallback(utils->conn, SASL_CB_GETREALM,
590 PARAMERROR(utils);
601 int _plug_make_prompts(const sasl_utils_t *utils,
625 SETERROR( utils, "make_prompts() called with no actual prompts" );
630 prompts = utils->malloc(alloc_size);
632 MEMERROR( utils );
642 (prompts)->challenge = convert_prompt(utils, h,
656 (prompts)->challenge = convert_prompt(utils, h,
670 (prompts)->challenge = convert_prompt(utils, h, gettext("Password"));
711 int _plug_decode(const sasl_utils_t *utils,
736 ret = _plug_buf_alloc(utils, output, outputsize,
753 int _plug_parseuser(const sasl_utils_t *utils,
765 PARAMERROR( utils );
773 ret = _plug_strdup(utils, user_realm, realm, NULL);
776 ret = _plug_strdup(utils, serverFQDN, realm, NULL);
780 ret = _plug_strdup(utils, input, user, NULL);
784 ret = _plug_strdup(utils, r, realm, NULL);
787 *user = utils->malloc(r - input);
792 MEMERROR( utils );
798 *user = utils->malloc(r - input + 1);
802 MEMERROR( utils );
858 convert_prompt(const sasl_utils_t *utils, void **h, const char *s)
870 if (utils == NULL || utils->conn == NULL)
876 utils->free(list->prompt);
878 utils->free(list);
884 ret = utils->getcallback(utils->conn, SASL_CB_LANGUAGE, &simple_cb,
899 buf = local_to_utf(utils, s_locale);
902 list = utils->malloc(sizeof (prompt_list));
904 utils->free(buf);
927 * If utils is NULL, local_to_utf will use the standard memory allocation
934 local_to_utf(const sasl_utils_t *utils, const char *s)
953 if (utils == NULL)
956 if (_plug_strdup(utils, s, &buf, NULL) != SASL_OK)
968 if (utils == NULL)
971 buf = utils->malloc(buf_size);
987 if (utils == NULL)
990 tmp = utils->realloc(buf, buf_size);
1010 if (utils == NULL)
1013 tmp = utils->realloc(buf, buf_size + 1);
1022 if (utils == NULL)
1025 utils->free(buf);