1 |
commit: d9479289f3cd4833538cc7c89fdc65a05685b439 |
2 |
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com> |
3 |
AuthorDate: Fri Oct 26 18:29:06 2018 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 26 18:29:53 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9479289 |
7 |
|
8 |
net-misc/openssl: Fix building on libressl with USE=hpn |
9 |
|
10 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
11 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
12 |
|
13 |
.../files/openssh-7.9_p1-hpn-openssl-1.1.patch | 24 +++++++++++----------- |
14 |
1 file changed, 12 insertions(+), 12 deletions(-) |
15 |
|
16 |
diff --git a/net-misc/openssh/files/openssh-7.9_p1-hpn-openssl-1.1.patch b/net-misc/openssh/files/openssh-7.9_p1-hpn-openssl-1.1.patch |
17 |
index 524d05ad89d..c07ad0414ef 100644 |
18 |
--- a/net-misc/openssh/files/openssh-7.9_p1-hpn-openssl-1.1.patch |
19 |
+++ b/net-misc/openssh/files/openssh-7.9_p1-hpn-openssl-1.1.patch |
20 |
@@ -1,13 +1,13 @@ |
21 |
--- openssh-7.9p1.orig/cipher-ctr-mt.c 2018-10-24 20:48:00.909255466 -0000 |
22 |
+++ openssh-7.9p1/cipher-ctr-mt.c 2018-10-24 20:48:17.378155144 -0000 |
23 |
@@ -46,7 +46,7 @@ |
24 |
- |
25 |
+ |
26 |
/*-------------------- TUNABLES --------------------*/ |
27 |
/* maximum number of threads and queues */ |
28 |
-#define MAX_THREADS 32 |
29 |
-+#define MAX_THREADS 32 |
30 |
++#define MAX_THREADS 32 |
31 |
#define MAX_NUMKQ (MAX_THREADS * 2) |
32 |
- |
33 |
+ |
34 |
/* Number of pregen threads to use */ |
35 |
@@ -435,7 +435,7 @@ |
36 |
destp.u += AES_BLOCK_SIZE; |
37 |
@@ -15,7 +15,7 @@ |
38 |
len -= AES_BLOCK_SIZE; |
39 |
- ssh_ctr_inc(ctx->iv, AES_BLOCK_SIZE); |
40 |
+ ssh_ctr_inc(c->aes_counter, AES_BLOCK_SIZE); |
41 |
- |
42 |
+ |
43 |
/* Increment read index, switch queues on rollover */ |
44 |
if ((ridx = (ridx + 1) % KQLEN) == 0) { |
45 |
@@ -481,8 +481,6 @@ |
46 |
@@ -28,9 +28,9 @@ |
47 |
cipher_threads = sysconf(_SC_NPROCESSORS_ONLN) / 2; |
48 |
#endif /*__linux__*/ |
49 |
@@ -505,11 +503,12 @@ |
50 |
- if (cipher_threads < 2) |
51 |
+ if (cipher_threads < 2) |
52 |
cipher_threads = 2; |
53 |
- |
54 |
+ |
55 |
- /* assure that we aren't trying to create more threads than we have in the struct */ |
56 |
- /* cipher_threads is half the total of allowable threads hence the odd looking math here */ |
57 |
+ /* assure that we aren't trying to create more threads */ |
58 |
@@ -38,20 +38,20 @@ |
59 |
+ /* total of allowable threads hence the odd looking math here */ |
60 |
if (cipher_threads * 2 > MAX_THREADS) |
61 |
cipher_threads = MAX_THREADS / 2; |
62 |
-- |
63 |
+- |
64 |
+ |
65 |
/* set the number of keystream queues */ |
66 |
numkq = cipher_threads * 2; |
67 |
- |
68 |
+ |
69 |
@@ -551,16 +550,16 @@ |
70 |
} |
71 |
- |
72 |
+ |
73 |
if (iv != NULL) { |
74 |
- memcpy(ctx->iv, iv, AES_BLOCK_SIZE); |
75 |
+ memcpy(c->aes_counter, iv, AES_BLOCK_SIZE); |
76 |
c->state |= HAVE_IV; |
77 |
} |
78 |
- |
79 |
+ |
80 |
if (c->state == (HAVE_KEY | HAVE_IV)) { |
81 |
/* Clear queues */ |
82 |
- memcpy(c->q[0].ctr, ctx->iv, AES_BLOCK_SIZE); |
83 |
@@ -67,7 +67,7 @@ |
84 |
const EVP_CIPHER * |
85 |
evp_aes_ctr_mt(void) |
86 |
{ |
87 |
-+# if OPENSSL_VERSION_NUMBER >= 0x10100000UL |
88 |
++# if OPENSSL_VERSION_NUMBER >= 0x10100000UL && !defined(LIBRESSL_VERSION_NUMBER) |
89 |
+ static EVP_CIPHER *aes_ctr; |
90 |
+ aes_ctr = EVP_CIPHER_meth_new(NID_undef, 16/*block*/, 16/*key*/); |
91 |
+ EVP_CIPHER_meth_set_iv_length(aes_ctr, AES_BLOCK_SIZE); |
92 |
@@ -103,5 +103,5 @@ |
93 |
+ return &aes_ctr; |
94 |
+# endif /*OPENSSH_VERSION_NUMBER*/ |
95 |
} |
96 |
- |
97 |
+ |
98 |
#endif /* defined(WITH_OPENSSL) */ |