Define FIPS_*_SIZE_T for AES, DSA and RSA as well, in preparation for
size_t-ification of those algorithms in future version of OpenSSL...
This commit is contained in:
parent
1f4eccaaa5
commit
5affe206e1
@ -52,6 +52,8 @@
|
|||||||
#ifndef HEADER_AES_H
|
#ifndef HEADER_AES_H
|
||||||
#define HEADER_AES_H
|
#define HEADER_AES_H
|
||||||
|
|
||||||
|
#include <openssl/e_os2.h>
|
||||||
|
|
||||||
#ifdef OPENSSL_NO_AES
|
#ifdef OPENSSL_NO_AES
|
||||||
#error AES is disabled.
|
#error AES is disabled.
|
||||||
#endif
|
#endif
|
||||||
@ -64,6 +66,10 @@
|
|||||||
#define AES_MAXNR 14
|
#define AES_MAXNR 14
|
||||||
#define AES_BLOCK_SIZE 16
|
#define AES_BLOCK_SIZE 16
|
||||||
|
|
||||||
|
#if defined(OPENSSL_FIPS)
|
||||||
|
#define FIPS_AES_SIZE_T int
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -81,6 +81,10 @@
|
|||||||
|
|
||||||
#define DSA_FLAG_CACHE_MONT_P 0x01
|
#define DSA_FLAG_CACHE_MONT_P 0x01
|
||||||
|
|
||||||
|
#if defined(OPENSSL_FIPS)
|
||||||
|
#define FIPS_DSA_SIZE_T int
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -72,6 +72,10 @@
|
|||||||
#error RSA is disabled.
|
#error RSA is disabled.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(OPENSSL_FIPS)
|
||||||
|
#define FIPS_RSA_SIZE_T int
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -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_selftest.c)= 98b01502221e7fe529fd981222f2cbb52eb4cbe0
|
||||||
HMAC-SHA1(fips_aes_locl.h)= ded58f0cda8cb967dc5f5f3a860601c0b8744623
|
HMAC-SHA1(fips_aes_locl.h)= ded58f0cda8cb967dc5f5f3a860601c0b8744623
|
||||||
|
@ -727,11 +727,11 @@ static const u32 rcon[] = {
|
|||||||
/**
|
/**
|
||||||
* Expand the cipher key into the encryption key schedule.
|
* Expand the cipher key into the encryption key schedule.
|
||||||
*/
|
*/
|
||||||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
int AES_set_encrypt_key(const unsigned char *userKey,
|
||||||
AES_KEY *key) {
|
const FIPS_AES_SIZE_T bits, AES_KEY *key) {
|
||||||
|
|
||||||
u32 *rk;
|
u32 *rk;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
u32 temp;
|
u32 temp;
|
||||||
|
|
||||||
if (!userKey || !key)
|
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.
|
* Expand the cipher key into the decryption key schedule.
|
||||||
*/
|
*/
|
||||||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
int AES_set_decrypt_key(const unsigned char *userKey,
|
||||||
AES_KEY *key) {
|
const FIPS_AES_SIZE_T bits, AES_KEY *key) {
|
||||||
|
|
||||||
u32 *rk;
|
u32 *rk;
|
||||||
int i, j, status;
|
int i, j, status;
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
HMAC-SHA1(fips_dsa_ossl.c)= 1295b5241620e1d5449aaeeb7084b181fc197003
|
HMAC-SHA1(fips_dsa_ossl.c)= b817acc77487f42298205cc5fdd2593e30c66a9d
|
||||||
HMAC-SHA1(fips_dsa_gen.c)= e347a0c5b19cdcde37c73f6abcdc52c794d5dd4e
|
HMAC-SHA1(fips_dsa_gen.c)= 6276272125759148b60f2500fa40beea84648a21
|
||||||
HMAC-SHA1(fips_dsa_selftest.c)= 4bfc5d3a6b977527b053f3a03d0760a822a26135
|
HMAC-SHA1(fips_dsa_selftest.c)= 4bfc5d3a6b977527b053f3a03d0760a822a26135
|
||||||
|
@ -103,8 +103,8 @@ static int fips_check_dsa(DSA *dsa)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DSA *DSA_generate_parameters(int bits,
|
DSA *DSA_generate_parameters(FIPS_DSA_SIZE_T bits,
|
||||||
unsigned char *seed_in, int seed_len,
|
unsigned char *seed_in, FIPS_DSA_SIZE_T seed_len,
|
||||||
int *counter_ret, unsigned long *h_ret,
|
int *counter_ret, unsigned long *h_ret,
|
||||||
void (*callback)(int, int, void *),
|
void (*callback)(int, int, void *),
|
||||||
void *cb_arg)
|
void *cb_arg)
|
||||||
|
@ -70,9 +70,9 @@
|
|||||||
|
|
||||||
#ifdef OPENSSL_FIPS
|
#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_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);
|
DSA *dsa);
|
||||||
static int dsa_init(DSA *dsa);
|
static int dsa_init(DSA *dsa);
|
||||||
static int dsa_finish(DSA *dsa);
|
static int dsa_finish(DSA *dsa);
|
||||||
@ -116,7 +116,7 @@ const DSA_METHOD *DSA_OpenSSL(void)
|
|||||||
return &openssl_dsa_meth;
|
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 *kinv=NULL,*r=NULL,*s=NULL;
|
||||||
BIGNUM m;
|
BIGNUM m;
|
||||||
@ -257,7 +257,7 @@ err:
|
|||||||
return(ret);
|
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)
|
DSA *dsa)
|
||||||
{
|
{
|
||||||
BN_CTX *ctx;
|
BN_CTX *ctx;
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
HMAC-SHA1(fips_rsa_eay.c)= 3808fed15de958768052db96ff710699ca9afd92
|
HMAC-SHA1(fips_rsa_eay.c)= 660512794d0a702fc2bf17ae094e9e3181bf9152
|
||||||
HMAC-SHA1(fips_rsa_gen.c)= 0f7eec6b217844f638902ff82fe41e2201ade1d5
|
HMAC-SHA1(fips_rsa_gen.c)= 6bcf339dda5bb7d7e162c30d579431848a5e921f
|
||||||
HMAC-SHA1(fips_rsa_selftest.c)= af5b9c9a0237b2219f375849a5b2311d786e711b
|
HMAC-SHA1(fips_rsa_selftest.c)= af5b9c9a0237b2219f375849a5b2311d786e711b
|
||||||
|
@ -65,13 +65,13 @@
|
|||||||
|
|
||||||
#if !defined(RSA_NULL) && defined(OPENSSL_FIPS)
|
#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);
|
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);
|
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);
|
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);
|
unsigned char *to, RSA *rsa,int padding);
|
||||||
static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa);
|
static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa);
|
||||||
static int RSA_eay_init(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);
|
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)
|
unsigned char *to, RSA *rsa, int padding)
|
||||||
{
|
{
|
||||||
BIGNUM f,ret;
|
BIGNUM f,ret;
|
||||||
@ -254,7 +254,7 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* signing */
|
/* 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)
|
unsigned char *to, RSA *rsa, int padding)
|
||||||
{
|
{
|
||||||
BIGNUM f,ret;
|
BIGNUM f,ret;
|
||||||
@ -370,7 +370,7 @@ err:
|
|||||||
return(r);
|
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)
|
unsigned char *to, RSA *rsa, int padding)
|
||||||
{
|
{
|
||||||
BIGNUM f,ret;
|
BIGNUM f,ret;
|
||||||
@ -503,7 +503,7 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* signature verification */
|
/* 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)
|
unsigned char *to, RSA *rsa, int padding)
|
||||||
{
|
{
|
||||||
BIGNUM f,ret;
|
BIGNUM f,ret;
|
||||||
|
@ -104,7 +104,7 @@ static int fips_check_rsa(RSA *rsa)
|
|||||||
return 1;
|
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)
|
void (*callback)(int,int,void *), void *cb_arg)
|
||||||
{
|
{
|
||||||
RSA *rsa=NULL;
|
RSA *rsa=NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user