Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2015-02-10 05:05:57 +0300
committerAdam Langley <agl@google.com>2015-02-10 05:10:46 +0300
commitcf310a619705fc10323a720718eec3009846d756 (patch)
treed67aa41e9825f607e85199be71b1295befe5e78c /crypto
parent29b186736c1e95e2005b13674a6930b282b55e21 (diff)
Remove more bits of ERR_STRING_DATA.
Also, Clang doesn't like static asserts with the same message and ERR_free_strings should still free the error queues, although it's badly misnamed now. Change-Id: Ibff8eb50f93c0b56c3eeb17a300e8501a31c3ab8 Reviewed-on: https://boringssl-review.googlesource.com/3370 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/err/err.c5
-rw-r--r--crypto/err/err_data.h66
-rw-r--r--crypto/err/err_data_generate.go4
-rw-r--r--crypto/err/err_impl.c1
-rw-r--r--crypto/lhash/make_macros.sh11
5 files changed, 46 insertions, 41 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c
index 6ca7f23b..144f1c36 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -778,6 +778,9 @@ int ERR_pop_to_mark(void) {
void ERR_load_crypto_strings(void) {}
-void ERR_free_strings(void) {}
+void ERR_free_strings(void) {
+ err_fns_check();
+ ERRFN(shutdown)(err_state_free);
+}
void ERR_load_BIO_strings(void) {}
diff --git a/crypto/err/err_data.h b/crypto/err/err_data.h
index 61323d44..2053ef54 100644
--- a/crypto/err/err_data.h
+++ b/crypto/err/err_data.h
@@ -18,39 +18,39 @@
#include <openssl/type_check.h>
-OPENSSL_COMPILE_ASSERT(ERR_LIB_NONE == 1, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_SYS == 2, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_BN == 3, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_RSA == 4, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_DH == 5, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_EVP == 6, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_BUF == 7, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_OBJ == 8, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_PEM == 9, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_DSA == 10, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_X509 == 11, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_ASN1 == 12, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_CONF == 13, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_CRYPTO == 14, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_EC == 15, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_SSL == 16, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_BIO == 17, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS7 == 18, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS8 == 19, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_X509V3 == 20, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_RAND == 21, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_ENGINE == 22, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_OCSP == 23, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_UI == 24, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_COMP == 25, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDSA == 26, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDH == 27, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_HMAC == 28, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_DIGEST == 29, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_CIPHER == 30, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_USER == 31, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_LIB_HKDF == 32, library_values_changed);
-OPENSSL_COMPILE_ASSERT(ERR_NUM_LIBS == 33, library_values_changed);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_NONE == 1, library_values_changed_1);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_SYS == 2, library_values_changed_2);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_BN == 3, library_values_changed_3);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_RSA == 4, library_values_changed_4);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_DH == 5, library_values_changed_5);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_EVP == 6, library_values_changed_6);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_BUF == 7, library_values_changed_7);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_OBJ == 8, library_values_changed_8);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_PEM == 9, library_values_changed_9);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_DSA == 10, library_values_changed_10);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_X509 == 11, library_values_changed_11);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_ASN1 == 12, library_values_changed_12);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_CONF == 13, library_values_changed_13);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_CRYPTO == 14, library_values_changed_14);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_EC == 15, library_values_changed_15);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_SSL == 16, library_values_changed_16);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_BIO == 17, library_values_changed_17);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS7 == 18, library_values_changed_18);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS8 == 19, library_values_changed_19);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_X509V3 == 20, library_values_changed_20);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_RAND == 21, library_values_changed_21);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_ENGINE == 22, library_values_changed_22);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_OCSP == 23, library_values_changed_23);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_UI == 24, library_values_changed_24);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_COMP == 25, library_values_changed_25);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDSA == 26, library_values_changed_26);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDH == 27, library_values_changed_27);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_HMAC == 28, library_values_changed_28);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_DIGEST == 29, library_values_changed_29);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_CIPHER == 30, library_values_changed_30);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_USER == 31, library_values_changed_31);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_HKDF == 32, library_values_changed_32);
+OPENSSL_COMPILE_ASSERT(ERR_NUM_LIBS == 33, library_values_changed_num);
static const uint32_t kFunctionValues[] = {
0xc3232b0,
diff --git a/crypto/err/err_data_generate.go b/crypto/err/err_data_generate.go
index c29c8ae8..925b45e4 100644
--- a/crypto/err/err_data_generate.go
+++ b/crypto/err/err_data_generate.go
@@ -272,9 +272,9 @@ func main() {
`)
for i, name := range libraryNames {
- fmt.Fprintf(out, "OPENSSL_COMPILE_ASSERT(ERR_LIB_%s == %d, library_values_changed);\n", name, i+1)
+ fmt.Fprintf(out, "OPENSSL_COMPILE_ASSERT(ERR_LIB_%s == %d, library_values_changed_%d);\n", name, i+1, i+1)
}
- fmt.Fprintf(out, "OPENSSL_COMPILE_ASSERT(ERR_NUM_LIBS == %d, library_values_changed);\n", len(libraryNames) + 1)
+ fmt.Fprintf(out, "OPENSSL_COMPILE_ASSERT(ERR_NUM_LIBS == %d, library_values_changed_num);\n", len(libraryNames) + 1)
out.WriteString("\n")
e.functions.WriteTo(out, "Function")
diff --git a/crypto/err/err_impl.c b/crypto/err/err_impl.c
index 0c36f82e..5eb75b70 100644
--- a/crypto/err/err_impl.c
+++ b/crypto/err/err_impl.c
@@ -116,7 +116,6 @@
DEFINE_LHASH_OF(ERR_STATE);
-DEFINE_LHASH_OF(ERR_STRING_DATA);
/* state_hash is a map from thread ID to ERR_STATE. It works like thread-local
* storage. */
diff --git a/crypto/lhash/make_macros.sh b/crypto/lhash/make_macros.sh
index 79d1e57d..8a876af3 100644
--- a/crypto/lhash/make_macros.sh
+++ b/crypto/lhash/make_macros.sh
@@ -1,6 +1,9 @@
#!/bin/sh
-cat > lhash_macros.h << EOF
+include_dir=../../include/openssl
+out=${include_dir}/lhash_macros.h
+
+cat > $out << EOF
/* Copyright (c) 2014, Google Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -24,7 +27,7 @@ EOF
output_lhash () {
type=$1
- cat >> lhash_macros.h << EOF
+ cat >> $out << EOF
/* ${type} */
#define lh_${type}_new(hash, comp)\\
((LHASH_OF(${type})*) lh_new(CHECKED_CAST(lhash_hash_func, uint32_t (*) (const ${type} *), hash), CHECKED_CAST(lhash_cmp_func, int (*) (const ${type} *a, const ${type} *b), comp)))
@@ -54,11 +57,11 @@ output_lhash () {
EOF
}
-lhash_types=$(cat lhash.h | grep '^ \* LHASH_OF:' | sed -e 's/.*LHASH_OF://' -e 's/ .*//')
+lhash_types=$(cat ${include_dir}/lhash.h | grep '^ \* LHASH_OF:' | sed -e 's/.*LHASH_OF://' -e 's/ .*//')
for type in $lhash_types; do
echo Hash of ${type}
output_lhash "${type}"
done
-clang-format -i lhash_macros.h
+clang-format -i $out