diff options
| author | tedu <> | 2014-04-15 20:06:10 +0000 |
|---|---|---|
| committer | tedu <> | 2014-04-15 20:06:10 +0000 |
| commit | 3c7d2178681a2741a8cc8a042cb2ea6ee28528b8 (patch) | |
| tree | 11be20c8110348001494179db4f9b0b67ce149ba /src/lib/libcrypto/evp/evp_enc.c | |
| parent | 4c8a9a73429ac4a1d79f4bab6a397df643934861 (diff) | |
| download | openbsd-3c7d2178681a2741a8cc8a042cb2ea6ee28528b8.tar.gz openbsd-3c7d2178681a2741a8cc8a042cb2ea6ee28528b8.tar.bz2 openbsd-3c7d2178681a2741a8cc8a042cb2ea6ee28528b8.zip | |
remove FIPS mode support. people who require FIPS can buy something that
meets their needs, but dumping it in here only penalizes the rest of us.
ok beck deraadt
Diffstat (limited to 'src/lib/libcrypto/evp/evp_enc.c')
| -rw-r--r-- | src/lib/libcrypto/evp/evp_enc.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c index 0c54f05e6e..50403a7578 100644 --- a/src/lib/libcrypto/evp/evp_enc.c +++ b/src/lib/libcrypto/evp/evp_enc.c | |||
| @@ -64,17 +64,9 @@ | |||
| 64 | #ifndef OPENSSL_NO_ENGINE | 64 | #ifndef OPENSSL_NO_ENGINE |
| 65 | #include <openssl/engine.h> | 65 | #include <openssl/engine.h> |
| 66 | #endif | 66 | #endif |
| 67 | #ifdef OPENSSL_FIPS | ||
| 68 | #include <openssl/fips.h> | ||
| 69 | #endif | ||
| 70 | #include "evp_locl.h" | 67 | #include "evp_locl.h" |
| 71 | 68 | ||
| 72 | #ifdef OPENSSL_FIPS | ||
| 73 | #define M_do_cipher(ctx, out, in, inl) FIPS_cipher(ctx, out, in, inl) | ||
| 74 | #else | ||
| 75 | #define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl) | 69 | #define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl) |
| 76 | #endif | ||
| 77 | |||
| 78 | 70 | ||
| 79 | const char EVP_version[]="EVP" OPENSSL_VERSION_PTEXT; | 71 | const char EVP_version[]="EVP" OPENSSL_VERSION_PTEXT; |
| 80 | 72 | ||
| @@ -169,10 +161,6 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *imp | |||
| 169 | ctx->engine = NULL; | 161 | ctx->engine = NULL; |
| 170 | #endif | 162 | #endif |
| 171 | 163 | ||
| 172 | #ifdef OPENSSL_FIPS | ||
| 173 | if (FIPS_mode()) | ||
| 174 | return FIPS_cipherinit(ctx, cipher, key, iv, enc); | ||
| 175 | #endif | ||
| 176 | ctx->cipher=cipher; | 164 | ctx->cipher=cipher; |
| 177 | if (ctx->cipher->ctx_size) | 165 | if (ctx->cipher->ctx_size) |
| 178 | { | 166 | { |
| @@ -206,10 +194,6 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *imp | |||
| 206 | #ifndef OPENSSL_NO_ENGINE | 194 | #ifndef OPENSSL_NO_ENGINE |
| 207 | skip_to_init: | 195 | skip_to_init: |
| 208 | #endif | 196 | #endif |
| 209 | #ifdef OPENSSL_FIPS | ||
| 210 | if (FIPS_mode()) | ||
| 211 | return FIPS_cipherinit(ctx, cipher, key, iv, enc); | ||
| 212 | #endif | ||
| 213 | /* we assume block size is a power of 2 in *cryptUpdate */ | 197 | /* we assume block size is a power of 2 in *cryptUpdate */ |
| 214 | OPENSSL_assert(ctx->cipher->block_size == 1 | 198 | OPENSSL_assert(ctx->cipher->block_size == 1 |
| 215 | || ctx->cipher->block_size == 8 | 199 | || ctx->cipher->block_size == 8 |
| @@ -568,7 +552,6 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) | |||
| 568 | 552 | ||
| 569 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) | 553 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) |
| 570 | { | 554 | { |
| 571 | #ifndef OPENSSL_FIPS | ||
| 572 | if (c->cipher != NULL) | 555 | if (c->cipher != NULL) |
| 573 | { | 556 | { |
| 574 | if(c->cipher->cleanup && !c->cipher->cleanup(c)) | 557 | if(c->cipher->cleanup && !c->cipher->cleanup(c)) |
| @@ -579,16 +562,12 @@ int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) | |||
| 579 | } | 562 | } |
| 580 | if (c->cipher_data) | 563 | if (c->cipher_data) |
| 581 | OPENSSL_free(c->cipher_data); | 564 | OPENSSL_free(c->cipher_data); |
| 582 | #endif | ||
| 583 | #ifndef OPENSSL_NO_ENGINE | 565 | #ifndef OPENSSL_NO_ENGINE |
| 584 | if (c->engine) | 566 | if (c->engine) |
| 585 | /* The EVP_CIPHER we used belongs to an ENGINE, release the | 567 | /* The EVP_CIPHER we used belongs to an ENGINE, release the |
| 586 | * functional reference we held for this reason. */ | 568 | * functional reference we held for this reason. */ |
| 587 | ENGINE_finish(c->engine); | 569 | ENGINE_finish(c->engine); |
| 588 | #endif | 570 | #endif |
| 589 | #ifdef OPENSSL_FIPS | ||
| 590 | FIPS_cipher_ctx_cleanup(c); | ||
| 591 | #endif | ||
| 592 | memset(c,0,sizeof(EVP_CIPHER_CTX)); | 571 | memset(c,0,sizeof(EVP_CIPHER_CTX)); |
| 593 | return 1; | 572 | return 1; |
| 594 | } | 573 | } |
