is amusing.
ok deraadt@
#include <assert.h>
#include <openssl/aes.h>
#include "evp_locl.h"
-#ifndef OPENSSL_FIPS
#include "modes_lcl.h"
#include <openssl/rand.h>
case EVP_CTRL_GCM_SET_IVLEN:
if (arg <= 0)
return 0;
-#ifdef OPENSSL_FIPS
- if (FIPS_module_mode() &&
- !(c->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW) && arg < 12)
- return 0;
-#endif
/* Allocate memory for IV if needed */
if ((arg > EVP_MAX_IV_LENGTH) && (arg > gctx->ivlen)) {
if (gctx->iv != c->iv)
if (!out || !in || len < AES_BLOCK_SIZE)
return 0;
-#ifdef OPENSSL_FIPS
- /* Requirement of SP800-38E */
- if (FIPS_module_mode() &&
- !(ctx->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW) &&
- (len > (1UL << 20) * 16)) {
- EVPerr(EVP_F_AES_XTS_CIPHER, EVP_R_TOO_LARGE);
- return 0;
- }
-#endif
if (xctx->stream)
(*xctx->stream)(in, out, len, xctx->xts.key1, xctx->xts.key2,
ctx->iv);
EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS)
#endif
-#endif
#include <openssl/des.h>
#include <openssl/rand.h>
-#ifndef OPENSSL_FIPS
static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc);
return &des_ede3_ecb;
}
#endif
-#endif
#include <assert.h>
#include <openssl/aes.h>
#include "evp_locl.h"
-#ifndef OPENSSL_FIPS
#include "modes_lcl.h"
#include <openssl/rand.h>
case EVP_CTRL_GCM_SET_IVLEN:
if (arg <= 0)
return 0;
-#ifdef OPENSSL_FIPS
- if (FIPS_module_mode() &&
- !(c->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW) && arg < 12)
- return 0;
-#endif
/* Allocate memory for IV if needed */
if ((arg > EVP_MAX_IV_LENGTH) && (arg > gctx->ivlen)) {
if (gctx->iv != c->iv)
if (!out || !in || len < AES_BLOCK_SIZE)
return 0;
-#ifdef OPENSSL_FIPS
- /* Requirement of SP800-38E */
- if (FIPS_module_mode() &&
- !(ctx->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW) &&
- (len > (1UL << 20) * 16)) {
- EVPerr(EVP_F_AES_XTS_CIPHER, EVP_R_TOO_LARGE);
- return 0;
- }
-#endif
if (xctx->stream)
(*xctx->stream)(in, out, len, xctx->xts.key1, xctx->xts.key2,
ctx->iv);
EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS)
#endif
-#endif
#include <openssl/des.h>
#include <openssl/rand.h>
-#ifndef OPENSSL_FIPS
static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc);
return &des_ede3_ecb;
}
#endif
-#endif