openssh: fixes issues with some openssl options
[feed/packages.git] / net / openssh / patches / 0001-fix-compilation-with-openssl-built-without-ECC.patch
1 From 91b777c7064d9d91a1433a42b0bb31592388d1b4 Mon Sep 17 00:00:00 2001
2 From: Eneas U de Queiroz <cote2004-github@yahoo.com>
3 Date: Tue, 9 Oct 2018 16:17:42 -0300
4 Subject: [PATCH] fix compilation with openssl built without ECC
5
6 ECDSA code in openssh-compat.h and libressl-api-compat.c needs to be
7 guarded by OPENSSL_HAS_ECC
8
9 Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
10
11 diff --git a/openbsd-compat/libressl-api-compat.c b/openbsd-compat/libressl-api-compat.c
12 index de3e64a6..ae00ff59 100644
13 --- a/openbsd-compat/libressl-api-compat.c
14 +++ b/openbsd-compat/libressl-api-compat.c
15 @@ -152,7 +152,9 @@
16 #include <openssl/dsa.h>
17 #include <openssl/rsa.h>
18 #include <openssl/evp.h>
19 +#ifdef OPENSSL_HAS_ECC
20 #include <openssl/ecdsa.h>
21 +#endif
22 #include <openssl/dh.h>
23
24 #ifndef HAVE_DSA_GET0_PQG
25 @@ -417,6 +419,7 @@ DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s)
26 }
27 #endif /* HAVE_DSA_SIG_SET0 */
28
29 +#ifdef OPENSSL_HAS_ECC
30 #ifndef HAVE_ECDSA_SIG_GET0
31 void
32 ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
33 @@ -442,6 +445,7 @@ ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
34 return 1;
35 }
36 #endif /* HAVE_ECDSA_SIG_SET0 */
37 +#endif /* OPENSSL_HAS_ECC */
38
39 #ifndef HAVE_DH_GET0_PQG
40 void
41 diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h
42 index 9e0264c0..6a525f28 100644
43 --- a/openbsd-compat/openssl-compat.h
44 +++ b/openbsd-compat/openssl-compat.h
45 @@ -24,7 +24,9 @@
46 #include <openssl/evp.h>
47 #include <openssl/rsa.h>
48 #include <openssl/dsa.h>
49 +#ifdef OPENSSL_HAS_ECC
50 #include <openssl/ecdsa.h>
51 +#endif
52 #include <openssl/dh.h>
53
54 int ssh_compatible_openssl(long, long);
55 @@ -161,6 +163,7 @@ void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
56 int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
57 #endif /* DSA_SIG_SET0 */
58
59 +#ifdef OPENSSL_HAS_ECC
60 #ifndef HAVE_ECDSA_SIG_GET0
61 void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
62 #endif /* HAVE_ECDSA_SIG_GET0 */
63 @@ -168,6 +171,7 @@ void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
64 #ifndef HAVE_ECDSA_SIG_SET0
65 int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
66 #endif /* HAVE_ECDSA_SIG_SET0 */
67 +#endif /* OPENSSL_HAS_ECC */
68
69 #ifndef HAVE_DH_GET0_PQG
70 void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q,