Fix WIN32 build by disabling bn* calls.
The trial division and probable prime with coprime tests are disabled on WIN32 builds because they use internal functions not exported from the WIN32 DLLs. Reviewed-by: Emilia Käsper <emilia@openssl.org>
This commit is contained in:
parent
c381b63764
commit
ecb9966e7c
@ -505,8 +505,9 @@ int MAIN(int argc, char **argv)
|
|||||||
#define D_PRIME_TRIAL_DIVISION 0
|
#define D_PRIME_TRIAL_DIVISION 0
|
||||||
#define D_PRIME_TRIAL_DIVISION_RETRY 1
|
#define D_PRIME_TRIAL_DIVISION_RETRY 1
|
||||||
#define D_PRIME_COPRIME 2
|
#define D_PRIME_COPRIME 2
|
||||||
|
#ifndef OPENSSL_SYS_WIN32
|
||||||
long prime_c[PRIME_NUM];
|
long prime_c[PRIME_NUM];
|
||||||
|
#endif
|
||||||
#define R_DSA_512 0
|
#define R_DSA_512 0
|
||||||
#define R_DSA_1024 1
|
#define R_DSA_1024 1
|
||||||
#define R_DSA_2048 2
|
#define R_DSA_2048 2
|
||||||
@ -2089,7 +2090,7 @@ int MAIN(int argc, char **argv)
|
|||||||
print_result(D_EVP,j,count,d);
|
print_result(D_EVP,j,count,d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_SYS_WIN32
|
||||||
if (prime_doit[D_PRIME_TRIAL_DIVISION])
|
if (prime_doit[D_PRIME_TRIAL_DIVISION])
|
||||||
{
|
{
|
||||||
BIGNUM *rnd = BN_new();
|
BIGNUM *rnd = BN_new();
|
||||||
@ -2149,7 +2150,7 @@ int MAIN(int argc, char **argv)
|
|||||||
BN_CTX_free(ctx);
|
BN_CTX_free(ctx);
|
||||||
BN_free(rnd);
|
BN_free(rnd);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
RAND_pseudo_bytes(buf,36);
|
RAND_pseudo_bytes(buf,36);
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
for (j=0; j<RSA_NUM; j++)
|
for (j=0; j<RSA_NUM; j++)
|
||||||
|
@ -273,8 +273,12 @@ int main(int argc, char *argv[])
|
|||||||
if (!test_small_prime(out,ctx)) goto err;
|
if (!test_small_prime(out,ctx)) goto err;
|
||||||
(void)BIO_flush(out);
|
(void)BIO_flush(out);
|
||||||
|
|
||||||
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
|
message(out,"Probable prime generation with coprimes disabled");
|
||||||
|
#else
|
||||||
message(out,"Probable prime generation with coprimes");
|
message(out,"Probable prime generation with coprimes");
|
||||||
if (!test_probable_prime_coprime(out,ctx)) goto err;
|
if (!test_probable_prime_coprime(out,ctx)) goto err;
|
||||||
|
#endif
|
||||||
(void)BIO_flush(out);
|
(void)BIO_flush(out);
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_EC2M
|
#ifndef OPENSSL_NO_EC2M
|
||||||
@ -1929,7 +1933,7 @@ err:
|
|||||||
BN_clear(&r);
|
BN_clear(&r);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_SYS_WIN32
|
||||||
int test_probable_prime_coprime(BIO *bp, BN_CTX *ctx)
|
int test_probable_prime_coprime(BIO *bp, BN_CTX *ctx)
|
||||||
{
|
{
|
||||||
int i, j, ret = 0;
|
int i, j, ret = 0;
|
||||||
@ -1960,7 +1964,7 @@ err:
|
|||||||
BN_clear(&r);
|
BN_clear(&r);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
int test_lshift(BIO *bp,BN_CTX *ctx,BIGNUM *a_)
|
int test_lshift(BIO *bp,BN_CTX *ctx,BIGNUM *a_)
|
||||||
{
|
{
|
||||||
BIGNUM *a,*b,*c,*d;
|
BIGNUM *a,*b,*c,*d;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user