summaryrefslogtreecommitdiffstats
path: root/crypto/rand
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-02-13 13:11:50 +0100
committerRichard Levitte <levitte@openssl.org>2020-02-15 06:48:04 +0100
commitcd5acbb47518b8abf9030ace7ad6db9e02d6b968 (patch)
tree7162fb142cf39b4b51875b20c0c64bcb37fbd907 /crypto/rand
parentc781d46beb202893ee1509462058d6a8ec34b85e (diff)
VMS: Correct error reporting in crypto/rand/rand_vms.c
The future style that's coming with OpenSSL 3.0 was used, we need to revert that back to "traditional" style. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11088)
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/rand_err.c4
-rw-r--r--crypto/rand/rand_vms.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/crypto/rand/rand_err.c b/crypto/rand/rand_err.c
index 071376a173..a3ae5f53c2 100644
--- a/crypto/rand/rand_err.c
+++ b/crypto/rand/rand_err.c
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -14,6 +14,8 @@
#ifndef OPENSSL_NO_ERR
static const ERR_STRING_DATA RAND_str_functs[] = {
+ {ERR_PACK(ERR_LIB_RAND, RAND_F_DATA_COLLECT_METHOD, 0),
+ "data_collect_method"},
{ERR_PACK(ERR_LIB_RAND, RAND_F_DRBG_BYTES, 0), "drbg_bytes"},
{ERR_PACK(ERR_LIB_RAND, RAND_F_DRBG_GET_ENTROPY, 0), "drbg_get_entropy"},
{ERR_PACK(ERR_LIB_RAND, RAND_F_DRBG_SETUP, 0), "drbg_setup"},
diff --git a/crypto/rand/rand_vms.c b/crypto/rand/rand_vms.c
index ba8386e30e..d09b2380de 100644
--- a/crypto/rand/rand_vms.c
+++ b/crypto/rand/rand_vms.c
@@ -13,6 +13,8 @@
# define __NEW_STARLET 1 /* New starlet definitions since VMS 7.0 */
# include <unistd.h>
# include "internal/cryptlib.h"
+# include <openssl/bio.h>
+# include <openssl/err.h>
# include <openssl/rand.h>
# include "crypto/rand.h"
# include "rand_local.h"
@@ -456,9 +458,12 @@ size_t data_collect_method(RAND_POOL *pool)
* If we can't feed the requirements from the caller, we're in deep trouble.
*/
if (!ossl_assert(total_length >= bytes_needed)) {
- ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW,
- "Needed: %zu, Available: %zu",
- bytes_needed, total_length);
+ char buf[100]; /* That should be enough */
+
+ BIO_snprintf(buf, sizeof(buf), "Needed: %zu, Available: %zu",
+ bytes_needed, total_length);
+ RANDerr(RAND_F_DATA_COLLECT_METHOD, RAND_R_RANDOM_POOL_UNDERFLOW);
+ ERR_add_error_data(1, buf);
return 0;
}