evp/e_aes.c: harmonize with 1.0.1.
authorAndy Polyakov <appro@openssl.org>
Thu, 27 Feb 2014 16:47:23 +0000 (17:47 +0100)
committerAndy Polyakov <appro@openssl.org>
Thu, 27 Feb 2014 16:47:23 +0000 (17:47 +0100)
crypto/evp/e_aes.c

index 77e4bead71450334d85b69d744582121d671d9ff..46c5757af3916a8384ff7852ab00123ad80d8c16 100644 (file)
 #include <assert.h>
 #include <openssl/aes.h>
 #include "evp_locl.h"
+#ifndef OPENSSL_FIPS
 #include "modes_lcl.h"
 #include <openssl/rand.h>
 
-#ifndef OPENSSL_FIPSCANISTER
-#undef EVP_CIPH_FLAG_FIPS
-#define EVP_CIPH_FLAG_FIPS 0
-#endif
-
 typedef struct
        {
        union { double align; AES_KEY ks; } ks;
@@ -1140,7 +1136,7 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
        case EVP_CTRL_GCM_SET_IVLEN:
                if (arg <= 0)
                        return 0;
-#ifdef OPENSSL_FIPSCANISTER
+#ifdef OPENSSL_FIPS
                if (FIPS_module_mode() && !(c->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW)
                                                 && arg < 12)
                        return 0;
@@ -1707,7 +1703,7 @@ static int aes_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                return 0;
        if (!out || !in || len<AES_BLOCK_SIZE)
                return 0;
-#ifdef OPENSSL_FIPSCANISTER
+#ifdef OPENSSL_FIPS
        /* Requirement of SP800-38E */
        if (FIPS_module_mode() && !(ctx->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW) &&
                        (len > (1UL<<20)*16))
@@ -1891,6 +1887,7 @@ BLOCK_CIPHER_custom(NID_aes,128,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS)
 BLOCK_CIPHER_custom(NID_aes,192,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS)
 BLOCK_CIPHER_custom(NID_aes,256,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS)
 
+#endif
 typedef struct
        {
        union { double align; AES_KEY ks; } ks;