Take gcm128.c and ghash assembler modules into the build loop.
[oweals/openssl.git] / crypto / conf / conf_def.c
index f14de2293ecff0f440039ce530dc0ff6a51e55a1..0b571b03942750d6f42357825e0359759be5e803 100644 (file)
@@ -60,6 +60,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include "cryptlib.h"
 #include <openssl/stack.h>
 #include <openssl/lhash.h>
 #include <openssl/conf.h>
@@ -67,7 +68,6 @@
 #include "conf_def.h"
 #include <openssl/buffer.h>
 #include <openssl/err.h>
-#include "cryptlib.h"
 
 static char *eat_ws(CONF *conf, char *p);
 static char *eat_alpha_numeric(CONF *conf, char *p);
@@ -88,7 +88,7 @@ static int def_dump(const CONF *conf, BIO *bp);
 static int def_is_number(const CONF *conf, char c);
 static int def_to_int(const CONF *conf, char c);
 
-const char *CONF_def_version="CONF_def" OPENSSL_VERSION_PTEXT;
+const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT;
 
 static CONF_METHOD default_method = {
        "OpenSSL default",
@@ -129,7 +129,7 @@ static CONF *def_create(CONF_METHOD *meth)
        {
        CONF *ret;
 
-       ret = (CONF *)OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *));
+       ret = OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *));
        if (ret)
                if (meth->init(ret) == 0)
                        {
@@ -145,7 +145,7 @@ static int def_init_default(CONF *conf)
                return 0;
 
        conf->meth = &default_method;
-       conf->meth_data = (void *)CONF_type_default;
+       conf->meth_data = CONF_type_default;
        conf->data = NULL;
 
        return 1;
@@ -613,13 +613,13 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
                                e++;
                                }
                        /* So at this point we have
-                        * ns which is the start of the name string which is
+                        * np which is the start of the name string which is
                         *   '\0' terminated. 
-                        * cs which is the start of the section string which is
+                        * cp which is the start of the section string which is
                         *   '\0' terminated.
                         * e is the 'next point after'.
-                        * r and s are the chars replaced by the '\0'
-                        * rp and sp is where 'r' and 's' came from.
+                        * r and rr are the chars replaced by the '\0'
+                        * rp and rrp is where 'r' and 'rr' came from.
                         */
                        p=_CONF_get_string(conf,cp,np);
                        if (rrp != NULL) *rrp=rr;
@@ -638,6 +638,11 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
                           points at.  /RL */
                        len -= e-from;
                        from=e;
+
+                       /* In case there were no braces or parenthesis around
+                          the variable reference, we have to put back the
+                          character that was replaced with a '\0'.  /RL */
+                       *rp = r;
                        }
                else
                        buf->data[to++]= *(from++);
@@ -717,7 +722,7 @@ static char *scan_dquote(CONF *conf, char *p)
        return(p);
        }
 
-static void dump_value(CONF_VALUE *a, BIO *out)
+static void dump_value_doall_arg(CONF_VALUE *a, BIO *out)
        {
        if (a->name)
                BIO_printf(out, "[%s] %s=%s\n", a->section, a->name, a->value);
@@ -725,11 +730,12 @@ static void dump_value(CONF_VALUE *a, BIO *out)
                BIO_printf(out, "[[%s]]\n", a->section);
        }
 
-static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_value, CONF_VALUE *, BIO *)
+static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_value, CONF_VALUE, BIO)
 
 static int def_dump(const CONF *conf, BIO *out)
        {
-       lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(dump_value), out);
+       lh_CONF_VALUE_doall_arg(conf->data, LHASH_DOALL_ARG_FN(dump_value),
+                               BIO, out);
        return 1;
        }