diff options
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | cipher-chachapoly-libcrypto.c | 3 | ||||
-rw-r--r-- | cipher-chachapoly.c | 4 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | openbsd-compat/openssl-compat.h | 6 |
5 files changed, 15 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in index e7549470c..efbc62a4a 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -103,7 +103,7 @@ LIBSSH_OBJS=${LIBOPENSSH_OBJS} \ | |||
103 | ssh-ed25519-sk.o ssh-rsa.o dh.o \ | 103 | ssh-ed25519-sk.o ssh-rsa.o dh.o \ |
104 | msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ | 104 | msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ |
105 | ssh-pkcs11.o smult_curve25519_ref.o \ | 105 | ssh-pkcs11.o smult_curve25519_ref.o \ |
106 | poly1305.o chacha.o cipher-chachapoly.o \ | 106 | poly1305.o chacha.o cipher-chachapoly.o cipher-chachapoly-libcrypto.o \ |
107 | ssh-ed25519.o digest-openssl.o digest-libc.o \ | 107 | ssh-ed25519.o digest-openssl.o digest-libc.o \ |
108 | hmac.o sc25519.o ge25519.o fe25519.o ed25519.o verify.o hash.o \ | 108 | hmac.o sc25519.o ge25519.o fe25519.o ed25519.o verify.o hash.o \ |
109 | kex.o kexdh.o kexgex.o kexecdh.o kexc25519.o \ | 109 | kex.o kexdh.o kexgex.o kexecdh.o kexc25519.o \ |
diff --git a/cipher-chachapoly-libcrypto.c b/cipher-chachapoly-libcrypto.c index 960ac14cf..2c0f80f28 100644 --- a/cipher-chachapoly-libcrypto.c +++ b/cipher-chachapoly-libcrypto.c | |||
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | #include "includes.h" | 19 | #include "includes.h" |
20 | 20 | ||
21 | #if defined(HAVE_EVP_CHACHA20) || !defined(HAVE_BROKEN_CHACHA20) | ||
22 | |||
21 | #include <sys/types.h> | 23 | #include <sys/types.h> |
22 | #include <stdarg.h> /* needed for log.h */ | 24 | #include <stdarg.h> /* needed for log.h */ |
23 | #include <string.h> | 25 | #include <string.h> |
@@ -158,3 +160,4 @@ chachapoly_get_length(struct chachapoly_ctx *ctx, | |||
158 | *plenp = PEEK_U32(buf); | 160 | *plenp = PEEK_U32(buf); |
159 | return 0; | 161 | return 0; |
160 | } | 162 | } |
163 | #endif /* defined(HAVE_EVP_CHACHA20) && !defined(HAVE_BROKEN_CHACHA20) */ | ||
diff --git a/cipher-chachapoly.c b/cipher-chachapoly.c index 42e8d40b7..132cdeec9 100644 --- a/cipher-chachapoly.c +++ b/cipher-chachapoly.c | |||
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | #include "includes.h" | 19 | #include "includes.h" |
20 | 20 | ||
21 | #if !defined(HAVE_EVP_CHACHA20) || defined(HAVE_BROKEN_CHACHA20) | ||
22 | |||
21 | #include <sys/types.h> | 23 | #include <sys/types.h> |
22 | #include <stdarg.h> /* needed for log.h */ | 24 | #include <stdarg.h> /* needed for log.h */ |
23 | #include <string.h> | 25 | #include <string.h> |
@@ -130,3 +132,5 @@ chachapoly_get_length(struct chachapoly_ctx *ctx, | |||
130 | *plenp = PEEK_U32(buf); | 132 | *plenp = PEEK_U32(buf); |
131 | return 0; | 133 | return 0; |
132 | } | 134 | } |
135 | |||
136 | #endif /* !defined(HAVE_EVP_CHACHA20) || defined(HAVE_BROKEN_CHACHA20) */ | ||
diff --git a/configure.ac b/configure.ac index de6ad127c..9cba9542a 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -2804,6 +2804,7 @@ if test "x$openssl" = "xyes" ; then | |||
2804 | EVP_PKEY_get0_RSA \ | 2804 | EVP_PKEY_get0_RSA \ |
2805 | EVP_MD_CTX_new \ | 2805 | EVP_MD_CTX_new \ |
2806 | EVP_MD_CTX_free \ | 2806 | EVP_MD_CTX_free \ |
2807 | EVP_chacha20 \ | ||
2807 | ]) | 2808 | ]) |
2808 | 2809 | ||
2809 | if test "x$openssl_engine" = "xyes" ; then | 2810 | if test "x$openssl_engine" = "xyes" ; then |
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index abdcb8763..bcefd8f28 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h | |||
@@ -62,6 +62,12 @@ void ssh_libcrypto_init(void); | |||
62 | # define OPENSSL_DSA_MAX_MODULUS_BITS 10000 | 62 | # define OPENSSL_DSA_MAX_MODULUS_BITS 10000 |
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | #ifdef LIBRESSL_VERSION_NUMBER | ||
66 | # if LIBRESSL_VERSION_NUMBER >= 0x3010000fL | ||
67 | # define HAVE_BROKEN_CHACHA20 | ||
68 | # endif | ||
69 | #endif | ||
70 | |||
65 | #ifndef OPENSSL_HAVE_EVPCTR | 71 | #ifndef OPENSSL_HAVE_EVPCTR |
66 | # define EVP_aes_128_ctr evp_aes_128_ctr | 72 | # define EVP_aes_128_ctr evp_aes_128_ctr |
67 | # define EVP_aes_192_ctr evp_aes_128_ctr | 73 | # define EVP_aes_192_ctr evp_aes_128_ctr |