Change OPENSSL_FIPSEVP to OPENSSL_FIPSAPI as it doesn't just refer
to EVP any more. Move locking #define into fips.h. Set FIPS locking callbacks at same time as OpenSSL locking callbacks.
This commit is contained in:
parent
d5df1b3f0d
commit
7c8ced94c3
@ -116,7 +116,7 @@
|
|||||||
* sections 3.8 and 4.2 in http://security.ece.orst.edu/koc/papers/r01rsasw.pdf
|
* sections 3.8 and 4.2 in http://security.ece.orst.edu/koc/papers/r01rsasw.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "cryptlib.h"
|
#include "cryptlib.h"
|
||||||
|
@ -249,10 +249,6 @@ typedef struct openssl_item_st
|
|||||||
#define CRYPTO_add(a,b,c) ((*(a))+=(b))
|
#define CRYPTO_add(a,b,c) ((*(a))+=(b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSEVP)
|
|
||||||
#define CRYPTO_lock FIPS_lock
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Some applications as well as some parts of OpenSSL need to allocate
|
/* Some applications as well as some parts of OpenSSL need to allocate
|
||||||
and deallocate locks in a dynamic fashion. The following typedef
|
and deallocate locks in a dynamic fashion. The following typedef
|
||||||
makes this possible in a type-safe manner. */
|
makes this possible in a type-safe manner. */
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
#ifndef OPENSSL_NO_SHA
|
#ifndef OPENSSL_NO_SHA
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "cryptlib.h"
|
#include "cryptlib.h"
|
||||||
|
@ -551,7 +551,7 @@ int FIPS_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSEVP)
|
#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSAPI)
|
||||||
|
|
||||||
#define EVP_MD_CTX_init FIPS_md_ctx_init
|
#define EVP_MD_CTX_init FIPS_md_ctx_init
|
||||||
#define EVP_MD_CTX_cleanup FIPS_md_ctx_cleanup
|
#define EVP_MD_CTX_cleanup FIPS_md_ctx_cleanup
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -116,6 +116,9 @@
|
|||||||
|
|
||||||
#include "cryptlib.h"
|
#include "cryptlib.h"
|
||||||
#include <openssl/safestack.h>
|
#include <openssl/safestack.h>
|
||||||
|
#ifdef OPENSSL_FIPS
|
||||||
|
#include <openssl/fips.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
|
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
|
||||||
static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
|
static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
|
||||||
@ -380,6 +383,9 @@ void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*func)
|
|||||||
void CRYPTO_set_dynlock_lock_callback(void (*func)(int mode,
|
void CRYPTO_set_dynlock_lock_callback(void (*func)(int mode,
|
||||||
struct CRYPTO_dynlock_value *l, const char *file, int line))
|
struct CRYPTO_dynlock_value *l, const char *file, int line))
|
||||||
{
|
{
|
||||||
|
#ifdef OPENSSL_FIPS
|
||||||
|
FIPS_set_locking_callback(CRYPTO_lock);
|
||||||
|
#endif
|
||||||
dynlock_lock_callback=func;
|
dynlock_lock_callback=func;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,6 +411,9 @@ int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type,
|
|||||||
void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
|
void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
|
||||||
const char *file,int line))
|
const char *file,int line))
|
||||||
{
|
{
|
||||||
|
#ifdef OPENSSL_FIPS
|
||||||
|
FIPS_set_locking_callback(CRYPTO_lock);
|
||||||
|
#endif
|
||||||
locking_callback=func;
|
locking_callback=func;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#ifdef MD_RAND_DEBUG
|
#ifdef MD_RAND_DEBUG
|
||||||
# ifndef NDEBUG
|
# ifndef NDEBUG
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "cryptlib.h"
|
#include "cryptlib.h"
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* an equivalent notion.
|
* an equivalent notion.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
|
|
||||||
#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
|
#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "cryptlib.h"
|
#include "cryptlib.h"
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
U.S.A.
|
U.S.A.
|
||||||
----------------------------------------------*/
|
----------------------------------------------*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
U.S.A.
|
U.S.A.
|
||||||
----------------------------------------------*/
|
----------------------------------------------*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
|
@ -10,7 +10,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
#include <openssl/dsa.h>
|
#include <openssl/dsa.h>
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
#include <openssl/fips_rand.h>
|
#include <openssl/fips_rand.h>
|
||||||
|
@ -122,6 +122,10 @@ int FIPS_evp_md_ctx_cleanup(EVP_MD_CTX *ctx);
|
|||||||
void FIPS_set_locking_callback (void (*func)(int mode, int type,
|
void FIPS_set_locking_callback (void (*func)(int mode, int type,
|
||||||
const char *file,int line));
|
const char *file,int line));
|
||||||
|
|
||||||
|
#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSAPI)
|
||||||
|
#define CRYPTO_lock FIPS_lock
|
||||||
|
#endif
|
||||||
|
|
||||||
/* BEGIN ERROR CODES */
|
/* BEGIN ERROR CODES */
|
||||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
/* 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.
|
* made after this point may be overwritten when the script is next run.
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a FIPS approved AES PRNG based on ANSI X9.31 A.2.4.
|
* This is a FIPS approved AES PRNG based on ANSI X9.31 A.2.4.
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
* ====================================================================
|
* ====================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OPENSSL_FIPSEVP
|
#define OPENSSL_FIPSAPI
|
||||||
|
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/fips.h>
|
#include <openssl/fips.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user