Handle CT error macros separately
authorRichard Levitte <levitte@openssl.org>
Mon, 19 Oct 2015 02:20:01 +0000 (04:20 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 21 Oct 2015 21:57:29 +0000 (23:57 +0200)
Because the default error macro generator assumes the header file with
error macros is in include/openssl and therefore generates a C file
with error texts that include <openssl/{name}.h>, we need to generate
the error macros and texts for CT separately, since the CT module
doesn't follow the default criteria.

Reviewed-by: Matt Caswell <matt@openssl.org>
Makefile.org
crypto/ct/Makefile
crypto/ct/ct.ec [new file with mode: 0644]
crypto/ct/ct_err.c
crypto/err/openssl.ec

index 5aa721f277e2b109b28d89445d5ed1d8d1d05407..629cdaeffd065a7eddb2078638efe3f91bc0b6a4 100644 (file)
@@ -468,6 +468,7 @@ errors:
        $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
        $(PERL) util/mkerr.pl -recurse -write
        (cd engines; $(MAKE) PERL=$(PERL) errors)
+       (cd crypto/ct; $(MAKE) PERL=$(PERL) errors)
 
 stacks:
        $(PERL) util/mkstack.pl -write
index 8d6e6b7b9b0f1dc971d4c3cd741729f92d252461..813e5baaed922aa71484c1b269e9e38a3bb34326 100644 (file)
@@ -15,8 +15,8 @@ CFLAGS= $(INCLUDES) $(CFLAG)
 GENERAL=Makefile
 
 LIB=$(TOP)/libcrypto.a
-LIBSRC= ct_lib.c
-LIBOBJ= ct_lib.o
+LIBSRC= ct_lib.c ct_err.c
+LIBOBJ= ct_lib.o ct_err.o
 
 SRC= $(LIBSRC)
 
@@ -42,6 +42,9 @@ files:
 tags:
        ctags $(SRC)
 
+errors:
+       $(PERL) $(TOP)/util/mkerr.pl -conf ct.ec -hprefix internal/ -write *.c
+
 lint:
        lint -DLINT $(INCLUDES) $(SRC)>fluff
 
diff --git a/crypto/ct/ct.ec b/crypto/ct/ct.ec
new file mode 100644 (file)
index 0000000..6f50f9a
--- /dev/null
@@ -0,0 +1,6 @@
+# crypto/ct/ct.ec
+
+# configuration file for util/mkerr.pl
+
+# files that may have to be rewritten by util/mkerr.pl
+L CT   ../../crypto/include/internal/ct_int.h          ct_err.c
index d2781c5b5f6c1a57627dda77c438cbd87a79fb95..df79252449e5fa5be1132ad684ca827023fc44ca 100644 (file)
@@ -1,4 +1,4 @@
-/* crypto/ct/ct_err.c */
+/* ct_err.c */
 /* ====================================================================
  * Copyright (c) 1999-2015 The OpenSSL Project.  All rights reserved.
  *
@@ -61,7 +61,7 @@
 
 #include <stdio.h>
 #include <openssl/err.h>
-#include <openssl/ct_locl.h>
+#include <internal/ct_int.h>
 
 /* BEGIN ERROR CODES */
 #ifndef OPENSSL_NO_ERR
index 08b0c0ba29a45c7506a422808530a511906fad53..8a10b80b0499ffd9e2647c0f7c91a45449f2f98d 100644 (file)
@@ -36,7 +36,6 @@ L HMAC                include/openssl/hmac.h          crypto/hmac/hmac_err.c
 L CMS          include/openssl/cms.h           crypto/cms/cms_err.c
 L JPAKE                include/openssl/jpake.h         crypto/jpake/jpake_err.c
 L FIPS         include/openssl/fips.h          crypto/fips_err.h
-L CT           crypto/ct/ct_locl.h             crypto/ct/ct_err.c
 
 # additional header files to be scanned for function names
 L NONE         crypto/x509/x509_vfy.h          NONE