Camellia low level API algorithm blocking.
authorDr. Stephen Henson <steve@openssl.org>
Sun, 21 Sep 2008 11:21:43 +0000 (11:21 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 21 Sep 2008 11:21:43 +0000 (11:21 +0000)
crypto/camellia/camellia.h
crypto/camellia/cmll_misc.c
crypto/evp/evp_locl.h

index 3c8a35954342dff4040ff9a31dafd7f52c9edf57..b8a8b6e10b9e094d72d1be88fa622d8f8587d84f 100644 (file)
@@ -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);
 
index f1047b54e03b427981156f338eb40700c48bd9c4..c5d698169d41563e8022e87213815a46dd97e2bf 100644 (file)
 #include <openssl/opensslv.h>
 #include <openssl/camellia.h>
 #include "cmll_locl.h"
+#include <openssl/crypto.h>
+#ifdef OPENSSL_FIPS
+#include <openssl/fips.h>
+#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)
                {
index a59c4c1a612396ed62cb66e00379c67313e31319..767002aa7a72a6a925bf2fbc94579df7f00b093a 100644 (file)
@@ -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