summaryrefslogtreecommitdiff
path: root/crypto/rand
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-06-19 12:58:06 -0400
committerRich Salz <rsalz@openssl.org>2017-06-20 08:12:04 -0400
commit0ea155fc1c4e6ba3655f435164ea3f884883df29 (patch)
treece65d1e7d33585e961b598b74bd0e22ffa2e2bca /crypto/rand
parent7447c49f0db741f886a9a187e29deef2e2e394db (diff)
downloadopenssl-new-0ea155fc1c4e6ba3655f435164ea3f884883df29.tar.gz
Add RAND_UNIMPLEMENTED error code
See old GitHub PR 38. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3714)
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/rand_err.c2
-rw-r--r--crypto/rand/rand_lib.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/crypto/rand/rand_err.c b/crypto/rand/rand_err.c
index 177a109498..6888ed9d9b 100644
--- a/crypto/rand/rand_err.c
+++ b/crypto/rand/rand_err.c
@@ -19,6 +19,8 @@ static const ERR_STRING_DATA RAND_str_functs[] = {
};
static const ERR_STRING_DATA RAND_str_reasons[] = {
+ {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FUNC_NOT_IMPLEMENTED),
+ "Function not implemented"},
{ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PRNG_NOT_SEEDED), "PRNG not seeded"},
{0, NULL}
};
diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c
index 7ffd10bd78..84d6b5d6c7 100644
--- a/crypto/rand/rand_lib.c
+++ b/crypto/rand/rand_lib.c
@@ -137,6 +137,7 @@ int RAND_bytes(unsigned char *buf, int num)
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth && meth->bytes)
return meth->bytes(buf, num);
+ RANDerr(RAND_F_RAND_BYTES, RAND_R_FUNC_NOT_IMPLEMENTED);
return (-1);
}