Add NCONF_load_bio.
Change-Id: Icebf5c08dde01f07e4d16e782a75be990a078e1a
diff --git a/crypto/conf/conf.c b/crypto/conf/conf.c
index dbfe563..213efc5 100644
--- a/crypto/conf/conf.c
+++ b/crypto/conf/conf.c
@@ -90,9 +90,13 @@
}
}
-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;
@@ -721,6 +725,10 @@
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/include/openssl/conf.h b/include/openssl/conf.h
index 591ff5c..05bad9b 100644
--- a/include/openssl/conf.h
+++ b/include/openssl/conf.h
@@ -90,8 +90,9 @@
};
-/* NCONF_new returns a fresh, empty |CONF|, or NULL on error. */
-CONF *NCONF_new(void);
+/* NCONF_new returns a fresh, empty |CONF|, or NULL on error. The |method|
+ * argument must be NULL. */
+CONF *NCONF_new(void *method);
/* NCONF_free frees all the data owned by |conf| and then |conf| itself. */
void NCONF_free(CONF *conf);
@@ -102,6 +103,10 @@
* number of the line that contained the error. */
int NCONF_load(CONF *conf, const char *filename, long *out_error_line);
+/* NCONF_load_bio acts like |NCONF_load| but reads from |bio| rather than from
+ * a named file. */
+int NCONF_load_bio(CONF *conf, BIO *bio, long *out_error_line);
+
/* NCONF_get_section returns a stack of values for a given section in |conf|.
* If |section| is NULL, the default section is returned. It returns NULL on
* error. */