diff options
author | Adam Langley <agl@google.com> | 2015-05-11 17:20:37 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2015-05-12 23:06:14 +0000 |
commit | e9ada863a7b3e81f5d2b1e3bdd2305da902a87f5 (patch) | |
tree | 6e43e34595ecf887c26c32b86d8ab097fe8cac64 /src/crypto/conf | |
parent | b3106a0cc1493bbe0505c0ec0ce3da4ca90a29ae (diff) | |
download | external_boringssl-e9ada863a7b3e81f5d2b1e3bdd2305da902a87f5.zip external_boringssl-e9ada863a7b3e81f5d2b1e3bdd2305da902a87f5.tar.gz external_boringssl-e9ada863a7b3e81f5d2b1e3bdd2305da902a87f5.tar.bz2 |
external/boringssl: bump revision.
This change bumps the BoringSSL revision to the current tip-of-tree.
Change-Id: I91d5bf467e16e8d86cb19a4de873985f524e5faa
Diffstat (limited to 'src/crypto/conf')
-rw-r--r-- | src/crypto/conf/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/crypto/conf/conf.c | 76 | ||||
-rw-r--r-- | src/crypto/conf/conf_error.c | 31 |
3 files changed, 52 insertions, 56 deletions
diff --git a/src/crypto/conf/CMakeLists.txt b/src/crypto/conf/CMakeLists.txt index f54d904..8046bb8 100644 --- a/src/crypto/conf/CMakeLists.txt +++ b/src/crypto/conf/CMakeLists.txt @@ -6,5 +6,4 @@ add_library( OBJECT conf.c - conf_error.c ) diff --git a/src/crypto/conf/conf.c b/src/crypto/conf/conf.c index b8dab95..213efc5 100644 --- a/src/crypto/conf/conf.c +++ b/src/crypto/conf/conf.c @@ -90,9 +90,13 @@ static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b) { } } -CONF *NCONF_new(void) { +CONF *NCONF_new(void *method) { CONF *conf; + if (method != NULL) { + return NULL; + } + conf = OPENSSL_malloc(sizeof(CONF)); if (conf == NULL) { return NULL; @@ -530,20 +534,22 @@ static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) { BIO_gets(in, p, CONFBUFSIZE - 1); p[CONFBUFSIZE - 1] = '\0'; ii = i = strlen(p); - if (i == 0 && !again) + if (i == 0 && !again) { break; + } again = 0; while (i > 0) { - if ((p[i - 1] != '\r') && (p[i - 1] != '\n')) + if ((p[i - 1] != '\r') && (p[i - 1] != '\n')) { break; - else + } else { i--; + } } /* we removed some trailing stuff so there is a new * line on the end. */ - if (ii && i == ii) + if (ii && i == ii) { again = 1; /* long line */ - else { + } else { p[i] = '\0'; eline++; /* another input line */ } @@ -564,15 +570,17 @@ static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) { again = 1; } } - if (again) + if (again) { continue; + } bufnum = 0; buf = buff->data; clear_comments(conf, buf); s = eat_ws(conf, buf); - if (IS_EOF(conf, *s)) + if (IS_EOF(conf, *s)) { continue; /* blank line */ + } if (*s == '[') { char *ss; @@ -591,10 +599,12 @@ static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) { goto err; } *end = '\0'; - if (!str_copy(conf, NULL, §ion, start)) + if (!str_copy(conf, NULL, §ion, start)) { goto err; - if ((sv = get_section(conf, section)) == NULL) + } + if ((sv = get_section(conf, section)) == NULL) { sv = NCONF_new_section(conf, section); + } if (sv == NULL) { OPENSSL_PUT_ERROR(CONF, def_load_bio, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); goto err; @@ -619,11 +629,13 @@ static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) { *end = '\0'; p++; start = eat_ws(conf, p); - while (!IS_EOF(conf, *p)) + while (!IS_EOF(conf, *p)) { p++; + } p--; - while ((p != start) && (IS_WS(conf, *p))) + while ((p != start) && (IS_WS(conf, *p))) { p--; + } p++; *p = '\0'; @@ -631,8 +643,9 @@ static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) { OPENSSL_PUT_ERROR(CONF, def_load_bio, ERR_R_MALLOC_FAILURE); goto err; } - if (psection == NULL) + if (psection == NULL) { psection = section; + } v->name = (char *)OPENSSL_malloc(strlen(pname) + 1); v->value = NULL; if (v->name == NULL) { @@ -640,18 +653,21 @@ static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) { goto err; } BUF_strlcpy(v->name, pname, strlen(pname) + 1); - if (!str_copy(conf, psection, &(v->value), start)) + if (!str_copy(conf, psection, &(v->value), start)) { goto err; + } if (strcmp(psection, section) != 0) { - if ((tv = get_section(conf, psection)) == NULL) + if ((tv = get_section(conf, psection)) == NULL) { tv = NCONF_new_section(conf, psection); + } if (tv == NULL) { OPENSSL_PUT_ERROR(CONF, def_load_bio, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); goto err; } - } else + } else { tv = sv; + } if (add_string(conf, tv, v) == 0) { OPENSSL_PUT_ERROR(CONF, def_load_bio, ERR_R_MALLOC_FAILURE); goto err; @@ -659,29 +675,37 @@ static int def_load_bio(CONF *conf, BIO *in, long *out_error_line) { v = NULL; } } - if (buff != NULL) + if (buff != NULL) { BUF_MEM_free(buff); - if (section != NULL) + } + if (section != NULL) { OPENSSL_free(section); + } return 1; err: - if (buff != NULL) + if (buff != NULL) { BUF_MEM_free(buff); - if (section != NULL) + } + if (section != NULL) { OPENSSL_free(section); - if (out_error_line != NULL) + } + if (out_error_line != NULL) { *out_error_line = eline; + } BIO_snprintf(btmp, sizeof btmp, "%ld", eline); ERR_add_error_data(2, "line ", btmp); if (v != NULL) { - if (v->name != NULL) + if (v->name != NULL) { OPENSSL_free(v->name); - if (v->value != NULL) + } + if (v->value != NULL) { OPENSSL_free(v->value); - if (v != NULL) + } + if (v != NULL) { OPENSSL_free(v); + } } return 0; } @@ -701,6 +725,10 @@ int NCONF_load(CONF *conf, const char *filename, long *out_error_line) { return ret; } +int NCONF_load_bio(CONF *conf, BIO *bio, long *out_error_line) { + return def_load_bio(conf, bio, out_error_line); +} + int CONF_parse_list(const char *list, char sep, int remove_whitespace, int (*list_cb)(const char *elem, int len, void *usr), void *arg) { diff --git a/src/crypto/conf/conf_error.c b/src/crypto/conf/conf_error.c deleted file mode 100644 index b5dd001..0000000 --- a/src/crypto/conf/conf_error.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include <openssl/err.h> - -#include <openssl/conf.h> - -const ERR_STRING_DATA CONF_error_string_data[] = { - {ERR_PACK(ERR_LIB_CONF, CONF_F_CONF_parse_list, 0), "CONF_parse_list"}, - {ERR_PACK(ERR_LIB_CONF, CONF_F_NCONF_load, 0), "NCONF_load"}, - {ERR_PACK(ERR_LIB_CONF, CONF_F_def_load_bio, 0), "def_load_bio"}, - {ERR_PACK(ERR_LIB_CONF, CONF_F_str_copy, 0), "str_copy"}, - {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_LIST_CANNOT_BE_NULL), "LIST_CANNOT_BE_NULL"}, - {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MISSING_CLOSE_SQUARE_BRACKET), "MISSING_CLOSE_SQUARE_BRACKET"}, - {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_MISSING_EQUAL_SIGN), "MISSING_EQUAL_SIGN"}, - {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_CLOSE_BRACE), "NO_CLOSE_BRACE"}, - {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_UNABLE_TO_CREATE_NEW_SECTION), "UNABLE_TO_CREATE_NEW_SECTION"}, - {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_VARIABLE_HAS_NO_VALUE), "VARIABLE_HAS_NO_VALUE"}, - {0, NULL}, -}; |