Compare commits
16 Commits
OpenSSL-fi
...
OpenSSL-fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81fc8cd029 | ||
|
|
1d235039d6 | ||
|
|
58886fdefc | ||
|
|
61c3085d47 | ||
|
|
32b56fe4d2 | ||
|
|
efd031abca | ||
|
|
dd4eefdb7b | ||
|
|
fcd3e8e97b | ||
|
|
476e7e4972 | ||
|
|
5e900f3cef | ||
|
|
75b250a4ed | ||
|
|
44cb365eaf | ||
|
|
9bd2dde42f | ||
|
|
31bf5f13e0 | ||
|
|
7dcdc0d94d | ||
|
|
6ecd287acc |
@@ -524,8 +524,8 @@ files:
|
|||||||
links:
|
links:
|
||||||
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
|
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
|
||||||
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
||||||
@set -e; dir=fips target=links; $(RECURSIVE_BUILD_CMD)
|
@set -e; dir=fips target=links; $(BUILD_ONE_CMD)
|
||||||
@(cd crypto ; SDIRS='$(LINKDIRS)' $(MAKE) -e links)
|
@(cd crypto ; TEST='' SDIRS='$(LINKDIRS)' $(MAKE) -e links)
|
||||||
|
|
||||||
gentests:
|
gentests:
|
||||||
@(cd test && echo "generating dummy tests (if needed)..." && \
|
@(cd test && echo "generating dummy tests (if needed)..." && \
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ ___
|
|||||||
$code.=<<___;
|
$code.=<<___;
|
||||||
jr $ra
|
jr $ra
|
||||||
move $a0,$v0
|
move $a0,$v0
|
||||||
.end bn_mul_add_words
|
.end bn_mul_add_words_internal
|
||||||
|
|
||||||
.align 5
|
.align 5
|
||||||
.globl bn_mul_words
|
.globl bn_mul_words
|
||||||
@@ -778,7 +778,7 @@ ___
|
|||||||
$code.=<<___;
|
$code.=<<___;
|
||||||
jr $ra
|
jr $ra
|
||||||
move $a0,$v0
|
move $a0,$v0
|
||||||
.end bn_sub_words
|
.end bn_sub_words_internal
|
||||||
|
|
||||||
.align 5
|
.align 5
|
||||||
.globl bn_div_3_words
|
.globl bn_div_3_words
|
||||||
|
|||||||
@@ -359,7 +359,15 @@ void OPENSSL_showfatal (const char *fmta,...)
|
|||||||
{ va_list ap;
|
{ va_list ap;
|
||||||
|
|
||||||
va_start (ap,fmta);
|
va_start (ap,fmta);
|
||||||
|
#if defined(OPENSSL_SYS_VXWORKS)
|
||||||
|
{
|
||||||
|
char buf[256];
|
||||||
|
vsnprintf(buf,sizeof(buf),fmta,ap);
|
||||||
|
printf("%s",buf);
|
||||||
|
}
|
||||||
|
#else
|
||||||
vfprintf (stderr,fmta,ap);
|
vfprintf (stderr,fmta,ap);
|
||||||
|
#endif
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
}
|
}
|
||||||
int OPENSSL_isservice (void) { return 0; }
|
int OPENSSL_isservice (void) { return 0; }
|
||||||
|
|||||||
@@ -666,7 +666,13 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N,
|
|||||||
/* "offset = offset + n + 1" */
|
/* "offset = offset + n + 1" */
|
||||||
|
|
||||||
/* step 14 */
|
/* step 14 */
|
||||||
if (counter >= 4096) break;
|
if (counter >= (int)(4 * L)) break;
|
||||||
|
}
|
||||||
|
if (seed_in)
|
||||||
|
{
|
||||||
|
ok = 0;
|
||||||
|
DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS);
|
||||||
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const uns
|
|||||||
return 1;\
|
return 1;\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EVP_MAXCHUNK ((size_t)1<<(sizeof(long)*8-2))
|
#define EVP_MAXCHUNK ((size_t)1<<(sizeof(int)*8-2))
|
||||||
|
|
||||||
#define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched) \
|
#define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched) \
|
||||||
static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
|
static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
|
||||||
|
|||||||
@@ -119,8 +119,6 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
|
|||||||
&mov ("esi","edx");
|
&mov ("esi","edx");
|
||||||
&or ("ebp","ecx"); # merge AMD XOP flag
|
&or ("ebp","ecx"); # merge AMD XOP flag
|
||||||
|
|
||||||
&bt ("ecx",26); # check XSAVE bit
|
|
||||||
&jnc (&label("done"));
|
|
||||||
&bt ("ecx",27); # check OSXSAVE bit
|
&bt ("ecx",27); # check OSXSAVE bit
|
||||||
&jnc (&label("clear_avx"));
|
&jnc (&label("clear_avx"));
|
||||||
&xor ("ecx","ecx");
|
&xor ("ecx","ecx");
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ int fips_post_failed(int id, int subid, void *ex);
|
|||||||
int fips_post_corrupt(int id, int subid, void *ex);
|
int fips_post_corrupt(int id, int subid, void *ex);
|
||||||
int fips_post_status(void);
|
int fips_post_status(void);
|
||||||
|
|
||||||
#define FIPS_MODULE_VERSION_NUMBER 0x20000004L
|
#define FIPS_MODULE_VERSION_NUMBER 0x20000006L
|
||||||
#define FIPS_MODULE_VERSION_TEXT "FIPS 2.0-rc4 unvalidated test module xx XXX xxxx"
|
#define FIPS_MODULE_VERSION_TEXT "FIPS 2.0-rc6 unvalidated test module xx XXX xxxx"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -650,6 +650,13 @@ static size_t drbg_test_cb(DRBG_CTX *ctx, unsigned char **pout,
|
|||||||
return (min_len + 0xf) & ~0xf;
|
return (min_len + 0xf) & ~0xf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Callback which returns 0 to indicate entropy source failure */
|
||||||
|
static size_t drbg_fail_cb(DRBG_CTX *ctx, unsigned char **pout,
|
||||||
|
int entropy, size_t min_len, size_t max_len)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* DRBG test: just generate lots of data and trigger health checks */
|
/* DRBG test: just generate lots of data and trigger health checks */
|
||||||
|
|
||||||
static int do_drbg_test(int type, int flags)
|
static int do_drbg_test(int type, int flags)
|
||||||
@@ -1036,7 +1043,7 @@ static int do_fail_all(int fullpost, int fullerr)
|
|||||||
size_t i;
|
size_t i;
|
||||||
RSA *rsa = NULL;
|
RSA *rsa = NULL;
|
||||||
DSA *dsa = NULL;
|
DSA *dsa = NULL;
|
||||||
DRBG_CTX *dctx = NULL;
|
DRBG_CTX *dctx = NULL, *defctx = NULL;
|
||||||
EC_KEY *ec = NULL;
|
EC_KEY *ec = NULL;
|
||||||
BIGNUM *bn = NULL;
|
BIGNUM *bn = NULL;
|
||||||
unsigned char out[10];
|
unsigned char out[10];
|
||||||
@@ -1133,6 +1140,9 @@ static int do_fail_all(int fullpost, int fullerr)
|
|||||||
else
|
else
|
||||||
printf("\tECDSA key generation failed as expected.\n");
|
printf("\tECDSA key generation failed as expected.\n");
|
||||||
|
|
||||||
|
FIPS_ec_key_free(ec);
|
||||||
|
ec = NULL;
|
||||||
|
|
||||||
fail_id = -1;
|
fail_id = -1;
|
||||||
fail_sub = -1;
|
fail_sub = -1;
|
||||||
fail_key = -1;
|
fail_key = -1;
|
||||||
@@ -1241,6 +1251,63 @@ static int do_fail_all(int fullpost, int fullerr)
|
|||||||
printf("\tX9.31 continuous PRNG failed as expected\n");
|
printf("\tX9.31 continuous PRNG failed as expected\n");
|
||||||
FIPS_x931_stick(0);
|
FIPS_x931_stick(0);
|
||||||
|
|
||||||
|
/* Leave FIPS mode to clear error */
|
||||||
|
FIPS_module_mode_set(0, NULL);
|
||||||
|
/* Enter FIPS mode successfully */
|
||||||
|
if (!FIPS_module_mode_set(1, FIPS_AUTH_USER_PASS))
|
||||||
|
{
|
||||||
|
printf("\tError entering FIPS mode\n");
|
||||||
|
st_err++;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(" Testing operation failure with DRBG entropy failure\n");
|
||||||
|
|
||||||
|
/* Generate DSA key for later use */
|
||||||
|
if (DSA_generate_key(dsa))
|
||||||
|
printf("\tDSA key generated OK as expected.\n");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("\tDSA key generation FAILED!!\n");
|
||||||
|
st_err++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialise default DRBG context */
|
||||||
|
defctx = FIPS_get_default_drbg();
|
||||||
|
if (!defctx)
|
||||||
|
return 0;
|
||||||
|
if (!FIPS_drbg_init(defctx, NID_sha512, 0))
|
||||||
|
return 0;
|
||||||
|
/* Set entropy failure callback */
|
||||||
|
FIPS_drbg_set_callbacks(defctx, drbg_fail_cb, 0, 0x10, drbg_test_cb, 0);
|
||||||
|
if (FIPS_drbg_instantiate(defctx, dummy_drbg_entropy, 10))
|
||||||
|
{
|
||||||
|
printf("\tDRBG entropy fail OK incorrectly!!\n");
|
||||||
|
st_err++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("\tDRBG entropy fail failed as expected\n");
|
||||||
|
|
||||||
|
if (FIPS_dsa_sign(dsa, dummy_drbg_entropy, 5, EVP_sha256()))
|
||||||
|
{
|
||||||
|
printf("\tDSA signing OK incorrectly!!\n");
|
||||||
|
st_err++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("\tDSA signing failed as expected\n");
|
||||||
|
|
||||||
|
ec = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
|
||||||
|
|
||||||
|
if (!ec)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (EC_KEY_generate_key(ec))
|
||||||
|
{
|
||||||
|
printf("\tECDSA key generated OK incorrectly!!\n");
|
||||||
|
st_err++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("\tECDSA key generation failed as expected.\n");
|
||||||
|
|
||||||
printf(" Induced failure test completed with %d errors\n", st_err);
|
printf(" Induced failure test completed with %d errors\n", st_err);
|
||||||
post_quiet = 0;
|
post_quiet = 0;
|
||||||
no_err = 0;
|
no_err = 0;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ my $to = join('/', @to_path);
|
|||||||
my $file;
|
my $file;
|
||||||
$symlink_exists=eval {symlink("",""); 1};
|
$symlink_exists=eval {symlink("",""); 1};
|
||||||
if ($^O eq "msys") { $symlink_exists=0 };
|
if ($^O eq "msys") { $symlink_exists=0 };
|
||||||
|
if ($^O eq "MSWin32") { $symlink_exists=0 };
|
||||||
foreach $file (@files) {
|
foreach $file (@files) {
|
||||||
my $err = "";
|
my $err = "";
|
||||||
if ($symlink_exists) {
|
if ($symlink_exists) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
rm -f "$2"
|
rm -f "$2"
|
||||||
if test "$OSTYPE" = msdosdjgpp || test "x$PLATFORM" = xmingw ; then
|
if test "$OSTYPE" = msdosdjgpp || test "x$PLATFORM" = xmingw || test "x$OS" = xWindows_NT ; then
|
||||||
cp "$1" "$2"
|
cp "$1" "$2"
|
||||||
else
|
else
|
||||||
ln -s "$1" "$2"
|
ln -s "$1" "$2"
|
||||||
|
|||||||
Reference in New Issue
Block a user