mirror of https://github.com/openssl/openssl
Disable afalg when engine is disabled.
Also make it possible to disable afalg separately. we still need to update config again Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
d1beebdf65
commit
c91a0a8343
12
Configure
12
Configure
|
@ -233,6 +233,7 @@ my @dtls = qw(dtls1 dtls1_2);
|
||||||
|
|
||||||
my @disablables = (
|
my @disablables = (
|
||||||
"aes",
|
"aes",
|
||||||
|
"afalgeng",
|
||||||
"asm",
|
"asm",
|
||||||
"async",
|
"async",
|
||||||
"autoalginit",
|
"autoalginit",
|
||||||
|
@ -394,6 +395,7 @@ my @disable_cascades = (
|
||||||
# Without position independent code, there can be no shared libraries or DSOs
|
# Without position independent code, there can be no shared libraries or DSOs
|
||||||
"pic" => [ "shared" ],
|
"pic" => [ "shared" ],
|
||||||
"shared" => [ "dynamic-engine" ],
|
"shared" => [ "dynamic-engine" ],
|
||||||
|
"engine" => [ "afalgeng" ],
|
||||||
);
|
);
|
||||||
|
|
||||||
# Avoid protocol support holes. Also disable all versions below N, if version
|
# Avoid protocol support holes. Also disable all versions below N, if version
|
||||||
|
@ -1193,8 +1195,8 @@ else { $no_user_defines=1; }
|
||||||
|
|
||||||
# ALL MODIFICATIONS TO %config and %target MUST BE DONE FROM HERE ON
|
# ALL MODIFICATIONS TO %config and %target MUST BE DONE FROM HERE ON
|
||||||
|
|
||||||
unless ($disabled{engine}) {
|
unless ($disabled{afalgeng}) {
|
||||||
$config{afalg}="";
|
$config{afalgeng}="";
|
||||||
if ($target =~ m/^linux/) {
|
if ($target =~ m/^linux/) {
|
||||||
my $minver = 4*10000 + 1*100 + 0;
|
my $minver = 4*10000 + 1*100 + 0;
|
||||||
if ($config{cross_compile_prefix} eq "") {
|
if ($config{cross_compile_prefix} eq "") {
|
||||||
|
@ -1203,17 +1205,17 @@ unless ($disabled{engine}) {
|
||||||
($mi2) = $mi2 =~ /(\d+)/;
|
($mi2) = $mi2 =~ /(\d+)/;
|
||||||
my $ver = $ma*10000 + $mi1*100 + $mi2;
|
my $ver = $ma*10000 + $mi1*100 + $mi2;
|
||||||
if ($ver < $minver) {
|
if ($ver < $minver) {
|
||||||
$disabled{afalg} = "too-old-kernel";
|
$disabled{afalgeng} = "too-old-kernel";
|
||||||
} else {
|
} else {
|
||||||
push @{$config{engdirs}}, "afalg";
|
push @{$config{engdirs}}, "afalg";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$disabled{afalg} = "not-linux";
|
$disabled{afalgeng} = "not-linux";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
push @{$config{openssl_other_defines}}, "OPENSSL_NO_AFALGENG" if ($disabled{afalg});
|
push @{$config{openssl_other_defines}}, "OPENSSL_NO_AFALGENG" if ($disabled{afalgeng});
|
||||||
|
|
||||||
# If we use the unified build, collect information from build.info files
|
# If we use the unified build, collect information from build.info files
|
||||||
my %unified_info = ();
|
my %unified_info = ();
|
||||||
|
|
|
@ -52,12 +52,13 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <openssl/opensslconf.h>
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_AFALGENG
|
||||||
|
#include <string.h>
|
||||||
#include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_AFALGENG
|
|
||||||
|
|
||||||
/* Use a buffer size which is not aligned to block size */
|
/* Use a buffer size which is not aligned to block size */
|
||||||
#define BUFFER_SIZE (8 * 1024) - 13
|
#define BUFFER_SIZE (8 * 1024) - 13
|
||||||
|
@ -113,14 +114,9 @@ static int test_afalg_aes_128_cbc(ENGINE *e)
|
||||||
EVP_CIPHER_CTX_free(ctx);
|
EVP_CIPHER_CTX_free(ctx);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
#ifdef OPENSSL_NO_AFALGENG
|
|
||||||
fprintf(stderr, "AFALG not supported - skipping AFALG tests\n");
|
|
||||||
#else
|
|
||||||
|
|
||||||
ENGINE *e;
|
ENGINE *e;
|
||||||
|
|
||||||
CRYPTO_set_mem_debug(1);
|
CRYPTO_set_mem_debug(1);
|
||||||
|
@ -144,7 +140,17 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
ENGINE_free(e);
|
ENGINE_free(e);
|
||||||
#endif
|
|
||||||
printf("PASS\n");
|
printf("PASS\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* OPENSSL_NO_AFALGENG */
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "AFALG not supported - skipping AFALG tests\n");
|
||||||
|
printf("PASS\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -59,7 +59,7 @@ my $test_name = "test_afalg";
|
||||||
setup($test_name);
|
setup($test_name);
|
||||||
|
|
||||||
plan skip_all => "$test_name not supported for this build"
|
plan skip_all => "$test_name not supported for this build"
|
||||||
if disabled("engine") || disabled("afalg");
|
if disabled("afalgeng");
|
||||||
|
|
||||||
plan tests => 1;
|
plan tests => 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue