mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 17:59:04 +00:00
Upgrading shipped OpenSSL for Windows to 0.9.8j
This commit is contained in:
@@ -8,6 +8,9 @@ o The conditions for printing OS fingerprints to XML output are now
|
||||
|
||||
o Fix Ncat compilation with the MingW windows compiler. [Gisle Vanem]
|
||||
|
||||
o Upgraded the OpenSSL binaries shipped in our Windows installer to
|
||||
version 0.9.8j. [Kris]
|
||||
|
||||
o Updated IANA assignment IP list for random IP (-iR)
|
||||
generation. [Kris]
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -66,6 +66,10 @@
|
||||
#define AES_MAXNR 14
|
||||
#define AES_BLOCK_SIZE 16
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define FIPS_AES_SIZE_T int
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* asn1t.h */
|
||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||
* project 2000.
|
||||
*/
|
||||
/* ====================================================================
|
||||
|
||||
@@ -104,7 +104,9 @@ typedef struct bf_key_st
|
||||
BF_LONG S[4*256];
|
||||
} BF_KEY;
|
||||
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);
|
||||
#endif
|
||||
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
|
||||
|
||||
void BF_encrypt(BF_LONG *data,const BF_KEY *key);
|
||||
|
||||
@@ -408,8 +408,8 @@ BIGNUM *BN_CTX_get(BN_CTX *ctx);
|
||||
void BN_CTX_end(BN_CTX *ctx);
|
||||
int BN_rand(BIGNUM *rnd, int bits, int top,int bottom);
|
||||
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom);
|
||||
int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
|
||||
int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
|
||||
int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
int BN_num_bits(const BIGNUM *a);
|
||||
int BN_num_bits_word(BN_ULONG);
|
||||
BIGNUM *BN_new(void);
|
||||
@@ -531,6 +531,17 @@ int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb);
|
||||
int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx,
|
||||
int do_trial_division, BN_GENCB *cb);
|
||||
|
||||
int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
|
||||
|
||||
int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
|
||||
const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb);
|
||||
int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
BIGNUM *Xp1, BIGNUM *Xp2,
|
||||
const BIGNUM *Xp,
|
||||
const BIGNUM *e, BN_CTX *ctx,
|
||||
BN_GENCB *cb);
|
||||
|
||||
BN_MONT_CTX *BN_MONT_CTX_new(void );
|
||||
void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
|
||||
int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,
|
||||
|
||||
@@ -83,7 +83,9 @@ typedef struct cast_key_st
|
||||
int short_key; /* Use reduced rounds for short key */
|
||||
} CAST_KEY;
|
||||
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
|
||||
#endif
|
||||
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
|
||||
void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key,
|
||||
int enc);
|
||||
|
||||
@@ -219,7 +219,13 @@ typedef struct openssl_item_st
|
||||
#define CRYPTO_LOCK_EC_PRE_COMP 36
|
||||
#define CRYPTO_LOCK_STORE 37
|
||||
#define CRYPTO_LOCK_COMP 38
|
||||
#ifndef OPENSSL_FIPS
|
||||
#define CRYPTO_NUM_LOCKS 39
|
||||
#else
|
||||
#define CRYPTO_LOCK_FIPS 39
|
||||
#define CRYPTO_LOCK_FIPS2 40
|
||||
#define CRYPTO_NUM_LOCKS 41
|
||||
#endif
|
||||
|
||||
#define CRYPTO_LOCK 1
|
||||
#define CRYPTO_UNLOCK 2
|
||||
@@ -341,14 +347,7 @@ DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
|
||||
|
||||
/* Set standard debugging functions (not done by default
|
||||
* unless CRYPTO_MDEBUG is defined) */
|
||||
#define CRYPTO_malloc_debug_init() do {\
|
||||
CRYPTO_set_mem_debug_functions(\
|
||||
CRYPTO_dbg_malloc,\
|
||||
CRYPTO_dbg_realloc,\
|
||||
CRYPTO_dbg_free,\
|
||||
CRYPTO_dbg_set_options,\
|
||||
CRYPTO_dbg_get_options);\
|
||||
} while(0)
|
||||
void CRYPTO_malloc_debug_init(void);
|
||||
|
||||
int CRYPTO_mem_ctrl(int mode);
|
||||
int CRYPTO_is_mem_check_on(void);
|
||||
@@ -363,6 +362,7 @@ int CRYPTO_is_mem_check_on(void);
|
||||
#define is_MemCheck_on() CRYPTO_is_mem_check_on()
|
||||
|
||||
#define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__)
|
||||
#define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__)
|
||||
#define OPENSSL_realloc(addr,num) \
|
||||
CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
|
||||
#define OPENSSL_realloc_clean(addr,old_num,num) \
|
||||
@@ -427,6 +427,9 @@ const char *CRYPTO_get_lock_name(int type);
|
||||
int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file,
|
||||
int line);
|
||||
|
||||
void int_CRYPTO_set_do_dynlock_callback(
|
||||
void (*do_dynlock_cb)(int mode, int type, const char *file, int line));
|
||||
|
||||
int CRYPTO_get_new_dynlockid(void);
|
||||
void CRYPTO_destroy_dynlockid(int i);
|
||||
struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i);
|
||||
@@ -451,6 +454,10 @@ int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int),
|
||||
void (*f)(void *,int),
|
||||
void (*so)(long),
|
||||
long (*go)(void));
|
||||
void CRYPTO_set_mem_info_functions(
|
||||
int (*push_info_fn)(const char *info, const char *file, int line),
|
||||
int (*pop_info_fn)(void),
|
||||
int (*remove_all_info_fn)(void));
|
||||
void CRYPTO_get_mem_functions(void *(**m)(size_t),void *(**r)(void *, size_t), void (**f)(void *));
|
||||
void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *));
|
||||
void CRYPTO_get_mem_ex_functions(void *(**m)(size_t,const char *,int),
|
||||
@@ -467,6 +474,7 @@ void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int),
|
||||
void *CRYPTO_malloc_locked(int num, const char *file, int line);
|
||||
void CRYPTO_free_locked(void *);
|
||||
void *CRYPTO_malloc(int num, const char *file, int line);
|
||||
char *CRYPTO_strdup(const char *str, const char *file, int line);
|
||||
void CRYPTO_free(void *);
|
||||
void *CRYPTO_realloc(void *addr,int num, const char *file, int line);
|
||||
void *CRYPTO_realloc_clean(void *addr,int old_num,int num,const char *file,
|
||||
@@ -506,6 +514,9 @@ void CRYPTO_dbg_free(void *addr,int before_p);
|
||||
void CRYPTO_dbg_set_options(long bits);
|
||||
long CRYPTO_dbg_get_options(void);
|
||||
|
||||
int CRYPTO_dbg_push_info(const char *info, const char *file, int line);
|
||||
int CRYPTO_dbg_pop_info(void);
|
||||
int CRYPTO_dbg_remove_all_info(void);
|
||||
|
||||
#ifndef OPENSSL_NO_FP_API
|
||||
void CRYPTO_mem_leaks_fp(FILE *);
|
||||
@@ -523,12 +534,69 @@ unsigned long *OPENSSL_ia32cap_loc(void);
|
||||
#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
|
||||
int OPENSSL_isservice(void);
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define FIPS_ERROR_IGNORED(alg) OpenSSLDie(__FILE__, __LINE__, \
|
||||
alg " previous FIPS forbidden algorithm error ignored");
|
||||
|
||||
#define FIPS_BAD_ABORT(alg) OpenSSLDie(__FILE__, __LINE__, \
|
||||
#alg " Algorithm forbidden in FIPS mode");
|
||||
|
||||
#ifdef OPENSSL_FIPS_STRICT
|
||||
#define FIPS_BAD_ALGORITHM(alg) FIPS_BAD_ABORT(alg)
|
||||
#else
|
||||
#define FIPS_BAD_ALGORITHM(alg) \
|
||||
{ \
|
||||
FIPSerr(FIPS_F_HASH_FINAL,FIPS_R_NON_FIPS_METHOD); \
|
||||
ERR_add_error_data(2, "Algorithm=", #alg); \
|
||||
return 0; \
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Low level digest API blocking macro */
|
||||
|
||||
#define FIPS_NON_FIPS_MD_Init(alg) \
|
||||
int alg##_Init(alg##_CTX *c) \
|
||||
{ \
|
||||
if (FIPS_mode()) \
|
||||
FIPS_BAD_ALGORITHM(alg) \
|
||||
return private_##alg##_Init(c); \
|
||||
} \
|
||||
int private_##alg##_Init(alg##_CTX *c)
|
||||
|
||||
/* For ciphers the API often varies from cipher to cipher and each needs to
|
||||
* be treated as a special case. Variable key length ciphers (Blowfish, RC4,
|
||||
* CAST) however are very similar and can use a blocking macro.
|
||||
*/
|
||||
|
||||
#define FIPS_NON_FIPS_VCIPHER_Init(alg) \
|
||||
void alg##_set_key(alg##_KEY *key, int len, const unsigned char *data) \
|
||||
{ \
|
||||
if (FIPS_mode()) \
|
||||
FIPS_BAD_ABORT(alg) \
|
||||
private_##alg##_set_key(key, len, data); \
|
||||
} \
|
||||
void private_##alg##_set_key(alg##_KEY *key, int len, \
|
||||
const unsigned char *data)
|
||||
|
||||
#else
|
||||
|
||||
#define FIPS_NON_FIPS_VCIPHER_Init(alg) \
|
||||
void alg##_set_key(alg##_KEY *key, int len, const unsigned char *data)
|
||||
|
||||
#define FIPS_NON_FIPS_MD_Init(alg) \
|
||||
int alg##_Init(alg##_CTX *c)
|
||||
|
||||
#endif /* def OPENSSL_FIPS */
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_CRYPTO_strings(void);
|
||||
|
||||
#define OPENSSL_HAVE_INIT 1
|
||||
void OPENSSL_init(void);
|
||||
|
||||
/* Error codes for the CRYPTO functions. */
|
||||
|
||||
/* Function codes. */
|
||||
|
||||
@@ -77,6 +77,8 @@
|
||||
# define OPENSSL_DH_MAX_MODULUS_BITS 10000
|
||||
#endif
|
||||
|
||||
#define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024
|
||||
|
||||
#define DH_FLAG_CACHE_MONT_P 0x01
|
||||
#define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH
|
||||
* implementation now uses constant time
|
||||
@@ -167,6 +169,11 @@ struct dh_st
|
||||
|
||||
const DH_METHOD *DH_OpenSSL(void);
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
DH * FIPS_dh_new(void);
|
||||
void FIPS_dh_free(DH *dh);
|
||||
#endif
|
||||
|
||||
void DH_set_default_method(const DH_METHOD *meth);
|
||||
const DH_METHOD *DH_get_default_method(void);
|
||||
int DH_set_method(DH *dh, const DH_METHOD *meth);
|
||||
@@ -218,6 +225,9 @@ void ERR_load_DH_strings(void);
|
||||
#define DH_F_DHPARAMS_PRINT 100
|
||||
#define DH_F_DHPARAMS_PRINT_FP 101
|
||||
#define DH_F_DH_BUILTIN_GENPARAMS 106
|
||||
#define DH_F_DH_COMPUTE_KEY 107
|
||||
#define DH_F_DH_GENERATE_KEY 108
|
||||
#define DH_F_DH_GENERATE_PARAMETERS 109
|
||||
#define DH_F_DH_NEW_METHOD 105
|
||||
#define DH_F_GENERATE_KEY 103
|
||||
#define DH_F_GENERATE_PARAMETERS 104
|
||||
@@ -225,6 +235,7 @@ void ERR_load_DH_strings(void);
|
||||
/* Reason codes. */
|
||||
#define DH_R_BAD_GENERATOR 101
|
||||
#define DH_R_INVALID_PUBKEY 102
|
||||
#define DH_R_KEY_SIZE_TOO_SMALL 104
|
||||
#define DH_R_MODULUS_TOO_LARGE 103
|
||||
#define DH_R_NO_PRIVATE_VALUE 100
|
||||
|
||||
|
||||
@@ -88,6 +88,8 @@
|
||||
# define OPENSSL_DSA_MAX_MODULUS_BITS 10000
|
||||
#endif
|
||||
|
||||
#define OPENSSL_DSA_FIPS_MIN_MODULUS_BITS 1024
|
||||
|
||||
#define DSA_FLAG_CACHE_MONT_P 0x01
|
||||
#define DSA_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DSA
|
||||
* implementation now uses constant time
|
||||
@@ -97,6 +99,25 @@
|
||||
* be used for all exponents.
|
||||
*/
|
||||
|
||||
/* If this flag is set the DSA method is FIPS compliant and can be used
|
||||
* in FIPS mode. This is set in the validated module method. If an
|
||||
* application sets this flag in its own methods it is its reposibility
|
||||
* to ensure the result is compliant.
|
||||
*/
|
||||
|
||||
#define DSA_FLAG_FIPS_METHOD 0x0400
|
||||
|
||||
/* If this flag is set the operations normally disabled in FIPS mode are
|
||||
* permitted it is then the applications responsibility to ensure that the
|
||||
* usage is compliant.
|
||||
*/
|
||||
|
||||
#define DSA_FLAG_NON_FIPS_ALLOW 0x0400
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define FIPS_DSA_SIZE_T int
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -189,6 +210,11 @@ void DSA_set_default_method(const DSA_METHOD *);
|
||||
const DSA_METHOD *DSA_get_default_method(void);
|
||||
int DSA_set_method(DSA *dsa, const DSA_METHOD *);
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
DSA * FIPS_dsa_new(void);
|
||||
void FIPS_dsa_free (DSA *r);
|
||||
#endif
|
||||
|
||||
DSA * DSA_new(void);
|
||||
DSA * DSA_new_method(ENGINE *engine);
|
||||
void DSA_free (DSA *r);
|
||||
@@ -249,6 +275,11 @@ int DSA_print_fp(FILE *bp, const DSA *x, int off);
|
||||
DH *DSA_dup_DH(const DSA *r);
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int FIPS_dsa_sig_encode(unsigned char *out, DSA_SIG *sig);
|
||||
int FIPS_dsa_sig_decode(DSA_SIG *sig, const unsigned char *in, int inlen);
|
||||
#endif
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
@@ -261,11 +292,16 @@ void ERR_load_DSA_strings(void);
|
||||
#define DSA_F_D2I_DSA_SIG 110
|
||||
#define DSA_F_DSAPARAMS_PRINT 100
|
||||
#define DSA_F_DSAPARAMS_PRINT_FP 101
|
||||
#define DSA_F_DSA_BUILTIN_KEYGEN 119
|
||||
#define DSA_F_DSA_BUILTIN_PARAMGEN 118
|
||||
#define DSA_F_DSA_DO_SIGN 112
|
||||
#define DSA_F_DSA_DO_VERIFY 113
|
||||
#define DSA_F_DSA_GENERATE_PARAMETERS 117
|
||||
#define DSA_F_DSA_NEW_METHOD 103
|
||||
#define DSA_F_DSA_PRINT 104
|
||||
#define DSA_F_DSA_PRINT_FP 105
|
||||
#define DSA_F_DSA_SET_DEFAULT_METHOD 115
|
||||
#define DSA_F_DSA_SET_METHOD 116
|
||||
#define DSA_F_DSA_SIGN 106
|
||||
#define DSA_F_DSA_SIGN_SETUP 107
|
||||
#define DSA_F_DSA_SIG_NEW 109
|
||||
@@ -276,8 +312,11 @@ void ERR_load_DSA_strings(void);
|
||||
/* Reason codes. */
|
||||
#define DSA_R_BAD_Q_VALUE 102
|
||||
#define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100
|
||||
#define DSA_R_KEY_SIZE_TOO_SMALL 106
|
||||
#define DSA_R_MISSING_PARAMETERS 101
|
||||
#define DSA_R_MODULUS_TOO_LARGE 103
|
||||
#define DSA_R_NON_FIPS_METHOD 104
|
||||
#define DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 105
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@ typedef struct err_state_st
|
||||
#define ERR_LIB_STORE 44
|
||||
#define ERR_LIB_FIPS 45
|
||||
#define ERR_LIB_CMS 46
|
||||
#define ERR_LIB_JPAKE 47
|
||||
|
||||
#define ERR_LIB_USER 128
|
||||
|
||||
@@ -175,6 +176,7 @@ typedef struct err_state_st
|
||||
#define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__)
|
||||
#define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__)
|
||||
#define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__)
|
||||
#define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__)
|
||||
|
||||
/* Borland C seems too stupid to be able to shift and do longs in
|
||||
* the pre-processor :-( */
|
||||
@@ -306,6 +308,12 @@ int ERR_get_next_error_library(void);
|
||||
int ERR_set_mark(void);
|
||||
int ERR_pop_to_mark(void);
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void int_ERR_set_state_func(ERR_STATE *(*get_func)(void),
|
||||
void (*remove_func)(unsigned long pid));
|
||||
void int_ERR_lib_init(void);
|
||||
#endif
|
||||
|
||||
/* Already defined in ossl_typ.h */
|
||||
/* typedef struct st_ERR_FNS ERR_FNS; */
|
||||
/* An application can use this function and provide the return value to loaded
|
||||
|
||||
@@ -75,6 +75,10 @@
|
||||
#include <openssl/bio.h>
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#include <openssl/fips.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
#define EVP_RC2_KEY_SIZE 16
|
||||
#define EVP_RC4_KEY_SIZE 16
|
||||
@@ -250,9 +254,19 @@ typedef int evp_verify_method(int type,const unsigned char *m,
|
||||
unsigned int m_length,const unsigned char *sigbuf,
|
||||
unsigned int siglen, void *key);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EVP_MD_CTX *mctx;
|
||||
void *key;
|
||||
} EVP_MD_SVCTX;
|
||||
|
||||
#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single
|
||||
* block */
|
||||
|
||||
#define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */
|
||||
|
||||
#define EVP_MD_FLAG_SVCTX 0x0800 /* pass EVP_MD_SVCTX to sign/verify */
|
||||
|
||||
#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0}
|
||||
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
@@ -306,6 +320,15 @@ struct env_md_ctx_st
|
||||
#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest
|
||||
* in FIPS mode */
|
||||
|
||||
#define EVP_MD_CTX_FLAG_PAD_MASK 0xF0 /* RSA mode to use */
|
||||
#define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00 /* PKCS#1 v1.5 mode */
|
||||
#define EVP_MD_CTX_FLAG_PAD_X931 0x10 /* X9.31 mode */
|
||||
#define EVP_MD_CTX_FLAG_PAD_PSS 0x20 /* PSS mode */
|
||||
#define M_EVP_MD_CTX_FLAG_PSS_SALT(ctx) \
|
||||
((ctx->flags>>16) &0xFFFF) /* seed length */
|
||||
#define EVP_MD_CTX_FLAG_PSS_MDLEN 0xFFFF /* salt len same as digest */
|
||||
#define EVP_MD_CTX_FLAG_PSS_MREC 0xFFFE /* salt max or auto recovered */
|
||||
|
||||
struct evp_cipher_st
|
||||
{
|
||||
int nid;
|
||||
@@ -349,6 +372,14 @@ struct evp_cipher_st
|
||||
#define EVP_CIPH_NO_PADDING 0x100
|
||||
/* cipher handles random key generation */
|
||||
#define EVP_CIPH_RAND_KEY 0x200
|
||||
/* Note if suitable for use in FIPS mode */
|
||||
#define EVP_CIPH_FLAG_FIPS 0x400
|
||||
/* Allow non FIPS cipher in FIPS mode */
|
||||
#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x800
|
||||
/* Allow use default ASN1 get/set iv */
|
||||
#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000
|
||||
/* Buffer length in bits not bytes: CFB1 mode only */
|
||||
#define EVP_CIPH_FLAG_LENGTH_BITS 0x2000
|
||||
|
||||
/* ctrl() values */
|
||||
|
||||
@@ -431,6 +462,18 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
||||
#define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))
|
||||
#define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a))
|
||||
|
||||
/* Macros to reduce FIPS dependencies: do NOT use in applications */
|
||||
#define M_EVP_MD_size(e) ((e)->md_size)
|
||||
#define M_EVP_MD_block_size(e) ((e)->block_size)
|
||||
#define M_EVP_MD_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs))
|
||||
#define M_EVP_MD_CTX_clear_flags(ctx,flgs) ((ctx)->flags&=~(flgs))
|
||||
#define M_EVP_MD_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs))
|
||||
#define M_EVP_MD_type(e) ((e)->type)
|
||||
#define M_EVP_MD_CTX_type(e) M_EVP_MD_type(M_EVP_MD_CTX_md(e))
|
||||
#define M_EVP_MD_CTX_md(e) ((e)->digest)
|
||||
|
||||
#define M_EVP_CIPHER_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs))
|
||||
|
||||
int EVP_MD_type(const EVP_MD *md);
|
||||
#define EVP_MD_nid(e) EVP_MD_type(e)
|
||||
#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e))
|
||||
@@ -526,6 +569,10 @@ int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md,
|
||||
const unsigned char *salt, const unsigned char *data,
|
||||
int datal, int count, unsigned char *key,unsigned char *iv);
|
||||
|
||||
void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags);
|
||||
void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags);
|
||||
int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx,int flags);
|
||||
|
||||
int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
|
||||
const unsigned char *key, const unsigned char *iv);
|
||||
int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
|
||||
@@ -881,6 +928,24 @@ int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
|
||||
EVP_PBE_KEYGEN *keygen);
|
||||
void EVP_PBE_cleanup(void);
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
void int_EVP_MD_set_engine_callbacks(
|
||||
int (*eng_md_init)(ENGINE *impl),
|
||||
int (*eng_md_fin)(ENGINE *impl),
|
||||
int (*eng_md_evp)
|
||||
(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl));
|
||||
void int_EVP_MD_init_engine_callbacks(void);
|
||||
void int_EVP_CIPHER_set_engine_callbacks(
|
||||
int (*eng_ciph_fin)(ENGINE *impl),
|
||||
int (*eng_ciph_evp)
|
||||
(EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pciph, ENGINE *impl));
|
||||
void int_EVP_CIPHER_init_engine_callbacks(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void EVP_add_alg_module(void);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
@@ -891,16 +956,23 @@ void ERR_load_EVP_strings(void);
|
||||
|
||||
/* Function codes. */
|
||||
#define EVP_F_AES_INIT_KEY 133
|
||||
#define EVP_F_ALG_MODULE_INIT 138
|
||||
#define EVP_F_CAMELLIA_INIT_KEY 159
|
||||
#define EVP_F_D2I_PKEY 100
|
||||
#define EVP_F_DO_EVP_ENC_ENGINE 140
|
||||
#define EVP_F_DO_EVP_ENC_ENGINE_FULL 141
|
||||
#define EVP_F_DO_EVP_MD_ENGINE 139
|
||||
#define EVP_F_DO_EVP_MD_ENGINE_FULL 142
|
||||
#define EVP_F_DSAPKEY2PKCS8 134
|
||||
#define EVP_F_DSA_PKEY2PKCS8 135
|
||||
#define EVP_F_ECDSA_PKEY2PKCS8 129
|
||||
#define EVP_F_ECKEY_PKEY2PKCS8 132
|
||||
#define EVP_F_EVP_CIPHERINIT 137
|
||||
#define EVP_F_EVP_CIPHERINIT_EX 123
|
||||
#define EVP_F_EVP_CIPHER_CTX_CTRL 124
|
||||
#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
|
||||
#define EVP_F_EVP_DECRYPTFINAL_EX 101
|
||||
#define EVP_F_EVP_DIGESTINIT 136
|
||||
#define EVP_F_EVP_DIGESTINIT_EX 128
|
||||
#define EVP_F_EVP_ENCRYPTFINAL_EX 127
|
||||
#define EVP_F_EVP_MD_CTX_COPY_EX 110
|
||||
@@ -942,15 +1014,20 @@ void ERR_load_EVP_strings(void);
|
||||
#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
|
||||
#define EVP_R_DECODE_ERROR 114
|
||||
#define EVP_R_DIFFERENT_KEY_TYPES 101
|
||||
#define EVP_R_DISABLED_FOR_FIPS 144
|
||||
#define EVP_R_ENCODE_ERROR 115
|
||||
#define EVP_R_ERROR_LOADING_SECTION 145
|
||||
#define EVP_R_ERROR_SETTING_FIPS_MODE 146
|
||||
#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119
|
||||
#define EVP_R_EXPECTING_AN_RSA_KEY 127
|
||||
#define EVP_R_EXPECTING_A_DH_KEY 128
|
||||
#define EVP_R_EXPECTING_A_DSA_KEY 129
|
||||
#define EVP_R_EXPECTING_A_ECDSA_KEY 141
|
||||
#define EVP_R_EXPECTING_A_EC_KEY 142
|
||||
#define EVP_R_FIPS_MODE_NOT_SUPPORTED 147
|
||||
#define EVP_R_INITIALIZATION_ERROR 134
|
||||
#define EVP_R_INPUT_NOT_INITIALIZED 111
|
||||
#define EVP_R_INVALID_FIPS_MODE 148
|
||||
#define EVP_R_INVALID_KEY_LENGTH 130
|
||||
#define EVP_R_IV_TOO_LARGE 102
|
||||
#define EVP_R_KEYGEN_FAILURE 120
|
||||
@@ -962,6 +1039,7 @@ void ERR_load_EVP_strings(void);
|
||||
#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105
|
||||
#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117
|
||||
#define EVP_R_PUBLIC_KEY_NOT_RSA 106
|
||||
#define EVP_R_UNKNOWN_OPTION 149
|
||||
#define EVP_R_UNKNOWN_PBE_ALGORITHM 121
|
||||
#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135
|
||||
#define EVP_R_UNSUPPORTED_CIPHER 107
|
||||
|
||||
@@ -83,6 +83,9 @@ typedef struct idea_key_st
|
||||
const char *idea_options(void);
|
||||
void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
IDEA_KEY_SCHEDULE *ks);
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
|
||||
#endif
|
||||
void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
|
||||
void idea_set_decrypt_key(const IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
|
||||
void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
|
||||
@@ -81,6 +81,9 @@ typedef struct MD2state_st
|
||||
} MD2_CTX;
|
||||
|
||||
const char *MD2_options(void);
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_MD2_Init(MD2_CTX *c);
|
||||
#endif
|
||||
int MD2_Init(MD2_CTX *c);
|
||||
int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len);
|
||||
int MD2_Final(unsigned char *md, MD2_CTX *c);
|
||||
|
||||
@@ -105,6 +105,9 @@ typedef struct MD4state_st
|
||||
unsigned int num;
|
||||
} MD4_CTX;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_MD4_Init(MD4_CTX *c);
|
||||
#endif
|
||||
int MD4_Init(MD4_CTX *c);
|
||||
int MD4_Update(MD4_CTX *c, const void *data, size_t len);
|
||||
int MD4_Final(unsigned char *md, MD4_CTX *c);
|
||||
|
||||
@@ -105,6 +105,9 @@ typedef struct MD5state_st
|
||||
unsigned int num;
|
||||
} MD5_CTX;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_MD5_Init(MD5_CTX *c);
|
||||
#endif
|
||||
int MD5_Init(MD5_CTX *c);
|
||||
int MD5_Update(MD5_CTX *c, const void *data, size_t len);
|
||||
int MD5_Final(unsigned char *md, MD5_CTX *c);
|
||||
|
||||
@@ -1734,6 +1734,11 @@
|
||||
#define NID_id_on_personalData 347
|
||||
#define OBJ_id_on_personalData OBJ_id_on,1L
|
||||
|
||||
#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier"
|
||||
#define LN_id_on_permanentIdentifier "Permanent Identifier"
|
||||
#define NID_id_on_permanentIdentifier 858
|
||||
#define OBJ_id_on_permanentIdentifier OBJ_id_on,3L
|
||||
|
||||
#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth"
|
||||
#define NID_id_pda_dateOfBirth 348
|
||||
#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L
|
||||
@@ -2235,6 +2240,11 @@
|
||||
#define NID_ext_key_usage 126
|
||||
#define OBJ_ext_key_usage OBJ_id_ce,37L
|
||||
|
||||
#define SN_freshest_crl "freshestCRL"
|
||||
#define LN_freshest_crl "X509v3 Freshest CRL"
|
||||
#define NID_freshest_crl 857
|
||||
#define OBJ_freshest_crl OBJ_id_ce,46L
|
||||
|
||||
#define SN_inhibit_any_policy "inhibitAnyPolicy"
|
||||
#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy"
|
||||
#define NID_inhibit_any_policy 748
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#endif
|
||||
#ifndef OPENSSL_DOING_MAKEDEPEND
|
||||
|
||||
|
||||
#ifndef OPENSSL_NO_CAMELLIA
|
||||
# define OPENSSL_NO_CAMELLIA
|
||||
#endif
|
||||
@@ -19,6 +20,9 @@
|
||||
#ifndef OPENSSL_NO_GMP
|
||||
# define OPENSSL_NO_GMP
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_JPAKE
|
||||
# define OPENSSL_NO_JPAKE
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_KRB5
|
||||
# define OPENSSL_NO_KRB5
|
||||
#endif
|
||||
@@ -34,11 +38,9 @@
|
||||
#ifndef OPENSSL_NO_SEED
|
||||
# define OPENSSL_NO_SEED
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
# define OPENSSL_NO_TLSEXT
|
||||
#endif
|
||||
|
||||
#endif /* OPENSSL_DOING_MAKEDEPEND */
|
||||
|
||||
#ifndef OPENSSL_THREADS
|
||||
# define OPENSSL_THREADS
|
||||
#endif
|
||||
@@ -60,6 +62,9 @@
|
||||
# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)
|
||||
# define NO_GMP
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE)
|
||||
# define NO_JPAKE
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)
|
||||
# define NO_KRB5
|
||||
# endif
|
||||
@@ -75,13 +80,25 @@
|
||||
# if defined(OPENSSL_NO_SEED) && !defined(NO_SEED)
|
||||
# define NO_SEED
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_TLSEXT) && !defined(NO_TLSEXT)
|
||||
# define NO_TLSEXT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* crypto/opensslconf.h.in */
|
||||
|
||||
#ifdef OPENSSL_DOING_MAKEDEPEND
|
||||
|
||||
/* Include any symbols here that have to be explicitly set to enable a feature
|
||||
* that should be visible to makedepend.
|
||||
*
|
||||
* [Our "make depend" doesn't actually look at this, we use actual build settings
|
||||
* instead; we want to make it easy to remove subdirectories with disabled algorithms.]
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_FIPS
|
||||
#define OPENSSL_FIPS
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* Generate 80386 code? */
|
||||
#undef I386_ONLY
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
|
||||
* major minor fix final patch/beta)
|
||||
*/
|
||||
#define OPENSSL_VERSION_NUMBER 0x0090809fL
|
||||
#define OPENSSL_VERSION_NUMBER 0x009080afL
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8i-fips 15 Sep 2008"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8j-fips 07 Jan 2009"
|
||||
#else
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8i 15 Sep 2008"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8j 07 Jan 2009"
|
||||
#endif
|
||||
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ typedef int ASN1_NULL;
|
||||
#undef X509_EXTENSIONS
|
||||
#undef X509_CERT_PAIR
|
||||
#undef PKCS7_ISSUER_AND_SERIAL
|
||||
#undef OCSP_REQUEST
|
||||
#undef OCSP_RESPONSE
|
||||
#endif
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ extern "C" {
|
||||
#define PEM_STRING_DSA "DSA PRIVATE KEY"
|
||||
#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
|
||||
#define PEM_STRING_PKCS7 "PKCS7"
|
||||
#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
|
||||
#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
|
||||
#define PEM_STRING_PKCS8INF "PRIVATE KEY"
|
||||
#define PEM_STRING_DHPARAMS "DH PARAMETERS"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* pkcs12.h */
|
||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||
* project 1999.
|
||||
*/
|
||||
/* ====================================================================
|
||||
|
||||
@@ -57,6 +57,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_PQ_COMPAT_H
|
||||
#define HEADER_PQ_COMPAT_H
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
@@ -145,3 +148,5 @@
|
||||
*(x) |= mask; \
|
||||
} while(0)
|
||||
#endif /* OPENSSL_SYS_VMS */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -72,7 +72,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_FIPS)
|
||||
#define FIPS_RAND_SIZE_T size_t
|
||||
#define FIPS_RAND_SIZE_T int
|
||||
#endif
|
||||
|
||||
/* Already defined in ossl_typ.h */
|
||||
@@ -111,6 +111,15 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
|
||||
int RAND_egd(const char *path);
|
||||
int RAND_egd_bytes(const char *path,int bytes);
|
||||
int RAND_poll(void);
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
#ifdef OPENSSL_FIPS
|
||||
void int_RAND_init_engine_callbacks(void);
|
||||
void int_RAND_set_callbacks(
|
||||
int (*set_rand_func)(const RAND_METHOD *meth,
|
||||
const RAND_METHOD **pmeth),
|
||||
const RAND_METHOD *(*get_rand_func)(const RAND_METHOD **pmeth));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
|
||||
|
||||
@@ -128,11 +137,29 @@ void ERR_load_RAND_strings(void);
|
||||
/* Error codes for the RAND functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define RAND_F_ENG_RAND_GET_RAND_METHOD 108
|
||||
#define RAND_F_FIPS_RAND 103
|
||||
#define RAND_F_FIPS_RAND_BYTES 102
|
||||
#define RAND_F_FIPS_RAND_GET_RAND_METHOD 109
|
||||
#define RAND_F_FIPS_RAND_SET_DT 106
|
||||
#define RAND_F_FIPS_SET_DT 104
|
||||
#define RAND_F_FIPS_SET_PRNG_SEED 107
|
||||
#define RAND_F_FIPS_SET_TEST_MODE 105
|
||||
#define RAND_F_RAND_GET_RAND_METHOD 101
|
||||
#define RAND_F_SSLEAY_RAND_BYTES 100
|
||||
|
||||
/* Reason codes. */
|
||||
#define RAND_R_NON_FIPS_METHOD 105
|
||||
#define RAND_R_NOT_IN_TEST_MODE 106
|
||||
#define RAND_R_NO_KEY_SET 107
|
||||
#define RAND_R_PRNG_ASKING_FOR_TOO_MUCH 101
|
||||
#define RAND_R_PRNG_ERROR 108
|
||||
#define RAND_R_PRNG_KEYED 109
|
||||
#define RAND_R_PRNG_NOT_REKEYED 102
|
||||
#define RAND_R_PRNG_NOT_RESEEDED 103
|
||||
#define RAND_R_PRNG_NOT_SEEDED 100
|
||||
#define RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY 110
|
||||
#define RAND_R_PRNG_STUCK 104
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -79,7 +79,9 @@ typedef struct rc2_key_st
|
||||
RC2_INT data[64];
|
||||
} RC2_KEY;
|
||||
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
|
||||
#endif
|
||||
void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
|
||||
void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key,
|
||||
int enc);
|
||||
|
||||
@@ -76,6 +76,9 @@ typedef struct rc4_key_st
|
||||
|
||||
|
||||
const char *RC4_options(void);
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
|
||||
#endif
|
||||
void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
|
||||
void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata,
|
||||
unsigned char *outdata);
|
||||
|
||||
@@ -90,7 +90,9 @@ typedef struct RIPEMD160state_st
|
||||
RIPEMD160_LONG data[RIPEMD160_LBLOCK];
|
||||
unsigned int num;
|
||||
} RIPEMD160_CTX;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_RIPEMD160_Init(RIPEMD160_CTX *c);
|
||||
#endif
|
||||
int RIPEMD160_Init(RIPEMD160_CTX *c);
|
||||
int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);
|
||||
int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
|
||||
|
||||
@@ -74,6 +74,25 @@
|
||||
#error RSA is disabled.
|
||||
#endif
|
||||
|
||||
/* If this flag is set the RSA method is FIPS compliant and can be used
|
||||
* in FIPS mode. This is set in the validated module method. If an
|
||||
* application sets this flag in its own methods it is its reposibility
|
||||
* to ensure the result is compliant.
|
||||
*/
|
||||
|
||||
#define RSA_FLAG_FIPS_METHOD 0x0400
|
||||
|
||||
/* If this flag is set the operations normally disabled in FIPS mode are
|
||||
* permitted it is then the applications responsibility to ensure that the
|
||||
* usage is compliant.
|
||||
*/
|
||||
|
||||
#define RSA_FLAG_NON_FIPS_ALLOW 0x0400
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define FIPS_RSA_SIZE_T int
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -163,6 +182,8 @@ struct rsa_st
|
||||
# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
|
||||
#endif
|
||||
|
||||
#define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 1024
|
||||
|
||||
#ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
|
||||
# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
|
||||
#endif
|
||||
@@ -240,6 +261,11 @@ RSA * RSA_generate_key(int bits, unsigned long e,void
|
||||
|
||||
/* New version */
|
||||
int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
|
||||
int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, BIGNUM *q2,
|
||||
const BIGNUM *Xp1, const BIGNUM *Xp2, const BIGNUM *Xp,
|
||||
const BIGNUM *Xq1, const BIGNUM *Xq2, const BIGNUM *Xq,
|
||||
const BIGNUM *e, BN_GENCB *cb);
|
||||
int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, BN_GENCB *cb);
|
||||
|
||||
int RSA_check_key(const RSA *);
|
||||
/* next 4 return -1 on error */
|
||||
@@ -257,6 +283,11 @@ int RSA_up_ref(RSA *r);
|
||||
|
||||
int RSA_flags(const RSA *r);
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
RSA *FIPS_rsa_new(void);
|
||||
void FIPS_rsa_free(RSA *r);
|
||||
#endif
|
||||
|
||||
void RSA_set_default_method(const RSA_METHOD *meth);
|
||||
const RSA_METHOD *RSA_get_default_method(void);
|
||||
const RSA_METHOD *RSA_get_method(const RSA *rsa);
|
||||
@@ -370,6 +401,8 @@ void ERR_load_RSA_strings(void);
|
||||
/* Error codes for the RSA functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define RSA_F_FIPS_RSA_SIGN 140
|
||||
#define RSA_F_FIPS_RSA_VERIFY 141
|
||||
#define RSA_F_MEMORY_LOCK 100
|
||||
#define RSA_F_RSA_BUILTIN_KEYGEN 129
|
||||
#define RSA_F_RSA_CHECK_KEY 123
|
||||
@@ -401,7 +434,11 @@ void ERR_load_RSA_strings(void);
|
||||
#define RSA_F_RSA_PADDING_CHECK_X931 128
|
||||
#define RSA_F_RSA_PRINT 115
|
||||
#define RSA_F_RSA_PRINT_FP 116
|
||||
#define RSA_F_RSA_PRIVATE_ENCRYPT 137
|
||||
#define RSA_F_RSA_PUBLIC_DECRYPT 138
|
||||
#define RSA_F_RSA_SETUP_BLINDING 136
|
||||
#define RSA_F_RSA_SET_DEFAULT_METHOD 139
|
||||
#define RSA_F_RSA_SET_METHOD 142
|
||||
#define RSA_F_RSA_SIGN 117
|
||||
#define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118
|
||||
#define RSA_F_RSA_VERIFY 119
|
||||
@@ -435,10 +472,12 @@ void ERR_load_RSA_strings(void);
|
||||
#define RSA_R_KEY_SIZE_TOO_SMALL 120
|
||||
#define RSA_R_LAST_OCTET_INVALID 134
|
||||
#define RSA_R_MODULUS_TOO_LARGE 105
|
||||
#define RSA_R_NON_FIPS_METHOD 141
|
||||
#define RSA_R_NO_PUBLIC_EXPONENT 140
|
||||
#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
|
||||
#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
|
||||
#define RSA_R_OAEP_DECODING_ERROR 121
|
||||
#define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 142
|
||||
#define RSA_R_PADDING_CHECK_FAILED 114
|
||||
#define RSA_R_P_NOT_PRIME 128
|
||||
#define RSA_R_Q_NOT_PRIME 129
|
||||
|
||||
@@ -106,6 +106,9 @@ typedef struct SHAstate_st
|
||||
} SHA_CTX;
|
||||
|
||||
#ifndef OPENSSL_NO_SHA0
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_SHA_Init(SHA_CTX *c);
|
||||
#endif
|
||||
int SHA_Init(SHA_CTX *c);
|
||||
int SHA_Update(SHA_CTX *c, const void *data, size_t len);
|
||||
int SHA_Final(unsigned char *md, SHA_CTX *c);
|
||||
|
||||
@@ -179,6 +179,11 @@
|
||||
#define ENGINE_set_load_privkey_function ENGINE_set_load_privkey_fn
|
||||
#undef ENGINE_get_load_privkey_function
|
||||
#define ENGINE_get_load_privkey_function ENGINE_get_load_privkey_fn
|
||||
#undef ENGINE_set_load_ssl_client_cert_function
|
||||
#define ENGINE_set_load_ssl_client_cert_function \
|
||||
ENGINE_set_ld_ssl_clnt_cert_fn
|
||||
#undef ENGINE_get_ssl_client_cert_function
|
||||
#define ENGINE_get_ssl_client_cert_function ENGINE_get_ssl_client_cert_fn
|
||||
|
||||
/* Hack some long OCSP names */
|
||||
#undef OCSP_REQUEST_get_ext_by_critical
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* x509v3.h */
|
||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||
* project 1999.
|
||||
*/
|
||||
/* ====================================================================
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user