-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathopenssl-1.1.1c-prioritize_chacha_draft.patch
34 lines (34 loc) · 1.77 KB
/
openssl-1.1.1c-prioritize_chacha_draft.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/ssl/s3_lib.c 2019-04-25 00:17:46.000000000 +0200
+++ b/ssl/s3_lib.c 2019-04-25 00:50:25.000000000 +0200
@@ -4181,13 +4181,13 @@
temporarily prioritize all ChaCha20 ciphers in the servers list. */
if (s->options & SSL_OP_PRIORITIZE_CHACHA && sk_SSL_CIPHER_num(clnt) > 0) {
c = sk_SSL_CIPHER_value(clnt, 0);
- if (c->algorithm_enc == SSL_CHACHA20POLY1305) {
+ if (c->algorithm_enc & SSL_CHACHA20) {
/* ChaCha20 is client preferred, check server... */
int num = sk_SSL_CIPHER_num(srvr);
int found = 0;
for (i = 0; i < num; i++) {
c = sk_SSL_CIPHER_value(srvr, i);
- if (c->algorithm_enc == SSL_CHACHA20POLY1305) {
+ if (c->algorithm_enc & SSL_CHACHA20) {
found = 1;
break;
}
@@ -4200,13 +4200,13 @@
sk_SSL_CIPHER_push(prio_chacha, c);
for (i++; i < num; i++) {
c = sk_SSL_CIPHER_value(srvr, i);
- if (c->algorithm_enc == SSL_CHACHA20POLY1305)
+ if (c->algorithm_enc & SSL_CHACHA20)
sk_SSL_CIPHER_push(prio_chacha, c);
}
/* Pull in the rest */
for (i = 0; i < num; i++) {
c = sk_SSL_CIPHER_value(srvr, i);
- if (c->algorithm_enc != SSL_CHACHA20POLY1305)
+ if (!(c->algorithm_enc & SSL_CHACHA20))
sk_SSL_CIPHER_push(prio_chacha, c);
}
prio = prio_chacha;