diff options
| author | djm <> | 2012-10-13 21:23:50 +0000 |
|---|---|---|
| committer | djm <> | 2012-10-13 21:23:50 +0000 |
| commit | 228cae30b117c2493f69ad3c195341cd6ec8d430 (patch) | |
| tree | 29ff00b10d52c0978077c4fd83c33b065bade73e /src/lib/libcrypto/aes/aes_misc.c | |
| parent | 731838c66b52c0ae5888333005b74115a620aa96 (diff) | |
| download | openbsd-228cae30b117c2493f69ad3c195341cd6ec8d430.tar.gz openbsd-228cae30b117c2493f69ad3c195341cd6ec8d430.tar.bz2 openbsd-228cae30b117c2493f69ad3c195341cd6ec8d430.zip | |
import OpenSSL-1.0.1c
Diffstat (limited to 'src/lib/libcrypto/aes/aes_misc.c')
| -rw-r--r-- | src/lib/libcrypto/aes/aes_misc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/libcrypto/aes/aes_misc.c b/src/lib/libcrypto/aes/aes_misc.c index 4fead1b4c7..f083488ecb 100644 --- a/src/lib/libcrypto/aes/aes_misc.c +++ b/src/lib/libcrypto/aes/aes_misc.c | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | */ | 50 | */ |
| 51 | 51 | ||
| 52 | #include <openssl/opensslv.h> | 52 | #include <openssl/opensslv.h> |
| 53 | #include <openssl/crypto.h> | ||
| 53 | #include <openssl/aes.h> | 54 | #include <openssl/aes.h> |
| 54 | #include "aes_locl.h" | 55 | #include "aes_locl.h" |
| 55 | 56 | ||
| @@ -62,3 +63,23 @@ const char *AES_options(void) { | |||
| 62 | return "aes(partial)"; | 63 | return "aes(partial)"; |
| 63 | #endif | 64 | #endif |
| 64 | } | 65 | } |
| 66 | |||
| 67 | /* FIPS wrapper functions to block low level AES calls in FIPS mode */ | ||
| 68 | |||
| 69 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, | ||
| 70 | AES_KEY *key) | ||
| 71 | { | ||
| 72 | #ifdef OPENSSL_FIPS | ||
| 73 | fips_cipher_abort(AES); | ||
| 74 | #endif | ||
| 75 | return private_AES_set_encrypt_key(userKey, bits, key); | ||
| 76 | } | ||
| 77 | |||
| 78 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, | ||
| 79 | AES_KEY *key) | ||
| 80 | { | ||
| 81 | #ifdef OPENSSL_FIPS | ||
| 82 | fips_cipher_abort(AES); | ||
| 83 | #endif | ||
| 84 | return private_AES_set_decrypt_key(userKey, bits, key); | ||
| 85 | } | ||
