aboutsummaryrefslogtreecommitdiffstats
path: root/engines
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-06-01 23:15:12 +0100
committerMatt Caswell <matt@openssl.org>2016-06-13 17:28:40 +0100
commit25b9d11c002e5c71840c2a6733c5009d78f2c9db (patch)
tree58aa1f4eb04a77bdeb321d37b1a0bd5ae1067ee2 /engines
parent74726750ef041ba5fdf0516cbd060a202f7092c1 (diff)
downloadopenssl-25b9d11c002e5c71840c2a6733c5009d78f2c9db.tar.gz
Handle inability to create AFALG socket
Some Linux platforms have a suitably recent kernel to support AFALG, but apparently you still can't actually create an afalg socket. This extends the afalg_chk_platform() function to additionally check whether we can create an AFALG socket. We also amend the afalgtest to not report a failure to load the engine as a test failure. A failure to load is almost certainly due to platform environmental issues, and not an OpenSSL problem. RT 4434 Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'engines')
-rw-r--r--engines/afalg/e_afalg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/afalg/e_afalg.c b/engines/afalg/e_afalg.c
index 2d6fa58b9f..2e7ce3455a 100644
--- a/engines/afalg/e_afalg.c
+++ b/engines/afalg/e_afalg.c
@@ -731,6 +731,7 @@ static int afalg_chk_platform(void)
int ret;
int i;
int kver[3] = { -1, -1, -1 };
+ int sock;
char *str;
struct utsname ut;
@@ -758,6 +759,14 @@ static int afalg_chk_platform(void)
return 0;
}
+ /* Test if we can actually create an AF_ALG socket */
+ sock = socket(AF_ALG, SOCK_SEQPACKET, 0);
+ if (sock == -1) {
+ AFALGerr(AFALG_F_AFALG_CHK_PLATFORM, AFALG_R_SOCKET_CREATE_FAILED);
+ return 0;
+ }
+ close(sock);
+
return 1;
}