diff options
| author | Brent Cook <bcook@openbsd.org> | 2015-02-14 18:51:44 -0600 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2015-02-14 18:54:43 -0600 |
| commit | 28311d4355e38376dc7ebcf1d2d7957718f55359 (patch) | |
| tree | ac6dd78bba77be68c50a9070a7876bdece1443a4 | |
| parent | 2286578fd4e93e024ac33a0fd8f89dc936ad95a8 (diff) | |
| download | portable-28311d4355e38376dc7ebcf1d2d7957718f55359.tar.gz portable-28311d4355e38376dc7ebcf1d2d7957718f55359.tar.bz2 portable-28311d4355e38376dc7ebcf1d2d7957718f55359.zip | |
conditionally build certhash into openssl(1)
For now, look for openat and symlink. We may switch to just needing
symlink later.
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | apps/Makefile.am | 7 | ||||
| -rw-r--r-- | apps/certhash_disabled.c | 13 | ||||
| -rw-r--r-- | configure.ac | 2 |
4 files changed, 22 insertions, 1 deletions
| @@ -111,6 +111,7 @@ apps/openssl | |||
| 111 | apps/openssl.cnf | 111 | apps/openssl.cnf |
| 112 | !apps/apps_win.c | 112 | !apps/apps_win.c |
| 113 | !apps/poll_win.c | 113 | !apps/poll_win.c |
| 114 | !apps/certhash_disabled.c | ||
| 114 | 115 | ||
| 115 | crypto/compat/arc4random.c | 116 | crypto/compat/arc4random.c |
| 116 | crypto/compat/chacha_private.h | 117 | crypto/compat/chacha_private.h |
diff --git a/apps/Makefile.am b/apps/Makefile.am index f752ca6..30978c1 100644 --- a/apps/Makefile.am +++ b/apps/Makefile.am | |||
| @@ -10,7 +10,6 @@ openssl_LDADD += $(top_builddir)/crypto/libcrypto.la | |||
| 10 | openssl_SOURCES = apps.c | 10 | openssl_SOURCES = apps.c |
| 11 | openssl_SOURCES += asn1pars.c | 11 | openssl_SOURCES += asn1pars.c |
| 12 | openssl_SOURCES += ca.c | 12 | openssl_SOURCES += ca.c |
| 13 | openssl_SOURCES += certhash.c | ||
| 14 | openssl_SOURCES += ciphers.c | 13 | openssl_SOURCES += ciphers.c |
| 15 | openssl_SOURCES += cms.c | 14 | openssl_SOURCES += cms.c |
| 16 | openssl_SOURCES += crl.c | 15 | openssl_SOURCES += crl.c |
| @@ -58,6 +57,12 @@ openssl_SOURCES += verify.c | |||
| 58 | openssl_SOURCES += version.c | 57 | openssl_SOURCES += version.c |
| 59 | openssl_SOURCES += x509.c | 58 | openssl_SOURCES += x509.c |
| 60 | 59 | ||
| 60 | if BUILD_CERTHASH | ||
| 61 | openssl_SOURCES += certhash.c | ||
| 62 | else | ||
| 63 | openssl_SOURCES += certhash_disabled.c | ||
| 64 | endif | ||
| 65 | |||
| 61 | if HOST_WIN | 66 | if HOST_WIN |
| 62 | openssl_SOURCES += apps_win.c | 67 | openssl_SOURCES += apps_win.c |
| 63 | else | 68 | else |
diff --git a/apps/certhash_disabled.c b/apps/certhash_disabled.c new file mode 100644 index 0000000..8238ff7 --- /dev/null +++ b/apps/certhash_disabled.c | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | /* | ||
| 2 | * Public domain | ||
| 3 | * certhash dummy implementation for platforms without symlinks | ||
| 4 | */ | ||
| 5 | |||
| 6 | #include "apps.h" | ||
| 7 | |||
| 8 | int | ||
| 9 | certhash_main(int argc, char **argv) | ||
| 10 | { | ||
| 11 | fprintf(stderr, "certhash is not enabled on this platform\n"); | ||
| 12 | return (1); | ||
| 13 | } | ||
diff --git a/configure.ac b/configure.ac index d8e5338..2f86fbd 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -197,6 +197,7 @@ LDFLAGS="$LDFLAGS $CLANG_FLAGS" | |||
| 197 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) | 197 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) |
| 198 | AC_CHECK_FUNCS([getentropy issetugid memmem poll reallocarray]) | 198 | AC_CHECK_FUNCS([getentropy issetugid memmem poll reallocarray]) |
| 199 | AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strtonum]) | 199 | AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strtonum]) |
| 200 | AC_CHECK_FUNCS([symlink openat]) | ||
| 200 | AC_CHECK_FUNCS([timingsafe_bcmp timingsafe_memcmp]) | 201 | AC_CHECK_FUNCS([timingsafe_bcmp timingsafe_memcmp]) |
| 201 | 202 | ||
| 202 | # Share test results with automake | 203 | # Share test results with automake |
| @@ -215,6 +216,7 @@ AM_CONDITIONAL([HAVE_STRNLEN], [test "x$ac_cv_func_strnlen" = xyes]) | |||
| 215 | AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes]) | 216 | AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes]) |
| 216 | AM_CONDITIONAL([HAVE_TIMINGSAFE_BCMP], [test "x$ac_cv_func_timingsafe_bcmp" = xyes]) | 217 | AM_CONDITIONAL([HAVE_TIMINGSAFE_BCMP], [test "x$ac_cv_func_timingsafe_bcmp" = xyes]) |
| 217 | AM_CONDITIONAL([HAVE_TIMINGSAFE_MEMCMP], [test "x$ac_cv_func_timingsafe_memcmp" = xyes]) | 218 | AM_CONDITIONAL([HAVE_TIMINGSAFE_MEMCMP], [test "x$ac_cv_func_timingsafe_memcmp" = xyes]) |
| 219 | AM_CONDITIONAL([BUILD_CERTHASH], [test "x$ac_cv_func_symlink" = xyes -a "x$ac_cv_func_openat" = xyes]) | ||
| 218 | 220 | ||
| 219 | # overrides for arc4random_buf implementations with known issues | 221 | # overrides for arc4random_buf implementations with known issues |
| 220 | AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF], | 222 | AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF], |
