if ($fips)
{
$des_obj=$sha1_obj="";
- $cflags.=" -DFIPS";
}
$des_obj=$des_enc unless (!$fips && $des_obj =~ /\.o$/);
$bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/);
#include <openssl/fips.h>
#include "aes_locl.h"
-#ifndef FIPS
+#ifndef OPENSSL_FIPS
/*
Te0[x] = S [x].[02, 01, 01, 03];
PUTU32(out + 12, s3);
}
-#endif /* ndef FIPS */
+#endif /* ndef OPENSSL_FIPS */
static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
#endif
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
int FIPS_mode;
void *FIPS_rand_check;
-#endif /* def FIPS */
+#endif /* def OPENSSL_FIPS */
DECLARE_STACK_OF(CRYPTO_dynlock)
IMPLEMENT_STACK_OF(CRYPTO_dynlock)
#include "des_locl.h"
-#ifndef FIPS
+#ifndef OPENSSL_FIPS
void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
{
data[1]=r;
}
-#endif /* ndef FIPS */
+#endif /* ndef OPENSSL_FIPS */
#ifndef DES_DEFAULT_OPTIONS
#include <openssl/rand.h>
#include <openssl/sha.h>
-#ifndef FIPS
+#ifndef OPENSSL_FIPS
DSA *DSA_generate_parameters(int bits,
unsigned char *seed_in, int seed_len,
int *counter_ret, unsigned long *h_ret,
if (mont != NULL) BN_MONT_CTX_free(mont);
return(ok?ret:NULL);
}
-#endif /* ndef FIPS */
+#endif /* ndef OPENSSL_FIPS */
#endif /* ndef OPENSSL_NO_SHA */
#include <openssl/rand.h>
#include <openssl/asn1.h>
-#ifndef FIPS
+#ifndef OPENSSL_FIPS
static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int 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,
DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
{
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
if(FIPS_mode && !FIPS_dsa_check(dsa))
return NULL;
#endif
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
{
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
if(FIPS_mode && !FIPS_dsa_check(dsa))
return 0;
#endif
int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
DSA *dsa)
{
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
if(FIPS_mode && !FIPS_dsa_check(dsa))
return -1;
#endif
ERR_load_OCSP_strings();
ERR_load_UI_strings();
#endif
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
ERR_load_FIPS_strings();
#endif
}
static const unsigned char end[4]={0x80,0x00,0x00,0x00};
const unsigned char *cp=end;
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
if(FIPS_mode && !FIPS_md5_allowed)
{
FIPSerr(FIPS_F_HASH_FINAL,FIPS_R_NON_FIPS_METHOD);
#endif
int do_stir_pool = 0;
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
if(FIPS_mode)
{
FIPSerr(FIPS_F_SSLEAY_RAND_BYTES,FIPS_R_NON_FIPS_METHOD);
const RAND_METHOD *RAND_get_rand_method(void)
{
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
if(FIPS_mode && default_RAND_meth != FIPS_rand_check)
{
RANDerr(RAND_F_RAND_GET_RAND_METHOD,RAND_R_NON_FIPS_METHOD);
#include <openssl/opensslv.h>
-#ifndef FIPS
+#ifndef OPENSSL_FIPS
const char *SHA1_version="SHA1" OPENSSL_VERSION_PTEXT;
/* The implementation is in ../md32_common.h */
#include "sha_locl.h"
-#else /* ndef FIPS */
+#else /* ndef OPENSSL_FIPS */
static void *dummy=&dummy;
-#endif /* ndef FIPS */
+#endif /* ndef OPENSSL_FIPS */
#endif
#include <openssl/aes.h>
#include "fips_aes_locl.h"
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
/*
Te0[x] = S [x].[02, 01, 01, 03];
PUTU32(out + 12, s3);
}
-#endif /* def FIPS */
+#endif /* def OPENSSL_FIPS */
#include <openssl/fips.h>
#include <openssl/aes.h>
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
static struct
{
unsigned char key[16];
break;
if(!strncasecmp(ibuf,"COUNT = ",8))
break;
-
+
if (strncasecmp(ibuf, "KEY = ", 6) != 0)
{
printf("Missing KEY\n");
err =1;
break;
}
-
+
PrintValue("CIPHERTEXT", ciphertext, len);
if (strcmp(atest, "MCT") == 0) /* Monte Carlo Test */
{
char fn[250] = "", rfn[256] = "";
int f_opt = 0, d_opt = 1;
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
if(!FIPS_mode_set(1,argv[0]))
{
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
#include "fips_des_locl.h"
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
{
data[1]=r;
}
-#else /* ndef FIPS */
+#else /* ndef OPENSSL_FIPS */
static void *dummy=&dummy;
-#endif /* ndef FIPS */
+#endif /* ndef OPENSSL_FIPS */
char fn[250] = "", rfn[256] = "";
int f_opt = 0, d_opt = 1;
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
if(!FIPS_mode_set(1,argv[0]))
{
ERR_load_crypto_strings();
#ifndef OPENSSL_NO_SHA
#include <openssl/sha.h>
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
DSA *DSA_generate_parameters(int bits,
unsigned char *seed_in, int seed_len,
#endif
#include <openssl/fips.h>
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx);
}
-#else /* ndef FIPS */
+#else /* ndef OPENSSL_FIPS */
static void *dummy=&dummy;
-#endif /* ndef FIPS */
+#endif /* ndef OPENSSL_FIPS */
#include <openssl/fips.h>
#include <openssl/fips_rand.h>
-#if defined(OPENSSL_NO_DSA) || !defined(FIPS)
+#if defined(OPENSSL_NO_DSA) || !defined(OPENSSL_FIPS)
int main(int argc, char *argv[])
{
printf("No FIPS DSA support\n");
if (bio_err == NULL)
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
if(!FIPS_mode_set(1,argv[0]))
{
ERR_print_errors(bio_err);
#include <limits.h>
#include "fips_locl.h"
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
int FIPS_md5_allowed;
*
*/
-#if defined(FIPS) || defined(OPENSSL_FIPS)
+#include <openssl/opensslconf.h>
+
+#ifdef OPENSSL_FIPS
/* Note that these are defined in crypto/cryptlib.c so they're
* available even without -lfips.
*/
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
# include "fips_err.h"
#else
static void *dummy=&dummy;
#include "e_os.h"
-#ifndef FIPS
+#ifndef OPENSSL_FIPS
int main(int argc, char *argv[])
{
printf("No FIPS RAND support\n");
#include <openssl/fips.h>
#include <openssl/sha.h>
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
static char *test[]=
{
"",
#include <openssl/opensslv.h>
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
const char *SHA1_version="SHA1" OPENSSL_VERSION_PTEXT;
/* The implementation is in fips_md32_common.h */
#include "fips_sha_locl.h"
-#else /* ndef FIPS */
+#else /* ndef OPENSSL_FIPS */
static void *dummy=&dummy;
-#endif /* ndef FIPS */
+#endif /* ndef OPENSSL_FIPS */
#endif
#include <openssl/err.h>
#include <openssl/fips.h>
-#ifndef FIPS
+#ifndef OPENSSL_FIPS
int main(int argc, char *argv[])
{
printf("No FIPS SHA1 support\n");
int main(int argc,char **argv)
{
-#ifdef FIPS
+#ifdef OPENSSL_FIPS
int n;
if(argc < 2)