summaryrefslogtreecommitdiffstats
path: root/crypto/camellia
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-06-05 17:36:44 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-06-05 17:36:44 +0000
commitc6fa97a6d6fffb057b3b96e7c0b75711dfd3bbc8 (patch)
treeba309f05634d09ca5e76487e63bab7404c6ab412 /crypto/camellia
parent24d7159abd5e8a3fb5a75167e01b24230fb0874b (diff)
FIPS low level blocking for AES, RC4 and Camellia. This is complicated by
use of assembly language routines: rename the assembly language function to the private_* variant unconditionally and perform tests from a small C wrapper.
Diffstat (limited to 'crypto/camellia')
-rw-r--r--crypto/camellia/camellia.h4
-rw-r--r--crypto/camellia/cmll_misc.c9
2 files changed, 13 insertions, 0 deletions
diff --git a/crypto/camellia/camellia.h b/crypto/camellia/camellia.h
index cf0457dd97..67911e0adf 100644
--- a/crypto/camellia/camellia.h
+++ b/crypto/camellia/camellia.h
@@ -88,6 +88,10 @@ 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 f44689124b..664583ff5d 100644
--- a/crypto/camellia/cmll_misc.c
+++ b/crypto/camellia/cmll_misc.c
@@ -50,6 +50,7 @@
*/
#include <openssl/opensslv.h>
+#include <openssl/crypto.h>
#include <openssl/camellia.h>
#include "cmll_locl.h"
@@ -57,6 +58,14 @@ 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
+ {
+ fips_cipher_abort(Camellia);
+ return 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)
return -1;