From 138f20433e6e9d71140ad7db6813592ebb8f34d5 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sun, 21 Sep 2008 11:21:43 +0000 Subject: [PATCH] Camellia low level API algorithm blocking. --- crypto/camellia/camellia.h | 5 +++++ crypto/camellia/cmll_misc.c | 13 +++++++++++++ crypto/evp/evp_locl.h | 1 + 3 files changed, 19 insertions(+) diff --git a/crypto/camellia/camellia.h b/crypto/camellia/camellia.h index 3c8a359543..b8a8b6e10b 100644 --- a/crypto/camellia/camellia.h +++ b/crypto/camellia/camellia.h @@ -87,6 +87,11 @@ struct camellia_key_st typedef struct camellia_key_st CAMELLIA_KEY; +#ifdef OPENSSL_FIPS +int private_Camellia_set_key(const unsigned char *userKey, const int bits, + CAMELLIA_KEY *key); +#endif + int Camellia_set_key(const unsigned char *userKey, const int bits, CAMELLIA_KEY *key); diff --git a/crypto/camellia/cmll_misc.c b/crypto/camellia/cmll_misc.c index f1047b54e0..c5d698169d 100644 --- a/crypto/camellia/cmll_misc.c +++ b/crypto/camellia/cmll_misc.c @@ -52,11 +52,24 @@ #include #include #include "cmll_locl.h" +#include +#ifdef OPENSSL_FIPS +#include +#endif const char CAMELLIA_version[]="CAMELLIA" OPENSSL_VERSION_PTEXT; int Camellia_set_key(const unsigned char *userKey, const int bits, CAMELLIA_KEY *key) +#ifdef OPENSSL_FIPS + { + if (FIPS_mode()) + FIPS_BAD_ABORT(CAMELLIA) + private_Camellia_set_key(userKey, bits, key); + } +int private_Camellia_set_key(const unsigned char *userKey, const int bits, + CAMELLIA_KEY *key) +#endif { if (!userKey || !key) { diff --git a/crypto/evp/evp_locl.h b/crypto/evp/evp_locl.h index a59c4c1a61..767002aa7a 100644 --- a/crypto/evp/evp_locl.h +++ b/crypto/evp/evp_locl.h @@ -239,6 +239,7 @@ const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; } #define CAST_set_key private_CAST_set_key #define RC5_32_set_key private_RC5_32_set_key #define BF_set_key private_BF_set_key +#define Camellia_set_key private_Camellia_set_key #define idea_set_encrypt_key private_idea_set_encrypt_key #define MD5_Init private_MD5_Init -- 2.25.1