blob: c68a336b139d0fc6f060af7e83c90a8a569d93ad [file] [log] [blame]
NingSun0c89b3c2018-02-08 08:34:03 -08001AC_DEFUN([ACX_OPENSSL_EVPAESWRAP],[
2 AC_MSG_CHECKING(OpenSSL EVP interface for AES key wrapping)
3
4 tmp_CPPFLAGS=$CPPFLAGS
5 tmp_LIBS=$LIBS
6
7 CPPFLAGS="$CPPFLAGS $CRYPTO_INCLUDES"
8 LIBS="$CRYPTO_LIBS $LIBS"
9
10 AC_LANG_PUSH([C])
11
12 AC_LINK_IFELSE([
13 AC_LANG_SOURCE([[
14 #include <openssl/evp.h>
15 int main()
16 {
17 EVP_aes_128_wrap();
18 return 1;
19 }
20 ]])
21 ],[
22 AC_MSG_RESULT([RFC 3394 is supported])
23 AC_DEFINE([HAVE_AES_KEY_WRAP], [1],
24 [Define if advanced AES key wrap without pad is supported in EVP interface])
25 ],[
26 AC_MSG_RESULT([RFC 3394 is not supported])
27 ])
28
29 AC_MSG_CHECKING(OpenSSL EVP interface for AES key wrapping with pad)
30 AC_LINK_IFELSE([
31 AC_LANG_SOURCE([[
32 #include <openssl/evp.h>
33 int main()
34 {
35 EVP_aes_128_wrap_pad();
36 return 1;
37 }
38 ]])
39 ],[
40 AC_MSG_RESULT([RFC 5649 is supported])
41 AC_DEFINE([HAVE_AES_KEY_WRAP_PAD], [1],
42 [Define if advanced AES key wrap with pad is supported in EVP interface])
43 ],[
44 AC_MSG_RESULT([RFC 5649 is not supported])
45 ])
46
47 AC_LANG_POP([C])
48
49 CPPFLAGS=$tmp_CPPFLAGS
50 LIBS=$tmp_LIBS
51])