Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: net/third_party/nss/ssl/sslinfo.c

Issue 6804032: Add TLS-SRP (RFC 5054) support Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: remove "httpsv" scheme, minor NSS/OpenSSL changes Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/third_party/nss/ssl/sslimpl.h ('k') | net/third_party/nss/ssl/sslproto.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* ***** BEGIN LICENSE BLOCK ***** 1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 * 3 *
4 * The contents of this file are subject to the Mozilla Public License Version 4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with 5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at 6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/ 7 * http://www.mozilla.org/MPL/
8 * 8 *
9 * Software distributed under the License is distributed on an "AS IS" basis, 9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return "NULL"; 47 return "NULL";
48 #ifdef NSS_ENABLE_ZLIB 48 #ifdef NSS_ENABLE_ZLIB
49 case ssl_compression_deflate: 49 case ssl_compression_deflate:
50 return "DEFLATE"; 50 return "DEFLATE";
51 #endif 51 #endif
52 default: 52 default:
53 return "???"; 53 return "???";
54 } 54 }
55 } 55 }
56 56
57 SECStatus
58 SSL_GetChannelUsername(PRFileDesc *fd, SECItem *user)
59 {
60 SECItem * username;
61 sslSocket * ss;
62
63 ss = ssl_FindSocket(fd);
64 if (!ss) {
65 SSL_DBG(("%d: SSL[%d]: bad socket in SSL_GetChannelUsername",
66 SSL_GETPID(), fd));
67 return SECFailure;
68 }
69
70 if (ss->sec.userName == NULL) {
71 PORT_SetError(SEC_ERROR_INVALID_ARGS);
72 return SECFailure;
73 }
74
75 return SECITEM_CopyItem(NULL, user, ss->sec.userName);
76 }
77
57 SECStatus 78 SECStatus
58 SSL_GetChannelInfo(PRFileDesc *fd, SSLChannelInfo *info, PRUintn len) 79 SSL_GetChannelInfo(PRFileDesc *fd, SSLChannelInfo *info, PRUintn len)
59 { 80 {
60 sslSocket * ss; 81 sslSocket * ss;
61 SSLChannelInfo inf; 82 SSLChannelInfo inf;
62 sslSessionID * sid; 83 sslSessionID * sid;
63 PRBool enoughFirstHsDone = PR_FALSE; 84 PRBool enoughFirstHsDone = PR_FALSE;
64 85
65 if (!info || len < sizeof inf.length) { 86 if (!info || len < sizeof inf.length) {
66 PORT_SetError(SEC_ERROR_INVALID_ARGS); 87 PORT_SetError(SEC_ERROR_INVALID_ARGS);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 #define S_DSA "DSA", ssl_auth_dsa 155 #define S_DSA "DSA", ssl_auth_dsa
135 #define S_RSA "RSA", ssl_auth_rsa 156 #define S_RSA "RSA", ssl_auth_rsa
136 #define S_KEA "KEA", ssl_auth_kea 157 #define S_KEA "KEA", ssl_auth_kea
137 #define S_ECDSA "ECDSA", ssl_auth_ecdsa 158 #define S_ECDSA "ECDSA", ssl_auth_ecdsa
138 159
139 #define K_DHE "DHE", kt_dh 160 #define K_DHE "DHE", kt_dh
140 #define K_RSA "RSA", kt_rsa 161 #define K_RSA "RSA", kt_rsa
141 #define K_KEA "KEA", kt_kea 162 #define K_KEA "KEA", kt_kea
142 #define K_ECDH "ECDH", kt_ecdh 163 #define K_ECDH "ECDH", kt_ecdh
143 #define K_ECDHE "ECDHE", kt_ecdh 164 #define K_ECDHE "ECDHE", kt_ecdh
165 #define K_SRP "SRP", ssl_kea_srp
166 #define K_SRP_RSA "SRP_RSA", ssl_kea_srp_rsa
167 #define K_SRP_DSS "SRP_DSS", ssl_kea_srp_dss
144 168
145 #define C_SEED "SEED", calg_seed 169 #define C_SEED "SEED", calg_seed
146 #define C_CAMELLIA "CAMELLIA", calg_camellia 170 #define C_CAMELLIA "CAMELLIA", calg_camellia
147 #define C_AES "AES", calg_aes 171 #define C_AES "AES", calg_aes
148 #define C_RC4 "RC4", calg_rc4 172 #define C_RC4 "RC4", calg_rc4
149 #define C_RC2 "RC2", calg_rc2 173 #define C_RC2 "RC2", calg_rc2
150 #define C_DES "DES", calg_des 174 #define C_DES "DES", calg_des
151 #define C_3DES "3DES", calg_3des 175 #define C_3DES "3DES", calg_3des
152 #define C_NULL "NULL", calg_null 176 #define C_NULL "NULL", calg_null
153 #define C_SJ "SKIPJACK", calg_sj 177 #define C_SJ "SKIPJACK", calg_sj
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 {0,CS(SSL_RSA_FIPS_WITH_DES_CBC_SHA), S_RSA, K_RSA, C_DES, B_DES, M_SHA, 0, 0, 1, }, 218 {0,CS(SSL_RSA_FIPS_WITH_DES_CBC_SHA), S_RSA, K_RSA, C_DES, B_DES, M_SHA, 0, 0, 1, },
195 {0,CS(SSL_RSA_WITH_DES_CBC_SHA), S_RSA, K_RSA, C_DES, B_DES, M_SHA, 0, 0, 0, }, 219 {0,CS(SSL_RSA_WITH_DES_CBC_SHA), S_RSA, K_RSA, C_DES, B_DES, M_SHA, 0, 0, 0, },
196 220
197 {0,CS(TLS_RSA_EXPORT1024_WITH_RC4_56_SHA), S_RSA, K_RSA, C_RC4, B_56, M_SHA, 0, 1, 0, }, 221 {0,CS(TLS_RSA_EXPORT1024_WITH_RC4_56_SHA), S_RSA, K_RSA, C_RC4, B_56, M_SHA, 0, 1, 0, },
198 {0,CS(TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA), S_RSA, K_RSA, C_DES, B_DES, M_SHA, 0, 1, 0, }, 222 {0,CS(TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA), S_RSA, K_RSA, C_DES, B_DES, M_SHA, 0, 1, 0, },
199 {0,CS(SSL_RSA_EXPORT_WITH_RC4_40_MD5), S_RSA, K_RSA, C_RC4, B_40, M_MD5, 0, 1, 0, }, 223 {0,CS(SSL_RSA_EXPORT_WITH_RC4_40_MD5), S_RSA, K_RSA, C_RC4, B_40, M_MD5, 0, 1, 0, },
200 {0,CS(SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5), S_RSA, K_RSA, C_RC2, B_40, M_MD5, 0, 1, 0, }, 224 {0,CS(SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5), S_RSA, K_RSA, C_RC2, B_40, M_MD5, 0, 1, 0, },
201 {0,CS(SSL_RSA_WITH_NULL_SHA), S_RSA, K_RSA, C_NULL,B_0, M_SHA, 0, 1, 0, }, 225 {0,CS(SSL_RSA_WITH_NULL_SHA), S_RSA, K_RSA, C_NULL,B_0, M_SHA, 0, 1, 0, },
202 {0,CS(SSL_RSA_WITH_NULL_MD5), S_RSA, K_RSA, C_NULL,B_0, M_MD5, 0, 1, 0, }, 226 {0,CS(SSL_RSA_WITH_NULL_MD5), S_RSA, K_RSA, C_NULL,B_0, M_MD5, 0, 1, 0, },
203 227
228 /* SRP cipher suites */
229 {0,CS(TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA), S_KEA, K_SRP, C_3DES,B_3DES,M_SHA, 0, 0, 0, },
230 {0,CS(TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA), S_KEA, K_SRP_RSA, C_3DES,B_3DES,M_ SHA, 0, 0, 0, },
231 {0,CS(TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA), S_KEA, K_SRP_DSS, C_3DES,B_3DES,M_ SHA, 0, 0, 0, },
232 {0,CS(TLS_SRP_SHA_WITH_AES_128_CBC_SHA), S_KEA, K_SRP, C_AES, B_128, M_SHA, 0, 0, 0, },
233 {0,CS(TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA), S_KEA, K_SRP_RSA, C_AES, B_128, M_ SHA, 0, 0, 0, },
234 {0,CS(TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA), S_KEA, K_SRP_DSS, C_AES, B_128, M_ SHA, 0, 0, 0, },
235 {0,CS(TLS_SRP_SHA_WITH_AES_256_CBC_SHA), S_KEA, K_SRP, C_AES, B_256, M_SHA, 0, 0, 0, },
236 {0,CS(TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA), S_KEA, K_SRP_RSA, C_AES, B_256, M_ SHA, 0, 0, 0, },
237 {0,CS(TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA), S_KEA, K_SRP_DSS, C_AES, B_256, M_ SHA, 0, 0, 0, },
238
204 #ifdef NSS_ENABLE_ECC 239 #ifdef NSS_ENABLE_ECC
205 /* ECC cipher suites */ 240 /* ECC cipher suites */
206 {0,CS(TLS_ECDH_ECDSA_WITH_NULL_SHA), S_ECDSA, K_ECDH, C_NULL, B_0, M_SH A, 0, 0, 0, }, 241 {0,CS(TLS_ECDH_ECDSA_WITH_NULL_SHA), S_ECDSA, K_ECDH, C_NULL, B_0, M_SH A, 0, 0, 0, },
207 {0,CS(TLS_ECDH_ECDSA_WITH_RC4_128_SHA), S_ECDSA, K_ECDH, C_RC4, B_128, M_S HA, 0, 0, 0, }, 242 {0,CS(TLS_ECDH_ECDSA_WITH_RC4_128_SHA), S_ECDSA, K_ECDH, C_RC4, B_128, M_S HA, 0, 0, 0, },
208 {0,CS(TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA), S_ECDSA, K_ECDH, C_3DES, B_3DES, M _SHA, 1, 0, 0, }, 243 {0,CS(TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA), S_ECDSA, K_ECDH, C_3DES, B_3DES, M _SHA, 1, 0, 0, },
209 {0,CS(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA), S_ECDSA, K_ECDH, C_AES, B_128, M_S HA, 1, 0, 0, }, 244 {0,CS(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA), S_ECDSA, K_ECDH, C_AES, B_128, M_S HA, 1, 0, 0, },
210 {0,CS(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA), S_ECDSA, K_ECDH, C_AES, B_256, M_S HA, 1, 0, 0, }, 245 {0,CS(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA), S_ECDSA, K_ECDH, C_AES, B_256, M_S HA, 1, 0, 0, },
211 246
212 {0,CS(TLS_ECDHE_ECDSA_WITH_NULL_SHA), S_ECDSA, K_ECDHE, C_NULL, B_0, M_S HA, 0, 0, 0, }, 247 {0,CS(TLS_ECDHE_ECDSA_WITH_NULL_SHA), S_ECDSA, K_ECDHE, C_NULL, B_0, M_S HA, 0, 0, 0, },
213 {0,CS(TLS_ECDHE_ECDSA_WITH_RC4_128_SHA), S_ECDSA, K_ECDHE, C_RC4, B_128, M_ SHA, 0, 0, 0, }, 248 {0,CS(TLS_ECDHE_ECDSA_WITH_RC4_128_SHA), S_ECDSA, K_ECDHE, C_RC4, B_128, M_ SHA, 0, 0, 0, },
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 sniName = PORT_ZNew(SECItem); 383 sniName = PORT_ZNew(SECItem);
349 if (!sniName) { 384 if (!sniName) {
350 PORT_Free(name); 385 PORT_Free(name);
351 return NULL; 386 return NULL;
352 } 387 }
353 sniName->data = (void*)name; 388 sniName->data = (void*)name;
354 sniName->len = PORT_Strlen(name); 389 sniName->len = PORT_Strlen(name);
355 } 390 }
356 return sniName; 391 return sniName;
357 } 392 }
OLDNEW
« no previous file with comments | « net/third_party/nss/ssl/sslimpl.h ('k') | net/third_party/nss/ssl/sslproto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698