Define FIPS_*_SIZE_T for AES, DSA and RSA as well, in preparation for
authorRichard Levitte <levitte@openssl.org>
Wed, 19 May 2004 14:16:33 +0000 (14:16 +0000)
committerRichard Levitte <levitte@openssl.org>
Wed, 19 May 2004 14:16:33 +0000 (14:16 +0000)
size_t-ification of those algorithms in future version of OpenSSL...

crypto/aes/aes.h
crypto/dsa/dsa.h
crypto/rsa/rsa.h
fips/aes/fingerprint.sha1
fips/aes/fips_aes_core.c
fips/dsa/fingerprint.sha1
fips/dsa/fips_dsa_gen.c
fips/dsa/fips_dsa_ossl.c
fips/rsa/fingerprint.sha1
fips/rsa/fips_rsa_eay.c
fips/rsa/fips_rsa_gen.c

index 5e177a3dd8f8f427b2bd361baeb628de4c71675c..8a3ea0b88366b57209cfb5a974362d21a32e9a41 100644 (file)
@@ -52,6 +52,8 @@
 #ifndef HEADER_AES_H
 #define HEADER_AES_H
 
+#include <openssl/e_os2.h>
+
 #ifdef OPENSSL_NO_AES
 #error AES is disabled.
 #endif
 #define AES_MAXNR 14
 #define AES_BLOCK_SIZE 16
 
+#if defined(OPENSSL_FIPS)
+#define FIPS_AES_SIZE_T        int
+#endif
+
 #ifdef  __cplusplus
 extern "C" {
 #endif
index 9b3baadf2c49c95213dfe0cad1b4a25f9e5f0ccb..225ff391f9be59f87a325fe6f1f8eae8aa34ddbc 100644 (file)
 
 #define DSA_FLAG_CACHE_MONT_P  0x01
 
+#if defined(OPENSSL_FIPS)
+#define FIPS_DSA_SIZE_T        int
+#endif
+
 #ifdef  __cplusplus
 extern "C" {
 #endif
index 62fa745f79e37ba5a5ea7559728f40f5f6fb0f2e..fc3bb5f86de25c2864395b2865083ed65611dd2f 100644 (file)
 #error RSA is disabled.
 #endif
 
+#if defined(OPENSSL_FIPS)
+#define FIPS_RSA_SIZE_T        int
+#endif
+
 #ifdef  __cplusplus
 extern "C" {
 #endif
index 295b552cb128467872715e0e9ee4796719c84698..121def333c30a686d1c6fbc4b7ff7c337b794161 100644 (file)
@@ -1,3 +1,3 @@
-HMAC-SHA1(fips_aes_core.c)= 979e9a3084dc8e15d9f222bf721e6faccf6bcd18
+HMAC-SHA1(fips_aes_core.c)= e3b9b4ddceaca72392f59ee05164d9e6a81521a7
 HMAC-SHA1(fips_aes_selftest.c)= 98b01502221e7fe529fd981222f2cbb52eb4cbe0
 HMAC-SHA1(fips_aes_locl.h)= ded58f0cda8cb967dc5f5f3a860601c0b8744623
index 371a7f9e498a1218fd3a680380e227d9e2d9a6ca..49169e7a4ed9f0122895264fc713cbedb0aaa422 100644 (file)
@@ -727,11 +727,11 @@ static const u32 rcon[] = {
 /**
  * Expand the cipher key into the encryption key schedule.
  */
-int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
-                       AES_KEY *key) {
+int AES_set_encrypt_key(const unsigned char *userKey,
+                       const FIPS_AES_SIZE_T bits, AES_KEY *key) {
 
        u32 *rk;
-       int i = 0;
+       int i = 0;
        u32 temp;
 
        if (!userKey || !key)
@@ -830,8 +830,8 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 /**
  * Expand the cipher key into the decryption key schedule.
  */
-int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
-                        AES_KEY *key) {
+int AES_set_decrypt_key(const unsigned char *userKey,
+       const FIPS_AES_SIZE_T bits, AES_KEY *key) {
 
         u32 *rk;
        int i, j, status;
index e81fe003d76ee7cdd9653f64eb9592d8182f5ea6..444eb690470c0042a7827b3f2690e9ddc8daea23 100644 (file)
@@ -1,3 +1,3 @@
-HMAC-SHA1(fips_dsa_ossl.c)= 1295b5241620e1d5449aaeeb7084b181fc197003
-HMAC-SHA1(fips_dsa_gen.c)= e347a0c5b19cdcde37c73f6abcdc52c794d5dd4e
+HMAC-SHA1(fips_dsa_ossl.c)= b817acc77487f42298205cc5fdd2593e30c66a9d
+HMAC-SHA1(fips_dsa_gen.c)= 6276272125759148b60f2500fa40beea84648a21
 HMAC-SHA1(fips_dsa_selftest.c)= 4bfc5d3a6b977527b053f3a03d0760a822a26135
index 9524a4e21b574a0746a91f01cc319f3d066b4471..6fa63f61cdbb7b7b020abe75c51fe1b65de50e57 100644 (file)
@@ -103,8 +103,8 @@ static int fips_check_dsa(DSA *dsa)
     return 1;
     }
 
-DSA *DSA_generate_parameters(int bits,
-               unsigned char *seed_in, int seed_len,
+DSA *DSA_generate_parameters(FIPS_DSA_SIZE_T bits,
+               unsigned char *seed_in, FIPS_DSA_SIZE_T seed_len,
                int *counter_ret, unsigned long *h_ret,
                void (*callback)(int, int, void *),
                void *cb_arg)
index b47e59c737e4df06659d5290a34e8351946a5f1b..a39286101bdae974b6511766c2161094b3608ec0 100644 (file)
@@ -70,9 +70,9 @@
 
 #ifdef OPENSSL_FIPS
 
-static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
+static DSA_SIG *dsa_do_sign(const unsigned char *dgst, FIPS_DSA_SIZE_T dlen, DSA *dsa);
 static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
-static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
+static int dsa_do_verify(const unsigned char *dgst, FIPS_DSA_SIZE_T dgst_len, DSA_SIG *sig,
                  DSA *dsa);
 static int dsa_init(DSA *dsa);
 static int dsa_finish(DSA *dsa);
@@ -116,7 +116,7 @@ const DSA_METHOD *DSA_OpenSSL(void)
        return &openssl_dsa_meth;
 }
 
-static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
+static DSA_SIG *dsa_do_sign(const unsigned char *dgst, FIPS_DSA_SIZE_T dlen, DSA *dsa)
        {
        BIGNUM *kinv=NULL,*r=NULL,*s=NULL;
        BIGNUM m;
@@ -257,7 +257,7 @@ err:
        return(ret);
        }
 
-static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
+static int dsa_do_verify(const unsigned char *dgst, FIPS_DSA_SIZE_T dgst_len, DSA_SIG *sig,
                  DSA *dsa)
        {
        BN_CTX *ctx;
index 727c71930aba5ab18243115a922626d290964eb9..d4dcbdcb8b5b7237a24e5db4a5097059d3e84fbf 100644 (file)
@@ -1,3 +1,3 @@
-HMAC-SHA1(fips_rsa_eay.c)= 3808fed15de958768052db96ff710699ca9afd92
-HMAC-SHA1(fips_rsa_gen.c)= 0f7eec6b217844f638902ff82fe41e2201ade1d5
+HMAC-SHA1(fips_rsa_eay.c)= 660512794d0a702fc2bf17ae094e9e3181bf9152
+HMAC-SHA1(fips_rsa_gen.c)= 6bcf339dda5bb7d7e162c30d579431848a5e921f
 HMAC-SHA1(fips_rsa_selftest.c)= af5b9c9a0237b2219f375849a5b2311d786e711b
index dafc7f14729c652d68387406376999d72e3f7c2a..e4b11d9956088ce3a65bf08bfc35ab24d2db74a1 100644 (file)
 
 #if !defined(RSA_NULL) && defined(OPENSSL_FIPS)
 
-static int RSA_eay_public_encrypt(int flen, const unsigned char *from,
+static int RSA_eay_public_encrypt(FIPS_RSA_SIZE_T flen, const unsigned char *from,
                unsigned char *to, RSA *rsa,int padding);
-static int RSA_eay_private_encrypt(int flen, const unsigned char *from,
+static int RSA_eay_private_encrypt(FIPS_RSA_SIZE_T flen, const unsigned char *from,
                unsigned char *to, RSA *rsa,int padding);
-static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
+static int RSA_eay_public_decrypt(FIPS_RSA_SIZE_T flen, const unsigned char *from,
                unsigned char *to, RSA *rsa,int padding);
-static int RSA_eay_private_decrypt(int flen, const unsigned char *from,
+static int RSA_eay_private_decrypt(FIPS_RSA_SIZE_T flen, const unsigned char *from,
                unsigned char *to, RSA *rsa,int padding);
 static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa);
 static int RSA_eay_init(RSA *rsa);
@@ -97,7 +97,7 @@ const RSA_METHOD *RSA_PKCS1_SSLeay(void)
        return(&rsa_pkcs1_eay_meth);
        }
 
-static int RSA_eay_public_encrypt(int flen, const unsigned char *from,
+static int RSA_eay_public_encrypt(FIPS_RSA_SIZE_T flen, const unsigned char *from,
             unsigned char *to, RSA *rsa, int padding)
        {
        BIGNUM f,ret;
@@ -254,7 +254,7 @@ err:
        }
 
 /* signing */
-static int RSA_eay_private_encrypt(int flen, const unsigned char *from,
+static int RSA_eay_private_encrypt(FIPS_RSA_SIZE_T flen, const unsigned char *from,
             unsigned char *to, RSA *rsa, int padding)
        {
        BIGNUM f,ret;
@@ -370,7 +370,7 @@ err:
        return(r);
        }
 
-static int RSA_eay_private_decrypt(int flen, const unsigned char *from,
+static int RSA_eay_private_decrypt(FIPS_RSA_SIZE_T flen, const unsigned char *from,
             unsigned char *to, RSA *rsa, int padding)
        {
        BIGNUM f,ret;
@@ -503,7 +503,7 @@ err:
        }
 
 /* signature verification */
-static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
+static int RSA_eay_public_decrypt(FIPS_RSA_SIZE_T flen, const unsigned char *from,
             unsigned char *to, RSA *rsa, int padding)
        {
        BIGNUM f,ret;
index e191baa926ab6833954d630b228602bdd2f288d5..cb671678b70e0eb0149ba460dbfbd0f6fc65792e 100644 (file)
@@ -104,7 +104,7 @@ static int fips_check_rsa(RSA *rsa)
     return 1;
     }
 
-RSA *RSA_generate_key(int bits, unsigned long e_value,
+RSA *RSA_generate_key(FIPS_RSA_SIZE_T bits, unsigned long e_value,
             void (*callback)(int,int,void *), void *cb_arg)
        {
        RSA *rsa=NULL;