Browse code
Replace CryptoPP with OpenSSL
Ed Langley authored on 30/05/2017 21:19:11
Showing 7 changed files
Showing 7 changed files
... | ... |
@@ -197,8 +197,7 @@ test -x / || exit 1" |
197 | 197 |
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO |
198 | 198 |
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO |
199 | 199 |
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && |
200 |
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 |
|
201 |
-test \$(( 1 + 1 )) = 2 || exit 1" |
|
200 |
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" |
|
202 | 201 |
if (eval "$as_required") 2>/dev/null; then : |
203 | 202 |
as_have_required=yes |
204 | 203 |
else |
... | ... |
@@ -586,51 +585,8 @@ PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS' |
586 | 585 |
PACKAGE_URL='' |
587 | 586 |
|
588 | 587 |
ac_unique_file="config.h.in" |
589 |
-# Factoring default headers for most tests. |
|
590 |
-ac_includes_default="\ |
|
591 |
-#include <stdio.h> |
|
592 |
-#ifdef HAVE_SYS_TYPES_H |
|
593 |
-# include <sys/types.h> |
|
594 |
-#endif |
|
595 |
-#ifdef HAVE_SYS_STAT_H |
|
596 |
-# include <sys/stat.h> |
|
597 |
-#endif |
|
598 |
-#ifdef STDC_HEADERS |
|
599 |
-# include <stdlib.h> |
|
600 |
-# include <stddef.h> |
|
601 |
-#else |
|
602 |
-# ifdef HAVE_STDLIB_H |
|
603 |
-# include <stdlib.h> |
|
604 |
-# endif |
|
605 |
-#endif |
|
606 |
-#ifdef HAVE_STRING_H |
|
607 |
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H |
|
608 |
-# include <memory.h> |
|
609 |
-# endif |
|
610 |
-# include <string.h> |
|
611 |
-#endif |
|
612 |
-#ifdef HAVE_STRINGS_H |
|
613 |
-# include <strings.h> |
|
614 |
-#endif |
|
615 |
-#ifdef HAVE_INTTYPES_H |
|
616 |
-# include <inttypes.h> |
|
617 |
-#endif |
|
618 |
-#ifdef HAVE_STDINT_H |
|
619 |
-# include <stdint.h> |
|
620 |
-#endif |
|
621 |
-#ifdef HAVE_UNISTD_H |
|
622 |
-# include <unistd.h> |
|
623 |
-#endif" |
|
624 |
- |
|
625 | 588 |
ac_subst_vars='LTLIBOBJS |
626 | 589 |
LIBOBJS |
627 |
-CRYPTOPP_NAME |
|
628 |
-EGREP |
|
629 |
-GREP |
|
630 |
-CXXCPP |
|
631 |
-ac_ct_CXX |
|
632 |
-CXXFLAGS |
|
633 |
-CXX |
|
634 | 590 |
PAM_MODULE_DIRECTORY |
635 | 591 |
OBJEXT |
636 | 592 |
EXEEXT |
... | ... |
@@ -690,11 +646,7 @@ CC |
690 | 646 |
CFLAGS |
691 | 647 |
LDFLAGS |
692 | 648 |
LIBS |
693 |
-CPPFLAGS |
|
694 |
-CXX |
|
695 |
-CXXFLAGS |
|
696 |
-CCC |
|
697 |
-CXXCPP' |
|
649 |
+CPPFLAGS' |
|
698 | 650 |
|
699 | 651 |
|
700 | 652 |
# Initialize some variables set by options. |
... | ... |
@@ -1316,9 +1268,6 @@ Some influential environment variables: |
1316 | 1268 |
LIBS libraries to pass to the linker, e.g. -l<library> |
1317 | 1269 |
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if |
1318 | 1270 |
you have headers in a nonstandard directory <include dir> |
1319 |
- CXX C++ compiler command |
|
1320 |
- CXXFLAGS C++ compiler flags |
|
1321 |
- CXXCPP C++ preprocessor |
|
1322 | 1271 |
|
1323 | 1272 |
Use these variables to override the choices made by `configure' or to help |
1324 | 1273 |
it to find libraries and programs with nonstandard names/locations. |
... | ... |
@@ -1437,245 +1386,6 @@ fi |
1437 | 1386 |
as_fn_set_status $ac_retval |
1438 | 1387 |
|
1439 | 1388 |
} # ac_fn_c_try_compile |
1440 |
- |
|
1441 |
-# ac_fn_cxx_try_compile LINENO |
|
1442 |
-# ---------------------------- |
|
1443 |
-# Try to compile conftest.$ac_ext, and return whether this succeeded. |
|
1444 |
-ac_fn_cxx_try_compile () |
|
1445 |
-{ |
|
1446 |
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
|
1447 |
- rm -f conftest.$ac_objext |
|
1448 |
- if { { ac_try="$ac_compile" |
|
1449 |
-case "(($ac_try" in |
|
1450 |
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
|
1451 |
- *) ac_try_echo=$ac_try;; |
|
1452 |
-esac |
|
1453 |
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" |
|
1454 |
-$as_echo "$ac_try_echo"; } >&5 |
|
1455 |
- (eval "$ac_compile") 2>conftest.err |
|
1456 |
- ac_status=$? |
|
1457 |
- if test -s conftest.err; then |
|
1458 |
- grep -v '^ *+' conftest.err >conftest.er1 |
|
1459 |
- cat conftest.er1 >&5 |
|
1460 |
- mv -f conftest.er1 conftest.err |
|
1461 |
- fi |
|
1462 |
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
|
1463 |
- test $ac_status = 0; } && { |
|
1464 |
- test -z "$ac_cxx_werror_flag" || |
|
1465 |
- test ! -s conftest.err |
|
1466 |
- } && test -s conftest.$ac_objext; then : |
|
1467 |
- ac_retval=0 |
|
1468 |
-else |
|
1469 |
- $as_echo "$as_me: failed program was:" >&5 |
|
1470 |
-sed 's/^/| /' conftest.$ac_ext >&5 |
|
1471 |
- |
|
1472 |
- ac_retval=1 |
|
1473 |
-fi |
|
1474 |
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
|
1475 |
- as_fn_set_status $ac_retval |
|
1476 |
- |
|
1477 |
-} # ac_fn_cxx_try_compile |
|
1478 |
- |
|
1479 |
-# ac_fn_cxx_try_cpp LINENO |
|
1480 |
-# ------------------------ |
|
1481 |
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded. |
|
1482 |
-ac_fn_cxx_try_cpp () |
|
1483 |
-{ |
|
1484 |
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
|
1485 |
- if { { ac_try="$ac_cpp conftest.$ac_ext" |
|
1486 |
-case "(($ac_try" in |
|
1487 |
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
|
1488 |
- *) ac_try_echo=$ac_try;; |
|
1489 |
-esac |
|
1490 |
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" |
|
1491 |
-$as_echo "$ac_try_echo"; } >&5 |
|
1492 |
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err |
|
1493 |
- ac_status=$? |
|
1494 |
- if test -s conftest.err; then |
|
1495 |
- grep -v '^ *+' conftest.err >conftest.er1 |
|
1496 |
- cat conftest.er1 >&5 |
|
1497 |
- mv -f conftest.er1 conftest.err |
|
1498 |
- fi |
|
1499 |
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
|
1500 |
- test $ac_status = 0; } > conftest.i && { |
|
1501 |
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || |
|
1502 |
- test ! -s conftest.err |
|
1503 |
- }; then : |
|
1504 |
- ac_retval=0 |
|
1505 |
-else |
|
1506 |
- $as_echo "$as_me: failed program was:" >&5 |
|
1507 |
-sed 's/^/| /' conftest.$ac_ext >&5 |
|
1508 |
- |
|
1509 |
- ac_retval=1 |
|
1510 |
-fi |
|
1511 |
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
|
1512 |
- as_fn_set_status $ac_retval |
|
1513 |
- |
|
1514 |
-} # ac_fn_cxx_try_cpp |
|
1515 |
- |
|
1516 |
-# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES |
|
1517 |
-# --------------------------------------------------------- |
|
1518 |
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using |
|
1519 |
-# the include files in INCLUDES and setting the cache variable VAR |
|
1520 |
-# accordingly. |
|
1521 |
-ac_fn_cxx_check_header_mongrel () |
|
1522 |
-{ |
|
1523 |
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
|
1524 |
- if eval \${$3+:} false; then : |
|
1525 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
|
1526 |
-$as_echo_n "checking for $2... " >&6; } |
|
1527 |
-if eval \${$3+:} false; then : |
|
1528 |
- $as_echo_n "(cached) " >&6 |
|
1529 |
-fi |
|
1530 |
-eval ac_res=\$$3 |
|
1531 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
|
1532 |
-$as_echo "$ac_res" >&6; } |
|
1533 |
-else |
|
1534 |
- # Is the header compilable? |
|
1535 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 |
|
1536 |
-$as_echo_n "checking $2 usability... " >&6; } |
|
1537 |
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
1538 |
-/* end confdefs.h. */ |
|
1539 |
-$4 |
|
1540 |
-#include <$2> |
|
1541 |
-_ACEOF |
|
1542 |
-if ac_fn_cxx_try_compile "$LINENO"; then : |
|
1543 |
- ac_header_compiler=yes |
|
1544 |
-else |
|
1545 |
- ac_header_compiler=no |
|
1546 |
-fi |
|
1547 |
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
|
1548 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 |
|
1549 |
-$as_echo "$ac_header_compiler" >&6; } |
|
1550 |
- |
|
1551 |
-# Is the header present? |
|
1552 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 |
|
1553 |
-$as_echo_n "checking $2 presence... " >&6; } |
|
1554 |
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
1555 |
-/* end confdefs.h. */ |
|
1556 |
-#include <$2> |
|
1557 |
-_ACEOF |
|
1558 |
-if ac_fn_cxx_try_cpp "$LINENO"; then : |
|
1559 |
- ac_header_preproc=yes |
|
1560 |
-else |
|
1561 |
- ac_header_preproc=no |
|
1562 |
-fi |
|
1563 |
-rm -f conftest.err conftest.i conftest.$ac_ext |
|
1564 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 |
|
1565 |
-$as_echo "$ac_header_preproc" >&6; } |
|
1566 |
- |
|
1567 |
-# So? What about this header? |
|
1568 |
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( |
|
1569 |
- yes:no: ) |
|
1570 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 |
|
1571 |
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} |
|
1572 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 |
|
1573 |
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} |
|
1574 |
- ;; |
|
1575 |
- no:yes:* ) |
|
1576 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 |
|
1577 |
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} |
|
1578 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 |
|
1579 |
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} |
|
1580 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 |
|
1581 |
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} |
|
1582 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 |
|
1583 |
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} |
|
1584 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 |
|
1585 |
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} |
|
1586 |
-( $as_echo "## --------------------------------- ## |
|
1587 |
-## Report this to BUG-REPORT-ADDRESS ## |
|
1588 |
-## --------------------------------- ##" |
|
1589 |
- ) | sed "s/^/$as_me: WARNING: /" >&2 |
|
1590 |
- ;; |
|
1591 |
-esac |
|
1592 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
|
1593 |
-$as_echo_n "checking for $2... " >&6; } |
|
1594 |
-if eval \${$3+:} false; then : |
|
1595 |
- $as_echo_n "(cached) " >&6 |
|
1596 |
-else |
|
1597 |
- eval "$3=\$ac_header_compiler" |
|
1598 |
-fi |
|
1599 |
-eval ac_res=\$$3 |
|
1600 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
|
1601 |
-$as_echo "$ac_res" >&6; } |
|
1602 |
-fi |
|
1603 |
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
|
1604 |
- |
|
1605 |
-} # ac_fn_cxx_check_header_mongrel |
|
1606 |
- |
|
1607 |
-# ac_fn_cxx_try_run LINENO |
|
1608 |
-# ------------------------ |
|
1609 |
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes |
|
1610 |
-# that executables *can* be run. |
|
1611 |
-ac_fn_cxx_try_run () |
|
1612 |
-{ |
|
1613 |
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
|
1614 |
- if { { ac_try="$ac_link" |
|
1615 |
-case "(($ac_try" in |
|
1616 |
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
|
1617 |
- *) ac_try_echo=$ac_try;; |
|
1618 |
-esac |
|
1619 |
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" |
|
1620 |
-$as_echo "$ac_try_echo"; } >&5 |
|
1621 |
- (eval "$ac_link") 2>&5 |
|
1622 |
- ac_status=$? |
|
1623 |
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
|
1624 |
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' |
|
1625 |
- { { case "(($ac_try" in |
|
1626 |
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
|
1627 |
- *) ac_try_echo=$ac_try;; |
|
1628 |
-esac |
|
1629 |
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" |
|
1630 |
-$as_echo "$ac_try_echo"; } >&5 |
|
1631 |
- (eval "$ac_try") 2>&5 |
|
1632 |
- ac_status=$? |
|
1633 |
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
|
1634 |
- test $ac_status = 0; }; }; then : |
|
1635 |
- ac_retval=0 |
|
1636 |
-else |
|
1637 |
- $as_echo "$as_me: program exited with status $ac_status" >&5 |
|
1638 |
- $as_echo "$as_me: failed program was:" >&5 |
|
1639 |
-sed 's/^/| /' conftest.$ac_ext >&5 |
|
1640 |
- |
|
1641 |
- ac_retval=$ac_status |
|
1642 |
-fi |
|
1643 |
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo |
|
1644 |
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
|
1645 |
- as_fn_set_status $ac_retval |
|
1646 |
- |
|
1647 |
-} # ac_fn_cxx_try_run |
|
1648 |
- |
|
1649 |
-# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES |
|
1650 |
-# --------------------------------------------------------- |
|
1651 |
-# Tests whether HEADER exists and can be compiled using the include files in |
|
1652 |
-# INCLUDES, setting the cache variable VAR accordingly. |
|
1653 |
-ac_fn_cxx_check_header_compile () |
|
1654 |
-{ |
|
1655 |
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
|
1656 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
|
1657 |
-$as_echo_n "checking for $2... " >&6; } |
|
1658 |
-if eval \${$3+:} false; then : |
|
1659 |
- $as_echo_n "(cached) " >&6 |
|
1660 |
-else |
|
1661 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
1662 |
-/* end confdefs.h. */ |
|
1663 |
-$4 |
|
1664 |
-#include <$2> |
|
1665 |
-_ACEOF |
|
1666 |
-if ac_fn_cxx_try_compile "$LINENO"; then : |
|
1667 |
- eval "$3=yes" |
|
1668 |
-else |
|
1669 |
- eval "$3=no" |
|
1670 |
-fi |
|
1671 |
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
|
1672 |
-fi |
|
1673 |
-eval ac_res=\$$3 |
|
1674 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
|
1675 |
-$as_echo "$ac_res" >&6; } |
|
1676 |
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
|
1677 |
- |
|
1678 |
-} # ac_fn_cxx_check_header_compile |
|
1679 | 1389 |
cat >config.log <<_ACEOF |
1680 | 1390 |
This file contains any messages produced by compilers while |
1681 | 1391 |
running configure, to aid debugging if configure makes a mistake. |
... | ... |
@@ -2854,713 +2564,6 @@ fi |
2854 | 2564 |
|
2855 | 2565 |
|
2856 | 2566 |
#and check crypto++ |
2857 |
-if test "$WITH_CRYPTOPP" = "yes"; then |
|
2858 |
- #crypto++ headers are either in include/crypto++ or include/cryptopp, |
|
2859 |
- #the information is otherwise unavailable from standard configuration |
|
2860 |
- #means. Please report/add more tests if you encounter distros that |
|
2861 |
- #place them elsewhere. |
|
2862 |
- ac_ext=cpp |
|
2863 |
-ac_cpp='$CXXCPP $CPPFLAGS' |
|
2864 |
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' |
|
2865 |
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
|
2866 |
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu |
|
2867 |
- |
|
2868 |
- ac_ext=cpp |
|
2869 |
-ac_cpp='$CXXCPP $CPPFLAGS' |
|
2870 |
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' |
|
2871 |
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
|
2872 |
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu |
|
2873 |
-if test -z "$CXX"; then |
|
2874 |
- if test -n "$CCC"; then |
|
2875 |
- CXX=$CCC |
|
2876 |
- else |
|
2877 |
- if test -n "$ac_tool_prefix"; then |
|
2878 |
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC |
|
2879 |
- do |
|
2880 |
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. |
|
2881 |
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2 |
|
2882 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
|
2883 |
-$as_echo_n "checking for $ac_word... " >&6; } |
|
2884 |
-if ${ac_cv_prog_CXX+:} false; then : |
|
2885 |
- $as_echo_n "(cached) " >&6 |
|
2886 |
-else |
|
2887 |
- if test -n "$CXX"; then |
|
2888 |
- ac_cv_prog_CXX="$CXX" # Let the user override the test. |
|
2889 |
-else |
|
2890 |
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
|
2891 |
-for as_dir in $PATH |
|
2892 |
-do |
|
2893 |
- IFS=$as_save_IFS |
|
2894 |
- test -z "$as_dir" && as_dir=. |
|
2895 |
- for ac_exec_ext in '' $ac_executable_extensions; do |
|
2896 |
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
|
2897 |
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" |
|
2898 |
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 |
|
2899 |
- break 2 |
|
2900 |
- fi |
|
2901 |
-done |
|
2902 |
- done |
|
2903 |
-IFS=$as_save_IFS |
|
2904 |
- |
|
2905 |
-fi |
|
2906 |
-fi |
|
2907 |
-CXX=$ac_cv_prog_CXX |
|
2908 |
-if test -n "$CXX"; then |
|
2909 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 |
|
2910 |
-$as_echo "$CXX" >&6; } |
|
2911 |
-else |
|
2912 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
|
2913 |
-$as_echo "no" >&6; } |
|
2914 |
-fi |
|
2915 |
- |
|
2916 |
- |
|
2917 |
- test -n "$CXX" && break |
|
2918 |
- done |
|
2919 |
-fi |
|
2920 |
-if test -z "$CXX"; then |
|
2921 |
- ac_ct_CXX=$CXX |
|
2922 |
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC |
|
2923 |
-do |
|
2924 |
- # Extract the first word of "$ac_prog", so it can be a program name with args. |
|
2925 |
-set dummy $ac_prog; ac_word=$2 |
|
2926 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
|
2927 |
-$as_echo_n "checking for $ac_word... " >&6; } |
|
2928 |
-if ${ac_cv_prog_ac_ct_CXX+:} false; then : |
|
2929 |
- $as_echo_n "(cached) " >&6 |
|
2930 |
-else |
|
2931 |
- if test -n "$ac_ct_CXX"; then |
|
2932 |
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. |
|
2933 |
-else |
|
2934 |
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
|
2935 |
-for as_dir in $PATH |
|
2936 |
-do |
|
2937 |
- IFS=$as_save_IFS |
|
2938 |
- test -z "$as_dir" && as_dir=. |
|
2939 |
- for ac_exec_ext in '' $ac_executable_extensions; do |
|
2940 |
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
|
2941 |
- ac_cv_prog_ac_ct_CXX="$ac_prog" |
|
2942 |
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 |
|
2943 |
- break 2 |
|
2944 |
- fi |
|
2945 |
-done |
|
2946 |
- done |
|
2947 |
-IFS=$as_save_IFS |
|
2948 |
- |
|
2949 |
-fi |
|
2950 |
-fi |
|
2951 |
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX |
|
2952 |
-if test -n "$ac_ct_CXX"; then |
|
2953 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 |
|
2954 |
-$as_echo "$ac_ct_CXX" >&6; } |
|
2955 |
-else |
|
2956 |
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
|
2957 |
-$as_echo "no" >&6; } |
|
2958 |
-fi |
|
2959 |
- |
|
2960 |
- |
|
2961 |
- test -n "$ac_ct_CXX" && break |
|
2962 |
-done |
|
2963 |
- |
|
2964 |
- if test "x$ac_ct_CXX" = x; then |
|
2965 |
- CXX="g++" |
|
2966 |
- else |
|
2967 |
- case $cross_compiling:$ac_tool_warned in |
|
2968 |
-yes:) |
|
2969 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 |
|
2970 |
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} |
|
2971 |
-ac_tool_warned=yes ;; |
|
2972 |
-esac |
|
2973 |
- CXX=$ac_ct_CXX |
|
2974 |
- fi |
|
2975 |
-fi |
|
2976 |
- |
|
2977 |
- fi |
|
2978 |
-fi |
|
2979 |
-# Provide some information about the compiler. |
|
2980 |
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 |
|
2981 |
-set X $ac_compile |
|
2982 |
-ac_compiler=$2 |
|
2983 |
-for ac_option in --version -v -V -qversion; do |
|
2984 |
- { { ac_try="$ac_compiler $ac_option >&5" |
|
2985 |
-case "(($ac_try" in |
|
2986 |
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
|
2987 |
- *) ac_try_echo=$ac_try;; |
|
2988 |
-esac |
|
2989 |
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" |
|
2990 |
-$as_echo "$ac_try_echo"; } >&5 |
|
2991 |
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err |
|
2992 |
- ac_status=$? |
|
2993 |
- if test -s conftest.err; then |
|
2994 |
- sed '10a\ |
|
2995 |
-... rest of stderr output deleted ... |
|
2996 |
- 10q' conftest.err >conftest.er1 |
|
2997 |
- cat conftest.er1 >&5 |
|
2998 |
- fi |
|
2999 |
- rm -f conftest.er1 conftest.err |
|
3000 |
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
|
3001 |
- test $ac_status = 0; } |
|
3002 |
-done |
|
3003 |
- |
|
3004 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 |
|
3005 |
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } |
|
3006 |
-if ${ac_cv_cxx_compiler_gnu+:} false; then : |
|
3007 |
- $as_echo_n "(cached) " >&6 |
|
3008 |
-else |
|
3009 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3010 |
-/* end confdefs.h. */ |
|
3011 |
- |
|
3012 |
-int |
|
3013 |
-main () |
|
3014 |
-{ |
|
3015 |
-#ifndef __GNUC__ |
|
3016 |
- choke me |
|
3017 |
-#endif |
|
3018 |
- |
|
3019 |
- ; |
|
3020 |
- return 0; |
|
3021 |
-} |
|
3022 |
-_ACEOF |
|
3023 |
-if ac_fn_cxx_try_compile "$LINENO"; then : |
|
3024 |
- ac_compiler_gnu=yes |
|
3025 |
-else |
|
3026 |
- ac_compiler_gnu=no |
|
3027 |
-fi |
|
3028 |
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
|
3029 |
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu |
|
3030 |
- |
|
3031 |
-fi |
|
3032 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 |
|
3033 |
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } |
|
3034 |
-if test $ac_compiler_gnu = yes; then |
|
3035 |
- GXX=yes |
|
3036 |
-else |
|
3037 |
- GXX= |
|
3038 |
-fi |
|
3039 |
-ac_test_CXXFLAGS=${CXXFLAGS+set} |
|
3040 |
-ac_save_CXXFLAGS=$CXXFLAGS |
|
3041 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 |
|
3042 |
-$as_echo_n "checking whether $CXX accepts -g... " >&6; } |
|
3043 |
-if ${ac_cv_prog_cxx_g+:} false; then : |
|
3044 |
- $as_echo_n "(cached) " >&6 |
|
3045 |
-else |
|
3046 |
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag |
|
3047 |
- ac_cxx_werror_flag=yes |
|
3048 |
- ac_cv_prog_cxx_g=no |
|
3049 |
- CXXFLAGS="-g" |
|
3050 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3051 |
-/* end confdefs.h. */ |
|
3052 |
- |
|
3053 |
-int |
|
3054 |
-main () |
|
3055 |
-{ |
|
3056 |
- |
|
3057 |
- ; |
|
3058 |
- return 0; |
|
3059 |
-} |
|
3060 |
-_ACEOF |
|
3061 |
-if ac_fn_cxx_try_compile "$LINENO"; then : |
|
3062 |
- ac_cv_prog_cxx_g=yes |
|
3063 |
-else |
|
3064 |
- CXXFLAGS="" |
|
3065 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3066 |
-/* end confdefs.h. */ |
|
3067 |
- |
|
3068 |
-int |
|
3069 |
-main () |
|
3070 |
-{ |
|
3071 |
- |
|
3072 |
- ; |
|
3073 |
- return 0; |
|
3074 |
-} |
|
3075 |
-_ACEOF |
|
3076 |
-if ac_fn_cxx_try_compile "$LINENO"; then : |
|
3077 |
- |
|
3078 |
-else |
|
3079 |
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag |
|
3080 |
- CXXFLAGS="-g" |
|
3081 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3082 |
-/* end confdefs.h. */ |
|
3083 |
- |
|
3084 |
-int |
|
3085 |
-main () |
|
3086 |
-{ |
|
3087 |
- |
|
3088 |
- ; |
|
3089 |
- return 0; |
|
3090 |
-} |
|
3091 |
-_ACEOF |
|
3092 |
-if ac_fn_cxx_try_compile "$LINENO"; then : |
|
3093 |
- ac_cv_prog_cxx_g=yes |
|
3094 |
-fi |
|
3095 |
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
|
3096 |
-fi |
|
3097 |
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
|
3098 |
-fi |
|
3099 |
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
|
3100 |
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag |
|
3101 |
-fi |
|
3102 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 |
|
3103 |
-$as_echo "$ac_cv_prog_cxx_g" >&6; } |
|
3104 |
-if test "$ac_test_CXXFLAGS" = set; then |
|
3105 |
- CXXFLAGS=$ac_save_CXXFLAGS |
|
3106 |
-elif test $ac_cv_prog_cxx_g = yes; then |
|
3107 |
- if test "$GXX" = yes; then |
|
3108 |
- CXXFLAGS="-g -O2" |
|
3109 |
- else |
|
3110 |
- CXXFLAGS="-g" |
|
3111 |
- fi |
|
3112 |
-else |
|
3113 |
- if test "$GXX" = yes; then |
|
3114 |
- CXXFLAGS="-O2" |
|
3115 |
- else |
|
3116 |
- CXXFLAGS= |
|
3117 |
- fi |
|
3118 |
-fi |
|
3119 |
-ac_ext=cpp |
|
3120 |
-ac_cpp='$CXXCPP $CPPFLAGS' |
|
3121 |
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' |
|
3122 |
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
|
3123 |
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu |
|
3124 |
- |
|
3125 |
- |
|
3126 |
-ac_ext=cpp |
|
3127 |
-ac_cpp='$CXXCPP $CPPFLAGS' |
|
3128 |
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' |
|
3129 |
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
|
3130 |
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu |
|
3131 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 |
|
3132 |
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; } |
|
3133 |
-if test -z "$CXXCPP"; then |
|
3134 |
- if ${ac_cv_prog_CXXCPP+:} false; then : |
|
3135 |
- $as_echo_n "(cached) " >&6 |
|
3136 |
-else |
|
3137 |
- # Double quotes because CXXCPP needs to be expanded |
|
3138 |
- for CXXCPP in "$CXX -E" "/lib/cpp" |
|
3139 |
- do |
|
3140 |
- ac_preproc_ok=false |
|
3141 |
-for ac_cxx_preproc_warn_flag in '' yes |
|
3142 |
-do |
|
3143 |
- # Use a header file that comes with gcc, so configuring glibc |
|
3144 |
- # with a fresh cross-compiler works. |
|
3145 |
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since |
|
3146 |
- # <limits.h> exists even on freestanding compilers. |
|
3147 |
- # On the NeXT, cc -E runs the code through the compiler's parser, |
|
3148 |
- # not just through cpp. "Syntax error" is here to catch this case. |
|
3149 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3150 |
-/* end confdefs.h. */ |
|
3151 |
-#ifdef __STDC__ |
|
3152 |
-# include <limits.h> |
|
3153 |
-#else |
|
3154 |
-# include <assert.h> |
|
3155 |
-#endif |
|
3156 |
- Syntax error |
|
3157 |
-_ACEOF |
|
3158 |
-if ac_fn_cxx_try_cpp "$LINENO"; then : |
|
3159 |
- |
|
3160 |
-else |
|
3161 |
- # Broken: fails on valid input. |
|
3162 |
-continue |
|
3163 |
-fi |
|
3164 |
-rm -f conftest.err conftest.i conftest.$ac_ext |
|
3165 |
- |
|
3166 |
- # OK, works on sane cases. Now check whether nonexistent headers |
|
3167 |
- # can be detected and how. |
|
3168 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3169 |
-/* end confdefs.h. */ |
|
3170 |
-#include <ac_nonexistent.h> |
|
3171 |
-_ACEOF |
|
3172 |
-if ac_fn_cxx_try_cpp "$LINENO"; then : |
|
3173 |
- # Broken: success on invalid input. |
|
3174 |
-continue |
|
3175 |
-else |
|
3176 |
- # Passes both tests. |
|
3177 |
-ac_preproc_ok=: |
|
3178 |
-break |
|
3179 |
-fi |
|
3180 |
-rm -f conftest.err conftest.i conftest.$ac_ext |
|
3181 |
- |
|
3182 |
-done |
|
3183 |
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. |
|
3184 |
-rm -f conftest.i conftest.err conftest.$ac_ext |
|
3185 |
-if $ac_preproc_ok; then : |
|
3186 |
- break |
|
3187 |
-fi |
|
3188 |
- |
|
3189 |
- done |
|
3190 |
- ac_cv_prog_CXXCPP=$CXXCPP |
|
3191 |
- |
|
3192 |
-fi |
|
3193 |
- CXXCPP=$ac_cv_prog_CXXCPP |
|
3194 |
-else |
|
3195 |
- ac_cv_prog_CXXCPP=$CXXCPP |
|
3196 |
-fi |
|
3197 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 |
|
3198 |
-$as_echo "$CXXCPP" >&6; } |
|
3199 |
-ac_preproc_ok=false |
|
3200 |
-for ac_cxx_preproc_warn_flag in '' yes |
|
3201 |
-do |
|
3202 |
- # Use a header file that comes with gcc, so configuring glibc |
|
3203 |
- # with a fresh cross-compiler works. |
|
3204 |
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since |
|
3205 |
- # <limits.h> exists even on freestanding compilers. |
|
3206 |
- # On the NeXT, cc -E runs the code through the compiler's parser, |
|
3207 |
- # not just through cpp. "Syntax error" is here to catch this case. |
|
3208 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3209 |
-/* end confdefs.h. */ |
|
3210 |
-#ifdef __STDC__ |
|
3211 |
-# include <limits.h> |
|
3212 |
-#else |
|
3213 |
-# include <assert.h> |
|
3214 |
-#endif |
|
3215 |
- Syntax error |
|
3216 |
-_ACEOF |
|
3217 |
-if ac_fn_cxx_try_cpp "$LINENO"; then : |
|
3218 |
- |
|
3219 |
-else |
|
3220 |
- # Broken: fails on valid input. |
|
3221 |
-continue |
|
3222 |
-fi |
|
3223 |
-rm -f conftest.err conftest.i conftest.$ac_ext |
|
3224 |
- |
|
3225 |
- # OK, works on sane cases. Now check whether nonexistent headers |
|
3226 |
- # can be detected and how. |
|
3227 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3228 |
-/* end confdefs.h. */ |
|
3229 |
-#include <ac_nonexistent.h> |
|
3230 |
-_ACEOF |
|
3231 |
-if ac_fn_cxx_try_cpp "$LINENO"; then : |
|
3232 |
- # Broken: success on invalid input. |
|
3233 |
-continue |
|
3234 |
-else |
|
3235 |
- # Passes both tests. |
|
3236 |
-ac_preproc_ok=: |
|
3237 |
-break |
|
3238 |
-fi |
|
3239 |
-rm -f conftest.err conftest.i conftest.$ac_ext |
|
3240 |
- |
|
3241 |
-done |
|
3242 |
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. |
|
3243 |
-rm -f conftest.i conftest.err conftest.$ac_ext |
|
3244 |
-if $ac_preproc_ok; then : |
|
3245 |
- |
|
3246 |
-else |
|
3247 |
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
|
3248 |
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
|
3249 |
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check |
|
3250 |
-See \`config.log' for more details" "$LINENO" 5; } |
|
3251 |
-fi |
|
3252 |
- |
|
3253 |
-ac_ext=cpp |
|
3254 |
-ac_cpp='$CXXCPP $CPPFLAGS' |
|
3255 |
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' |
|
3256 |
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
|
3257 |
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu |
|
3258 |
- |
|
3259 |
- |
|
3260 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 |
|
3261 |
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; } |
|
3262 |
-if ${ac_cv_path_GREP+:} false; then : |
|
3263 |
- $as_echo_n "(cached) " >&6 |
|
3264 |
-else |
|
3265 |
- if test -z "$GREP"; then |
|
3266 |
- ac_path_GREP_found=false |
|
3267 |
- # Loop through the user's path and test for each of PROGNAME-LIST |
|
3268 |
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
|
3269 |
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin |
|
3270 |
-do |
|
3271 |
- IFS=$as_save_IFS |
|
3272 |
- test -z "$as_dir" && as_dir=. |
|
3273 |
- for ac_prog in grep ggrep; do |
|
3274 |
- for ac_exec_ext in '' $ac_executable_extensions; do |
|
3275 |
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" |
|
3276 |
- as_fn_executable_p "$ac_path_GREP" || continue |
|
3277 |
-# Check for GNU ac_path_GREP and select it if it is found. |
|
3278 |
- # Check for GNU $ac_path_GREP |
|
3279 |
-case `"$ac_path_GREP" --version 2>&1` in |
|
3280 |
-*GNU*) |
|
3281 |
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; |
|
3282 |
-*) |
|
3283 |
- ac_count=0 |
|
3284 |
- $as_echo_n 0123456789 >"conftest.in" |
|
3285 |
- while : |
|
3286 |
- do |
|
3287 |
- cat "conftest.in" "conftest.in" >"conftest.tmp" |
|
3288 |
- mv "conftest.tmp" "conftest.in" |
|
3289 |
- cp "conftest.in" "conftest.nl" |
|
3290 |
- $as_echo 'GREP' >> "conftest.nl" |
|
3291 |
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break |
|
3292 |
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break |
|
3293 |
- as_fn_arith $ac_count + 1 && ac_count=$as_val |
|
3294 |
- if test $ac_count -gt ${ac_path_GREP_max-0}; then |
|
3295 |
- # Best one so far, save it but keep looking for a better one |
|
3296 |
- ac_cv_path_GREP="$ac_path_GREP" |
|
3297 |
- ac_path_GREP_max=$ac_count |
|
3298 |
- fi |
|
3299 |
- # 10*(2^10) chars as input seems more than enough |
|
3300 |
- test $ac_count -gt 10 && break |
|
3301 |
- done |
|
3302 |
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;; |
|
3303 |
-esac |
|
3304 |
- |
|
3305 |
- $ac_path_GREP_found && break 3 |
|
3306 |
- done |
|
3307 |
- done |
|
3308 |
- done |
|
3309 |
-IFS=$as_save_IFS |
|
3310 |
- if test -z "$ac_cv_path_GREP"; then |
|
3311 |
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 |
|
3312 |
- fi |
|
3313 |
-else |
|
3314 |
- ac_cv_path_GREP=$GREP |
|
3315 |
-fi |
|
3316 |
- |
|
3317 |
-fi |
|
3318 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 |
|
3319 |
-$as_echo "$ac_cv_path_GREP" >&6; } |
|
3320 |
- GREP="$ac_cv_path_GREP" |
|
3321 |
- |
|
3322 |
- |
|
3323 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 |
|
3324 |
-$as_echo_n "checking for egrep... " >&6; } |
|
3325 |
-if ${ac_cv_path_EGREP+:} false; then : |
|
3326 |
- $as_echo_n "(cached) " >&6 |
|
3327 |
-else |
|
3328 |
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 |
|
3329 |
- then ac_cv_path_EGREP="$GREP -E" |
|
3330 |
- else |
|
3331 |
- if test -z "$EGREP"; then |
|
3332 |
- ac_path_EGREP_found=false |
|
3333 |
- # Loop through the user's path and test for each of PROGNAME-LIST |
|
3334 |
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
|
3335 |
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin |
|
3336 |
-do |
|
3337 |
- IFS=$as_save_IFS |
|
3338 |
- test -z "$as_dir" && as_dir=. |
|
3339 |
- for ac_prog in egrep; do |
|
3340 |
- for ac_exec_ext in '' $ac_executable_extensions; do |
|
3341 |
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" |
|
3342 |
- as_fn_executable_p "$ac_path_EGREP" || continue |
|
3343 |
-# Check for GNU ac_path_EGREP and select it if it is found. |
|
3344 |
- # Check for GNU $ac_path_EGREP |
|
3345 |
-case `"$ac_path_EGREP" --version 2>&1` in |
|
3346 |
-*GNU*) |
|
3347 |
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; |
|
3348 |
-*) |
|
3349 |
- ac_count=0 |
|
3350 |
- $as_echo_n 0123456789 >"conftest.in" |
|
3351 |
- while : |
|
3352 |
- do |
|
3353 |
- cat "conftest.in" "conftest.in" >"conftest.tmp" |
|
3354 |
- mv "conftest.tmp" "conftest.in" |
|
3355 |
- cp "conftest.in" "conftest.nl" |
|
3356 |
- $as_echo 'EGREP' >> "conftest.nl" |
|
3357 |
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break |
|
3358 |
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break |
|
3359 |
- as_fn_arith $ac_count + 1 && ac_count=$as_val |
|
3360 |
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then |
|
3361 |
- # Best one so far, save it but keep looking for a better one |
|
3362 |
- ac_cv_path_EGREP="$ac_path_EGREP" |
|
3363 |
- ac_path_EGREP_max=$ac_count |
|
3364 |
- fi |
|
3365 |
- # 10*(2^10) chars as input seems more than enough |
|
3366 |
- test $ac_count -gt 10 && break |
|
3367 |
- done |
|
3368 |
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;; |
|
3369 |
-esac |
|
3370 |
- |
|
3371 |
- $ac_path_EGREP_found && break 3 |
|
3372 |
- done |
|
3373 |
- done |
|
3374 |
- done |
|
3375 |
-IFS=$as_save_IFS |
|
3376 |
- if test -z "$ac_cv_path_EGREP"; then |
|
3377 |
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 |
|
3378 |
- fi |
|
3379 |
-else |
|
3380 |
- ac_cv_path_EGREP=$EGREP |
|
3381 |
-fi |
|
3382 |
- |
|
3383 |
- fi |
|
3384 |
-fi |
|
3385 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 |
|
3386 |
-$as_echo "$ac_cv_path_EGREP" >&6; } |
|
3387 |
- EGREP="$ac_cv_path_EGREP" |
|
3388 |
- |
|
3389 |
- |
|
3390 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 |
|
3391 |
-$as_echo_n "checking for ANSI C header files... " >&6; } |
|
3392 |
-if ${ac_cv_header_stdc+:} false; then : |
|
3393 |
- $as_echo_n "(cached) " >&6 |
|
3394 |
-else |
|
3395 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3396 |
-/* end confdefs.h. */ |
|
3397 |
-#include <stdlib.h> |
|
3398 |
-#include <stdarg.h> |
|
3399 |
-#include <string.h> |
|
3400 |
-#include <float.h> |
|
3401 |
- |
|
3402 |
-int |
|
3403 |
-main () |
|
3404 |
-{ |
|
3405 |
- |
|
3406 |
- ; |
|
3407 |
- return 0; |
|
3408 |
-} |
|
3409 |
-_ACEOF |
|
3410 |
-if ac_fn_cxx_try_compile "$LINENO"; then : |
|
3411 |
- ac_cv_header_stdc=yes |
|
3412 |
-else |
|
3413 |
- ac_cv_header_stdc=no |
|
3414 |
-fi |
|
3415 |
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
|
3416 |
- |
|
3417 |
-if test $ac_cv_header_stdc = yes; then |
|
3418 |
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI. |
|
3419 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3420 |
-/* end confdefs.h. */ |
|
3421 |
-#include <string.h> |
|
3422 |
- |
|
3423 |
-_ACEOF |
|
3424 |
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
|
3425 |
- $EGREP "memchr" >/dev/null 2>&1; then : |
|
3426 |
- |
|
3427 |
-else |
|
3428 |
- ac_cv_header_stdc=no |
|
3429 |
-fi |
|
3430 |
-rm -f conftest* |
|
3431 |
- |
|
3432 |
-fi |
|
3433 |
- |
|
3434 |
-if test $ac_cv_header_stdc = yes; then |
|
3435 |
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. |
|
3436 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3437 |
-/* end confdefs.h. */ |
|
3438 |
-#include <stdlib.h> |
|
3439 |
- |
|
3440 |
-_ACEOF |
|
3441 |
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
|
3442 |
- $EGREP "free" >/dev/null 2>&1; then : |
|
3443 |
- |
|
3444 |
-else |
|
3445 |
- ac_cv_header_stdc=no |
|
3446 |
-fi |
|
3447 |
-rm -f conftest* |
|
3448 |
- |
|
3449 |
-fi |
|
3450 |
- |
|
3451 |
-if test $ac_cv_header_stdc = yes; then |
|
3452 |
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. |
|
3453 |
- if test "$cross_compiling" = yes; then : |
|
3454 |
- : |
|
3455 |
-else |
|
3456 |
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
3457 |
-/* end confdefs.h. */ |
|
3458 |
-#include <ctype.h> |
|
3459 |
-#include <stdlib.h> |
|
3460 |
-#if ((' ' & 0x0FF) == 0x020) |
|
3461 |
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') |
|
3462 |
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) |
|
3463 |
-#else |
|
3464 |
-# define ISLOWER(c) \ |
|
3465 |
- (('a' <= (c) && (c) <= 'i') \ |
|
3466 |
- || ('j' <= (c) && (c) <= 'r') \ |
|
3467 |
- || ('s' <= (c) && (c) <= 'z')) |
|
3468 |
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) |
|
3469 |
-#endif |
|
3470 |
- |
|
3471 |
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) |
|
3472 |
-int |
|
3473 |
-main () |
|
3474 |
-{ |
|
3475 |
- int i; |
|
3476 |
- for (i = 0; i < 256; i++) |
|
3477 |
- if (XOR (islower (i), ISLOWER (i)) |
|
3478 |
- || toupper (i) != TOUPPER (i)) |
|
3479 |
- return 2; |
|
3480 |
- return 0; |
|
3481 |
-} |
|
3482 |
-_ACEOF |
|
3483 |
-if ac_fn_cxx_try_run "$LINENO"; then : |
|
3484 |
- |
|
3485 |
-else |
|
3486 |
- ac_cv_header_stdc=no |
|
3487 |
-fi |
|
3488 |
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
|
3489 |
- conftest.$ac_objext conftest.beam conftest.$ac_ext |
|
3490 |
-fi |
|
3491 |
- |
|
3492 |
-fi |
|
3493 |
-fi |
|
3494 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 |
|
3495 |
-$as_echo "$ac_cv_header_stdc" >&6; } |
|
3496 |
-if test $ac_cv_header_stdc = yes; then |
|
3497 |
- |
|
3498 |
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h |
|
3499 |
- |
|
3500 |
-fi |
|
3501 |
- |
|
3502 |
-# On IRIX 5.3, sys/types and inttypes.h are conflicting. |
|
3503 |
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ |
|
3504 |
- inttypes.h stdint.h unistd.h |
|
3505 |
-do : |
|
3506 |
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` |
|
3507 |
-ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default |
|
3508 |
-" |
|
3509 |
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : |
|
3510 |
- cat >>confdefs.h <<_ACEOF |
|
3511 |
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 |
|
3512 |
-_ACEOF |
|
3513 |
- |
|
3514 |
-fi |
|
3515 |
- |
|
3516 |
-done |
|
3517 |
- |
|
3518 |
- |
|
3519 |
-for ac_header in crypto++/hex.h cryptopp/base32.h |
|
3520 |
-do : |
|
3521 |
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` |
|
3522 |
-ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" |
|
3523 |
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : |
|
3524 |
- cat >>confdefs.h <<_ACEOF |
|
3525 |
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 |
|
3526 |
-_ACEOF |
|
3527 |
- dualcontrol_found_cryptopp_headers=yes;break; |
|
3528 |
-else |
|
3529 |
- echo ... |
|
3530 |
-fi |
|
3531 |
- |
|
3532 |
-done |
|
3533 |
- |
|
3534 |
- if test "x$dualcontrol_found_cryptopp_headers" != "xyes"; then : |
|
3535 |
- as_fn_error $? "Unable to find Crypto++" "$LINENO" 5 |
|
3536 |
-fi |
|
3537 |
- $as_echo "#define HAVE_CRYPTOPP 1" >>confdefs.h |
|
3538 |
- |
|
3539 |
- |
|
3540 |
- CRYPTOPP_NAME=cryptopp |
|
3541 |
- ac_fn_cxx_check_header_mongrel "$LINENO" "crypto++/config.h" "ac_cv_header_cryptopp_config_h" "$ac_includes_default" |
|
3542 |
-if test "x$ac_cv_header_cryptopp_config_h" = xyes; then : |
|
3543 |
- CRYPTOPP_NAME=crypto++ |
|
3544 |
- |
|
3545 |
-fi |
|
3546 |
- |
|
3547 |
- |
|
3548 |
- ac_ext=c |
|
3549 |
-ac_cpp='$CPP $CPPFLAGS' |
|
3550 |
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' |
|
3551 |
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
|
3552 |
-ac_compiler_gnu=$ac_cv_c_compiler_gnu |
|
3553 |
- |
|
3554 |
- |
|
3555 |
- |
|
3556 |
- |
|
3557 |
-else |
|
3558 |
- $as_echo "#define HAVE_CRYPTOPP 0" >>confdefs.h |
|
3559 |
- |
|
3560 |
-fi |
|
3561 |
- |
|
3562 |
- |
|
3563 |
- |
|
3564 | 2567 |
ac_config_files="$ac_config_files Makefile" |
3565 | 2568 |
|
3566 | 2569 |
cat >confcache <<\_ACEOF |
... | ... |
@@ -33,30 +33,6 @@ AC_ARG_WITH([cryptopp], |
33 | 33 |
[WITH_CRYPTOPP=yes]) |
34 | 34 |
|
35 | 35 |
#and check crypto++ |
36 |
-if test "$WITH_CRYPTOPP" = "yes"; then |
|
37 |
- #crypto++ headers are either in include/crypto++ or include/cryptopp, |
|
38 |
- #the information is otherwise unavailable from standard configuration |
|
39 |
- #means. Please report/add more tests if you encounter distros that |
|
40 |
- #place them elsewhere. |
|
41 |
- AC_LANG_PUSH([C++]) |
|
42 |
- AC_CHECK_HEADERS([crypto++/hex.h cryptopp/base32.h], [dualcontrol_found_cryptopp_headers=yes;break;], [echo ...]) |
|
43 |
- AS_IF([test "x$dualcontrol_found_cryptopp_headers" != "xyes"], [AC_MSG_ERROR([Unable to find Crypto++])]) |
|
44 |
- AC_DEFINE([HAVE_CRYPTOPP], [1]) |
|
45 |
- |
|
46 |
- CRYPTOPP_NAME=cryptopp |
|
47 |
- AC_CHECK_HEADER([crypto++/config.h], |
|
48 |
- CRYPTOPP_NAME=crypto++ |
|
49 |
- ) |
|
50 |
- AC_LANG_POP([C++]) |
|
51 |
- |
|
52 |
- |
|
53 |
- AC_SUBST(CRYPTOPP_NAME) |
|
54 |
-else |
|
55 |
- AC_DEFINE([HAVE_CRYPTOPP], [0]) |
|
56 |
-fi |
|
57 |
- |
|
58 |
- |
|
59 |
- |
|
60 | 36 |
AC_CONFIG_FILES([Makefile]) |
61 | 37 |
AC_OUTPUT |
62 | 38 |
|
... | ... |
@@ -42,8 +42,10 @@ installer init_installer() |
42 | 42 |
stdlib stdlib (stdlib::get()); |
43 | 43 |
sys_time time (sys_time::get()); |
44 | 44 |
int code_digits = 6; |
45 |
- auto the_generator = std::make_shared<totp_generator> (time, "\x00", code_digits); |
|
46 |
- installer installer (installer::create (tokens, unistd, directory, the_generator)); |
|
45 |
+ auto the_generator = std::make_shared<totp_generator> (time, "\x00", |
|
46 |
+ code_digits); |
|
47 |
+ installer installer (installer::create (tokens, unistd, directory, |
|
48 |
+ the_generator)); |
|
47 | 49 |
|
48 | 50 |
return installer; |
49 | 51 |
} |
... | ... |
@@ -12,19 +12,11 @@ |
12 | 12 |
#include "generator.h" |
13 | 13 |
#include <iostream> |
14 | 14 |
|
15 |
-#ifdef CRYPTOPP_NAME |
|
16 |
-/// Prefixed with __ to avoid symbol conflicts with Cryptopp |
|
17 |
-#define __CRYPTOPP_BASE32_H <CRYPTOPP_NAME/base32.h> |
|
18 |
-#define __CRYPTOPP_HEX_H <cryptopp/hex.h> |
|
19 |
-#define __CRYPTOPP_HMAC_H <cryptopp/hmac.h> |
|
20 |
-#include __CRYPTOPP_BASE32_H |
|
21 |
-#include __CRYPTOPP_HEX_H |
|
22 |
-#include __CRYPTOPP_HMAC_H |
|
23 |
-#else |
|
24 |
-#error "CRYPTOPP_NAME not defined" |
|
25 |
-#endif |
|
26 |
- |
|
27 |
-namespace { |
|
15 |
+#include <openssl/hmac.h> |
|
16 |
+#include <openssl/evp.h> |
|
17 |
+ |
|
18 |
+namespace |
|
19 |
+{ |
|
28 | 20 |
int ipow (int base, int exp) |
29 | 21 |
{ |
30 | 22 |
int result = 1; |
... | ... |
@@ -41,6 +33,18 @@ int ipow (int base, int exp) |
41 | 33 |
return result; |
42 | 34 |
} |
43 | 35 |
|
36 |
+unsigned char *timeToBytes (unsigned long long time, unsigned char *data, |
|
37 |
+ size_t data_size) |
|
38 |
+{ |
|
39 |
+ for (int idx = data_size - 1; idx > -1; idx--) { |
|
40 |
+ unsigned char next_digit = time & 0xff; |
|
41 |
+ data[idx] = next_digit; |
|
42 |
+ time >>= 8; |
|
43 |
+ } |
|
44 |
+ |
|
45 |
+ return data; |
|
46 |
+} |
|
47 |
+ |
|
44 | 48 |
unsigned long bytesToInt (const std::string &bytes) |
45 | 49 |
{ |
46 | 50 |
unsigned long result = 0; |
... | ... |
@@ -62,6 +66,11 @@ time_t time_step (const time_t time, const int step) |
62 | 66 |
|
63 | 67 |
class token_generator_impl : public token_generator_ifc |
64 | 68 |
{ |
69 |
+private: |
|
70 |
+ const sys_time &clock; |
|
71 |
+ unsigned int code_digits; |
|
72 |
+ const std::string key; |
|
73 |
+ |
|
65 | 74 |
private: |
66 | 75 |
unsigned long truncate (const std::string &mac) const |
67 | 76 |
{ |
... | ... |
@@ -71,61 +80,41 @@ private: |
71 | 80 |
return bytesToInt (offsetBytes) & 0x7fffffff; |
72 | 81 |
} |
73 | 82 |
|
74 |
- unsigned long hotp (const CryptoPP::SecByteBlock &key, |
|
75 |
- const CryptoPP::Integer &counter) const |
|
83 |
+ std::string zero_fill (unsigned long result, int digits) const |
|
76 | 84 |
{ |
77 |
- std::string mac; |
|
78 |
- |
|
79 |
- CryptoPP::SecByteBlock counter_bytes (8); |
|
80 |
- // Do I know that 8 is sufficient here? . . . |
|
81 |
- counter.Encode (counter_bytes.BytePtr(), 8, CryptoPP::Integer::UNSIGNED); |
|
82 |
- |
|
83 |
- CryptoPP::HMAC<CryptoPP::SHA1> hmac (key, key.size()); |
|
84 |
- |
|
85 |
- CryptoPP::StringSink *stringSink = new CryptoPP::StringSink (mac); |
|
86 |
- CryptoPP::HashFilter *hashFilter = new CryptoPP::HashFilter (hmac, |
|
87 |
- stringSink); |
|
88 |
- CryptoPP::StringSource ss2 (counter_bytes, counter_bytes.size(), true, |
|
89 |
- hashFilter); |
|
90 |
- |
|
91 |
- unsigned long result = truncate (mac); |
|
92 |
- |
|
93 |
- result = result % ipow (10, code_digits); |
|
94 |
- return result; |
|
85 |
+ std::ostringstream result_stream; |
|
86 |
+ result_stream << std::setw (digits) << std::setfill ('0') << result; |
|
87 |
+ return result_stream.str(); |
|
95 | 88 |
} |
96 | 89 |
|
97 |
- CryptoPP::SecByteBlock generate_key (unsigned int size) |
|
98 |
- const |
|
90 |
+ std::string hotp (const std::string &key, const unsigned char *data, |
|
91 |
+ size_t data_size, const int digits=6) const |
|
99 | 92 |
{ |
100 |
- CryptoPP::AutoSeededRandomPool prng; |
|
93 |
+ unsigned char *digest = HMAC (EVP_sha1(), key.c_str(), key.size(), data, |
|
94 |
+ data_size, NULL, NULL); |
|
95 |
+ std::string digest_s = std::string (reinterpret_cast<const char *> (digest), |
|
96 |
+ 20); |
|
97 |
+ unsigned long result = truncate (digest_s) % ipow (10,digits); |
|
101 | 98 |
|
102 |
- CryptoPP::SecByteBlock key (size); |
|
103 |
- prng.GenerateBlock (key, key.size()); |
|
104 |
- return key; |
|
99 |
+ return zero_fill (result, digits); |
|
105 | 100 |
} |
106 | 101 |
|
107 |
- const sys_time &clock; |
|
108 |
- unsigned int code_digits; |
|
109 |
- const std::shared_ptr<CryptoPP::SecByteBlock> key; |
|
110 | 102 |
public: |
111 | 103 |
token_generator_impl (const sys_time &clock, |
112 |
- const std::string &key_c, |
|
113 |
- const int code_digits) : |
|
104 |
+ const std::string &key, |
|
105 |
+ const int code_digits) : |
|
114 | 106 |
clock (clock), code_digits (code_digits), |
115 |
- key (std::make_shared<CryptoPP::SecByteBlock> (CryptoPP::SecByteBlock ( |
|
116 |
- reinterpret_cast<const unsigned char *> (key_c.c_str()), key_c.size()))) |
|
107 |
+ key (key) |
|
117 | 108 |
{} |
118 | 109 |
|
119 | 110 |
std::string generate_token () const override |
120 | 111 |
{ |
121 |
- const CryptoPP::Integer &time = clock.time (nullptr); |
|
122 |
- int time_step_size = 30; |
|
123 |
- CryptoPP::Integer current_step = time_step (time.ConvertToLong(), |
|
124 |
- time_step_size); |
|
125 |
- long otp = hotp (*key, current_step); |
|
126 |
- std::ostringstream is; |
|
127 |
- is << std::setfill ('0') << std::setw (6)<< otp; |
|
128 |
- return is.str(); |
|
112 |
+ const time_t &time_chunk = clock.time (nullptr) / 30; |
|
113 |
+ |
|
114 |
+ unsigned char data[8] = {0,0,0,0,0,0,0,0}; |
|
115 |
+ timeToBytes (time_chunk, data, 8); |
|
116 |
+ |
|
117 |
+ return hotp (key, data, 8, code_digits); |
|
129 | 118 |
} |
130 | 119 |
}; |
131 | 120 |
} |
... | ... |
@@ -136,5 +125,6 @@ totp_generator::totp_generator ( |
136 | 125 |
const sys_time &clock, |
137 | 126 |
const std::string &key_c, |
138 | 127 |
const int code_digits) : |
139 |
- delegate_ (std::make_shared<token_generator_impl> (clock, key_c, code_digits)) |
|
128 |
+ delegate_ (std::make_shared<token_generator_impl> (clock, key_c, |
|
129 |
+ code_digits)) |
|
140 | 130 |
{} |
... | ... |
@@ -9,7 +9,6 @@ |
9 | 9 |
* at https://github.com/cjdev/dual-control. |
10 | 10 |
*/ |
11 | 11 |
|
12 |
-#pragma once |
|
13 | 12 |
#ifndef GENERATOR_H_ |
14 | 13 |
#define GENERATOR_H_ |
15 | 14 |
|
... | ... |
@@ -34,16 +33,15 @@ time_t time_step (const time_t time, const int step); |
34 | 33 |
class token_generator_ifc |
35 | 34 |
{ |
36 | 35 |
public: |
37 |
- virtual std::string generate_token () const |
|
38 |
- { |
|
39 |
- return "<dummy string>"; |
|
40 |
- } |
|
36 |
+ virtual std::string generate_token () const = 0; |
|
37 |
+ |
|
41 | 38 |
}; |
42 | 39 |
|
43 | 40 |
class totp_generator |
44 | 41 |
{ |
45 | 42 |
public: |
46 | 43 |
using delegate = std::shared_ptr<token_generator_ifc>; |
44 |
+ |
|
47 | 45 |
private: |
48 | 46 |
delegate delegate_; |
49 | 47 |
|
... | ... |
@@ -54,7 +52,7 @@ public: |
54 | 52 |
}; |
55 | 53 |
|
56 | 54 |
totp_generator (delegate delegate_) : |
57 |
- delegate_(delegate_) |
|
55 |
+ delegate_ (delegate_) |
|
58 | 56 |
{} |
59 | 57 |
totp_generator (const sys_time &clock, |
60 | 58 |
const std::string &key_c, |
... | ... |
@@ -62,4 +60,3 @@ public: |
62 | 60 |
}; |
63 | 61 |
|
64 | 62 |
#endif |
65 |
- |
... | ... |
@@ -44,7 +44,8 @@ public: |
44 | 44 |
return delegate_->install_token(); |
45 | 45 |
} |
46 | 46 |
static installer create (const tokens &tokens, const unistd &unistd, |
47 |
- const directory &directory, const std::shared_ptr<totp_generator> generator); |
|
47 |
+ const directory &directory, |
|
48 |
+ const std::shared_ptr<totp_generator> generator); |
|
48 | 49 |
}; |
49 | 50 |
|
50 | 51 |
#endif |