diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-12-28 11:27:31 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-01-13 09:09:36 +0100 |
commit | bf973d0697e61a44dc46d08b0421a08a8cb61887 (patch) | |
tree | 023ed993172263fa1c261e8321d77b325380d95f /providers/implementations/storemgmt | |
parent | 5a2d0ef36f4c130758a9d5e84f93004458e3ce60 (diff) | |
download | openssl-bf973d0697e61a44dc46d08b0421a08a8cb61887.tar.gz |
Add X509_NAME_hash_ex() to be able to check if it failed due to unsupported SHA1
Deprecate X509_NAME_hash()
Document X509_NAME_hash_ex(), X509_NAME_hash(), X509_{subject,issuer}_name_hash()
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13762)
Diffstat (limited to 'providers/implementations/storemgmt')
-rw-r--r-- | providers/implementations/storemgmt/file_store.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/providers/implementations/storemgmt/file_store.c b/providers/implementations/storemgmt/file_store.c index 5607f169cc..15af70218c 100644 --- a/providers/implementations/storemgmt/file_store.c +++ b/providers/implementations/storemgmt/file_store.c @@ -471,6 +471,7 @@ static int file_set_ctx_params(void *loaderctx, const OSSL_PARAM params[]) size_t der_len = 0; X509_NAME *x509_name; unsigned long hash; + int ok; if (ctx->type != IS_DIR) { ERR_raise(ERR_LIB_PROV, @@ -481,10 +482,14 @@ static int file_set_ctx_params(void *loaderctx, const OSSL_PARAM params[]) if (!OSSL_PARAM_get_octet_string_ptr(p, (const void **)&der, &der_len) || (x509_name = d2i_X509_NAME(NULL, &der, der_len)) == NULL) return 0; - hash = X509_NAME_hash(x509_name); + hash = X509_NAME_hash_ex(x509_name, + ossl_prov_ctx_get0_libctx(ctx->provctx), NULL, + &ok); BIO_snprintf(ctx->_.dir.search_name, sizeof(ctx->_.dir.search_name), "%08lx", hash); X509_NAME_free(x509_name); + if (ok == 0) + return 0; } return 1; } |