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
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2014-07-02 03:48:28 +0400
committerAdam Langley <agl@google.com>2014-07-02 04:11:32 +0400
commit4042667eb90b5619e6ba2d8f6f407cb55f71c05a (patch)
tree6cd396117e3c9a5a59895027fef09e81f74a6ed6 /crypto/err/err_impl.c
parent2b0aeecabfbf3cf8eadcb7742899898fdaa3acfc (diff)
Add ERR_get_next_error_library back.
It was removed in the fork but it turned out to need it. Change-Id: I21030c8d5befecb63f2c40a59963bec1da1d96fb Reviewed-on: https://boringssl-review.googlesource.com/1081 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/err/err_impl.c')
-rw-r--r--crypto/err/err_impl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/err/err_impl.c b/crypto/err/err_impl.c
index ff2509d4..6544c7b5 100644
--- a/crypto/err/err_impl.c
+++ b/crypto/err/err_impl.c
@@ -125,6 +125,9 @@ static LHASH_OF(ERR_STATE) *state_hash = NULL;
* function / reason. */
static LHASH_OF(ERR_STRING_DATA) *error_hash = NULL;
+/* global_next_library contains the next custom library value to return. */
+static int global_next_library = ERR_NUM_LIBS;
+
/* err_string_data_hash is an lhash hash function for ERR_STRING_DATA. */
static uint32_t err_string_data_hash(const ERR_STRING_DATA *a) {
return OPENSSL_hash32(&a->error, sizeof(a->error));
@@ -271,10 +274,21 @@ static void err_shutdown(void) {
CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
}
+static int err_get_next_library(void) {
+ int ret;
+
+ CRYPTO_w_lock(CRYPTO_LOCK_ERR);
+ ret = global_next_library++;
+ CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
+
+ return ret;
+}
+
const struct ERR_FNS_st openssl_err_default_impl = {
err_shutdown,
err_get_item,
err_set_item,
err_del_item,
err_get_state,
+ err_get_next_library,
};