Home | History | Annotate | Download | only in conf

Lines Matching refs:CONF

57 #include <openssl/conf.h>
93 CONF *NCONF_new(void *method) {
94 CONF *conf;
100 conf = OPENSSL_malloc(sizeof(CONF));
101 if (conf == NULL) {
105 conf->data = lh_CONF_VALUE_new(conf_value_hash, conf_value_cmp);
106 if (conf->data == NULL) {
107 OPENSSL_free(conf);
111 return conf;
117 OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE);
145 void NCONF_free(CONF *conf) {
146 if (conf == NULL || conf->data == NULL) {
150 lh_CONF_VALUE_doall(conf->data, value_free);
151 lh_CONF_VALUE_free(conf->data);
152 OPENSSL_free(conf);
155 CONF_VALUE *NCONF_new_section(const CONF *conf, const char *section) {
173 if (!lh_CONF_VALUE_insert(conf->data, &old_value, v)) {
194 static int str_copy(CONF *conf, char *section, char **pto, char *from) {
211 if (IS_QUOTE(conf, *from)) {
214 while (!IS_EOF(conf, *from) && (*from != q)) {
215 if (IS_ESC(conf, *from)) {
217 if (IS_EOF(conf, *from)) {
226 } else if (IS_DQUOTE(conf, *from)) {
229 while (!IS_EOF(conf, *from)) {
242 } else if (IS_ESC(conf, *from)) {
245 if (IS_EOF(conf, v)) {
257 } else if (IS_EOF(conf, *from)) {
276 while (IS_ALPHA_NUMERIC(conf, *e)) {
286 while (IS_ALPHA_NUMERIC(conf, *e)) {
295 OPENSSL_PUT_ERROR(CONF, CONF_R_NO_CLOSE_BRACE);
308 p = NCONF_get_string(conf, cp, np);
314 OPENSSL_PUT_ERROR(CONF, CONF_R_VARIABLE_HAS_NO_VALUE);
352 static CONF_VALUE *get_section(const CONF *conf, const char *section) {
357 return lh_CONF_VALUE_retrieve(conf->data, &template);
360 STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section) {
361 CONF_VALUE *section_value = get_section(conf, section);
368 const char *NCONF_get_string(const CONF *conf, const char *section,
375 value = lh_CONF_VALUE_retrieve(conf->data, &template);
382 static int add_string(const CONF *conf, CONF_VALUE *section,
392 if (!lh_CONF_VALUE_insert(conf->data, &old_value, value)) {
403 static char *eat_ws(CONF *conf, char *p) {
404 while (IS_WS(conf, *p) && !IS_EOF(conf, *p)) {
410 #define scan_esc(conf, p) (((IS_EOF((conf), (p)[1])) ? ((p) + 1) : ((p) + 2)))
412 static char *eat_alpha_numeric(CONF *conf, char *p) {
414 if (IS_ESC(conf, *p)) {
415 p = scan_esc(conf, p);
418 if (!IS_ALPHA_NUMERIC_PUNCT(conf, *p)) {
425 static char *scan_quote(CONF *conf, char *p) {
429 while (!IS_EOF(conf, *p) && *p != q) {
430 if (IS_ESC(conf, *p)) {
432 if (IS_EOF(conf, *p)) {
445 static char *scan_dquote(CONF *conf, char *p) {
449 while (!(IS_EOF(conf, *p))) {
465 static void clear_comments(CONF *conf, char *p) {
467 if (IS_FCOMMENT(conf, *p)) {
471 if (!IS_WS(conf, *p)) {
478 if (IS_COMMENT(conf, *p)) {
482 if (IS_DQUOTE(conf, *p)) {
483 p = scan_dquote(conf, p);
486 if (IS_QUOTE(conf, *p)) {
487 p = scan_quote(conf, p);
490 if (IS_ESC(conf, *p)) {
491 p = scan_esc(conf, p);
494 if (IS_EOF(conf, *p)) {
502 static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) {
516 OPENSSL_PUT_ERROR(CONF, ERR_R_BUF_LIB);
522 OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE);
526 sv = NCONF_new_section(conf, section);
528 OPENSSL_PUT_ERROR(CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
536 OPENSSL_PUT_ERROR(CONF, ERR_R_BUF_LIB);
575 if (IS_ESC(conf, p[0]) && ((bufnum <= 1) || !IS_ESC(conf, p[-1]))) {
586 clear_comments(conf, buf);
587 s = eat_ws(conf, buf);
588 if (IS_EOF(conf, *s)) {
595 start = eat_ws(conf, s);
598 end = eat_alpha_numeric(conf, ss);
599 p = eat_ws(conf, end);
605 OPENSSL_PUT_ERROR(CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET);
609 if (!str_copy(conf, NULL, &section, start)) {
612 if ((sv = get_section(conf, section)) == NULL) {
613 sv = NCONF_new_section(conf, section);
616 OPENSSL_PUT_ERROR(CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
623 end = eat_alpha_numeric(conf, s);
629 end = eat_alpha_numeric(conf, end);
631 p = eat_ws(conf, end);
633 OPENSSL_PUT_ERROR(CONF, CONF_R_MISSING_EQUAL_SIGN);
638 start = eat_ws(conf, p);
639 while (!IS_EOF(conf, *p)) {
643 while ((p != start) && (IS_WS(conf, *p))) {
657 OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE);
660 if (!str_copy(conf, psection, &(v->value), start)) {
665 if ((tv = get_section(conf, psection)) == NULL) {
666 tv = NCONF_new_section(conf, psection);
669 OPENSSL_PUT_ERROR(CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
675 if (add_string(conf, tv, v) == 0) {
676 OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE);
717 int NCONF_load(CONF *conf, const char *filename, long *out_error_line) {
722 OPENSSL_PUT_ERROR(CONF, ERR_R_SYS_LIB);
726 ret = def_load_bio(conf, in, out_error_line);
732 int NCONF_load_bio(CONF *conf, BIO *bio, long *out_error_line) {
733 return def_load_bio(conf, bio, out_error_line);
743 OPENSSL_PUT_ERROR(CONF, CONF_R_LIST_CANNOT_BE_NULL);