diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-08-10 14:07:03 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-08-10 14:07:06 +0200 |
commit | f246174d4221e11cdac2e9b73e41a127f71e597d (patch) | |
tree | edaf4d7f54b0a437739b860a8f7ccb340b65e952 | |
parent | 662a6a4c301f2a1ec8687b9ad5832c7cf6aa50f4 (diff) | |
download | gnutls-f246174d4221e11cdac2e9b73e41a127f71e597d.tar.gz |
gnutls_key_generate: fail if the state of the library is invalid
Suggested by Stephan Mueller.
-rw-r--r-- | lib/crypto-api.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/crypto-api.c b/lib/crypto-api.c index 7d3d5ed8b5..e8fc7b9404 100644 --- a/lib/crypto-api.c +++ b/lib/crypto-api.c @@ -1,5 +1,6 @@ /* - * Copyright (C) 2000-2012 Free Software Foundation, Inc. + * Copyright (C) 2000-2016 Free Software Foundation, Inc. + * Copyright (C) 2016 Red Hat, Inc. * * Author: Nikos Mavrogiannopoulos * @@ -592,6 +593,8 @@ int gnutls_key_generate(gnutls_datum_t * key, unsigned int key_size) { int ret; + FAIL_IF_LIB_ERROR; + #ifdef ENABLE_FIPS140 /* The FIPS140 approved RNGs are not allowed to be used * to extract key sizes longer than their original seed. |