Debian Codegraph @

m4/acx_botan_gost.m4

raw
1 AC_DEFUN([ACX_BOTAN_GOST],[
2 AC_MSG_CHECKING(for Botan GOST support)
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 AC_CACHE_VAL([acx_cv_lib_botan_gost_support],[
12 acx_cv_lib_botan_gost_support=no
13 AC_RUN_IFELSE([
14 AC_LANG_SOURCE([[
15 #include <botan/gost_3410.h>
16 #include <botan/oids.h>
17 #include <botan/version.h>
18 int main()
19 {
20 const std::string name("gost_256A");
21 const Botan::OID oid(Botan::OIDS::lookup(name));
22 const Botan::EC_Group ecg(oid);
23 try {
24 const std::vector<Botan::byte> der =
25 ecg.DER_encode(Botan::EC_DOMPAR_ENC_OID);
26 } catch(...) {
27 return 1;
28 }
29
30 return 0;
31 }
32 ]])
33 ],[
34 AC_MSG_RESULT([Found GOST])
35 acx_cv_lib_botan_gost_support=yes
36 ],[
37 AC_MSG_RESULT([Cannot find GOST])
38 acx_cv_lib_botan_gost_support=no
39 ],[
40 AC_MSG_WARN([Cannot test, assuming GOST])
41 acx_cv_lib_botan_gost_support=yes
42 ])
43 ])
44 AC_LANG_POP([C++])
45
46 CPPFLAGS=$tmp_CPPFLAGS
47 LIBS=$tmp_LIBS
48 have_lib_botan_gost_support="${acx_cv_lib_botan_gost_support}"
49 ])