OLD | NEW |
1 diff --git a/nss/lib/ssl/ssl.h b/nss/lib/ssl/ssl.h | 1 diff -pu a/nss/lib/ssl/ssl3con.c b/nss/lib/ssl/ssl3con.c |
2 index 4cf02aa..24627ed 100644 | 2 --- a/nss/lib/ssl/ssl3con.c» 2014-01-03 19:44:16.406720764 -0800 |
3 --- a/nss/lib/ssl/ssl.h | 3 +++ b/nss/lib/ssl/ssl3con.c» 2014-01-03 19:44:24.516853386 -0800 |
4 +++ b/nss/lib/ssl/ssl.h | 4 @@ -12539,6 +12539,46 @@ ssl3_CipherPrefGet(sslSocket *ss, ssl3Ci |
5 @@ -265,6 +265,13 @@ SSL_IMPORT SECStatus SSL_CipherPrefGetDefault(PRInt32 ciphe
r, PRBool *enabled); | |
6 SSL_IMPORT SECStatus SSL_CipherPolicySet(PRInt32 cipher, PRInt32 policy); | |
7 SSL_IMPORT SECStatus SSL_CipherPolicyGet(PRInt32 cipher, PRInt32 *policy); | |
8 | |
9 +/* SSL_CipherOrderSet sets the cipher suite preference order from |ciphers|, | |
10 + * which must be an array of cipher suite ids of length |len|. All the given | |
11 + * cipher suite ids must appear in the array that is returned by | |
12 + * |SSL_GetImplementedCiphers| and may only appear once, at most. */ | |
13 +SSL_IMPORT SECStatus SSL_CipherOrderSet(PRFileDesc *fd, const PRUint16 *ciphers
, | |
14 + unsigned int len); | |
15 + | |
16 /* SSLChannelBindingType enumerates the types of supported channel binding | |
17 * values. See RFC 5929. */ | |
18 typedef enum SSLChannelBindingType { | |
19 diff --git a/nss/lib/ssl/ssl3con.c b/nss/lib/ssl/ssl3con.c | |
20 index c2d9eeb..350d09c 100644 | |
21 --- a/nss/lib/ssl/ssl3con.c | |
22 +++ b/nss/lib/ssl/ssl3con.c | |
23 @@ -12423,6 +12423,46 @@ ssl3_CipherPrefGet(sslSocket *ss, ssl3CipherSuite which
, PRBool *enabled) | |
24 return rv; | 5 return rv; |
25 } | 6 } |
26 | 7 |
27 +SECStatus | 8 +SECStatus |
28 +ssl3_CipherOrderSet(sslSocket *ss, const ssl3CipherSuite *ciphers, unsigned int
len) | 9 +ssl3_CipherOrderSet(sslSocket *ss, const ssl3CipherSuite *ciphers, unsigned int
len) |
29 +{ | 10 +{ |
30 + /* |i| iterates over |ciphers| while |done| and |j| iterate over | 11 + /* |i| iterates over |ciphers| while |done| and |j| iterate over |
31 + * |ss->cipherSuites|. */ | 12 + * |ss->cipherSuites|. */ |
32 + unsigned int i, done; | 13 + unsigned int i, done; |
33 + | 14 + |
(...skipping 26 matching lines...) Expand all Loading... |
60 + for (; done < ssl_V3_SUITES_IMPLEMENTED; done++) { | 41 + for (; done < ssl_V3_SUITES_IMPLEMENTED; done++) { |
61 + ss->cipherSuites[done].enabled = 0; | 42 + ss->cipherSuites[done].enabled = 0; |
62 + } | 43 + } |
63 + | 44 + |
64 + return SECSuccess; | 45 + return SECSuccess; |
65 +} | 46 +} |
66 + | 47 + |
67 /* copy global default policy into socket. */ | 48 /* copy global default policy into socket. */ |
68 void | 49 void |
69 ssl3_InitSocketPolicy(sslSocket *ss) | 50 ssl3_InitSocketPolicy(sslSocket *ss) |
70 diff --git a/nss/lib/ssl/sslimpl.h b/nss/lib/ssl/sslimpl.h | 51 diff -pu a/nss/lib/ssl/ssl.h b/nss/lib/ssl/ssl.h |
71 index 1e4655f..7521dba 100644 | 52 --- a/nss/lib/ssl/ssl.h»2014-01-03 19:44:16.416720928 -0800 |
72 --- a/nss/lib/ssl/sslimpl.h | 53 +++ b/nss/lib/ssl/ssl.h»2014-01-03 19:44:24.516853386 -0800 |
73 +++ b/nss/lib/ssl/sslimpl.h | 54 @@ -265,6 +265,13 @@ SSL_IMPORT SECStatus SSL_CipherPrefGetDe |
74 @@ -1711,6 +1711,8 @@ extern SECStatus ssl3_CipherPrefSet(sslSocket *ss, ssl3Cip
herSuite which, PRBool | 55 SSL_IMPORT SECStatus SSL_CipherPolicySet(PRInt32 cipher, PRInt32 policy); |
| 56 SSL_IMPORT SECStatus SSL_CipherPolicyGet(PRInt32 cipher, PRInt32 *policy); |
| 57 |
| 58 +/* SSL_CipherOrderSet sets the cipher suite preference order from |ciphers|, |
| 59 + * which must be an array of cipher suite ids of length |len|. All the given |
| 60 + * cipher suite ids must appear in the array that is returned by |
| 61 + * |SSL_GetImplementedCiphers| and may only appear once, at most. */ |
| 62 +SSL_IMPORT SECStatus SSL_CipherOrderSet(PRFileDesc *fd, const PRUint16 *ciphers
, |
| 63 + unsigned int len); |
| 64 + |
| 65 /* SSLChannelBindingType enumerates the types of supported channel binding |
| 66 * values. See RFC 5929. */ |
| 67 typedef enum SSLChannelBindingType { |
| 68 diff -pu a/nss/lib/ssl/sslimpl.h b/nss/lib/ssl/sslimpl.h |
| 69 --- a/nss/lib/ssl/sslimpl.h» 2014-01-03 19:44:16.416720928 -0800 |
| 70 +++ b/nss/lib/ssl/sslimpl.h» 2014-01-03 19:44:24.516853386 -0800 |
| 71 @@ -1741,6 +1741,8 @@ extern SECStatus ssl3_CipherPrefSet(sslS |
75 extern SECStatus ssl3_CipherPrefGet(sslSocket *ss, ssl3CipherSuite which, PRBoo
l *on); | 72 extern SECStatus ssl3_CipherPrefGet(sslSocket *ss, ssl3CipherSuite which, PRBoo
l *on); |
76 extern SECStatus ssl2_CipherPrefSet(sslSocket *ss, PRInt32 which, PRBool enable
d); | 73 extern SECStatus ssl2_CipherPrefSet(sslSocket *ss, PRInt32 which, PRBool enable
d); |
77 extern SECStatus ssl2_CipherPrefGet(sslSocket *ss, PRInt32 which, PRBool *enabl
ed); | 74 extern SECStatus ssl2_CipherPrefGet(sslSocket *ss, PRInt32 which, PRBool *enabl
ed); |
78 +extern SECStatus ssl3_CipherOrderSet(sslSocket *ss, const ssl3CipherSuite *ciph
er, | 75 +extern SECStatus ssl3_CipherOrderSet(sslSocket *ss, const ssl3CipherSuite *ciph
er, |
79 + unsigned int len); | 76 + unsigned int len); |
80 | 77 |
81 extern SECStatus ssl3_SetPolicy(ssl3CipherSuite which, PRInt32 policy); | 78 extern SECStatus ssl3_SetPolicy(ssl3CipherSuite which, PRInt32 policy); |
82 extern SECStatus ssl3_GetPolicy(ssl3CipherSuite which, PRInt32 *policy); | 79 extern SECStatus ssl3_GetPolicy(ssl3CipherSuite which, PRInt32 *policy); |
83 diff --git a/nss/lib/ssl/sslsock.c b/nss/lib/ssl/sslsock.c | 80 diff -pu a/nss/lib/ssl/sslsock.c b/nss/lib/ssl/sslsock.c |
84 index 965215d..9f8286c 100644 | 81 --- a/nss/lib/ssl/sslsock.c» 2014-01-03 19:44:16.416720928 -0800 |
85 --- a/nss/lib/ssl/sslsock.c | 82 +++ b/nss/lib/ssl/sslsock.c» 2014-01-03 19:44:24.516853386 -0800 |
86 +++ b/nss/lib/ssl/sslsock.c | 83 @@ -1256,6 +1256,19 @@ SSL_CipherPrefSet(PRFileDesc *fd, PRInt3 |
87 @@ -1344,6 +1344,19 @@ SSL_CipherPrefSet(PRFileDesc *fd, PRInt32 which, PRBool e
nabled) | |
88 return rv; | 84 return rv; |
89 } | 85 } |
90 | 86 |
91 +SECStatus | 87 +SECStatus |
92 +SSL_CipherOrderSet(PRFileDesc *fd, const PRUint16 *ciphers, unsigned int len) | 88 +SSL_CipherOrderSet(PRFileDesc *fd, const PRUint16 *ciphers, unsigned int len) |
93 +{ | 89 +{ |
94 + sslSocket *ss = ssl_FindSocket(fd); | 90 + sslSocket *ss = ssl_FindSocket(fd); |
95 + | 91 + |
96 + if (!ss) { | 92 + if (!ss) { |
97 + SSL_DBG(("%d: SSL[%d]: bad socket in CipherOrderSet", SSL_GETPID(), | 93 + SSL_DBG(("%d: SSL[%d]: bad socket in CipherOrderSet", SSL_GETPID(), |
98 + fd)); | 94 + fd)); |
99 + return SECFailure; | 95 + return SECFailure; |
100 + } | 96 + } |
101 + return ssl3_CipherOrderSet(ss, ciphers, len); | 97 + return ssl3_CipherOrderSet(ss, ciphers, len); |
102 +} | 98 +} |
103 + | 99 + |
104 SECStatus | 100 SECStatus |
105 SSL_CipherPrefGet(PRFileDesc *fd, PRInt32 which, PRBool *enabled) | 101 SSL_CipherPrefGet(PRFileDesc *fd, PRInt32 which, PRBool *enabled) |
106 { | 102 { |
OLD | NEW |