diff options
| author | miod <> | 2014-07-12 14:58:32 +0000 |
|---|---|---|
| committer | miod <> | 2014-07-12 14:58:32 +0000 |
| commit | 19a19b8eff7c4c610f87ca07a02612af9017c9d9 (patch) | |
| tree | b1d347ffdd3c76df9af253450a9dbb01eb287231 /src/lib/libcrypto/cmac | |
| parent | 0b2f8fc14c724e7d92c6dc1b5f0d1e0e6c411f34 (diff) | |
| download | openbsd-19a19b8eff7c4c610f87ca07a02612af9017c9d9.tar.gz openbsd-19a19b8eff7c4c610f87ca07a02612af9017c9d9.tar.bz2 openbsd-19a19b8eff7c4c610f87ca07a02612af9017c9d9.zip | |
Principle of least surprise: make CMAC_CTX_free(), OCSP_REQ_CTX_free() and
X509_STORE_CTX_free() accept NULL pointers as input without dereferencing them,
like all the other well-behaved *_CTX_free() functions do.
Diffstat (limited to 'src/lib/libcrypto/cmac')
| -rw-r--r-- | src/lib/libcrypto/cmac/cmac.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libcrypto/cmac/cmac.c b/src/lib/libcrypto/cmac/cmac.c index baba674ec1..18635b942a 100644 --- a/src/lib/libcrypto/cmac/cmac.c +++ b/src/lib/libcrypto/cmac/cmac.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cmac.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */ | 1 | /* $OpenBSD: cmac.c,v 1.9 2014/07/12 14:58:32 miod Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project. | 3 | * project. |
| 4 | */ | 4 | */ |
| @@ -123,6 +123,9 @@ CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx) | |||
| 123 | void | 123 | void |
| 124 | CMAC_CTX_free(CMAC_CTX *ctx) | 124 | CMAC_CTX_free(CMAC_CTX *ctx) |
| 125 | { | 125 | { |
| 126 | if (ctx == NULL) | ||
| 127 | return; | ||
| 128 | |||
| 126 | CMAC_CTX_cleanup(ctx); | 129 | CMAC_CTX_cleanup(ctx); |
| 127 | free(ctx); | 130 | free(ctx); |
| 128 | } | 131 | } |
