OLD | NEW |
(Empty) | |
| 1 Index: net/third_party/nss/ssl/ssl.h |
| 2 =================================================================== |
| 3 --- net/third_party/nss/ssl/ssl.h (revision 63749) |
| 4 +++ net/third_party/nss/ssl/ssl.h (revision 63750) |
| 5 @@ -273,6 +273,17 @@ |
| 6 SSL_IMPORT CERTCertificate *SSL_PeerCertificate(PRFileDesc *fd); |
| 7 |
| 8 /* |
| 9 +** Return references to the certificates presented by the SSL peer. On entry, |
| 10 +** |*certs_size| must contain the size of the |certs| array. On successful |
| 11 +** return, |*certs_size| contains the number of certificates available and |
| 12 +** |certs| will contain references to as many certificates as would fit. |
| 13 +** Therefore if, on exit, |*certs_size| contains a value less than, or equal to
, |
| 14 +** the entry value then all certificates were returned. |
| 15 +*/ |
| 16 +SSL_IMPORT SECStatus SSL_PeerCertificateChain( |
| 17 + PRFileDesc *fd, CERTCertificate **certs, unsigned int *certs_size); |
| 18 + |
| 19 +/* |
| 20 ** Authenticate certificate hook. Called when a certificate comes in |
| 21 ** (because of SSL_REQUIRE_CERTIFICATE in SSL_Enable) to authenticate the |
| 22 ** certificate. |
| 23 Index: net/third_party/nss/ssl/sslauth.c |
| 24 =================================================================== |
| 25 --- net/third_party/nss/ssl/sslauth.c (revision 63749) |
| 26 +++ net/third_party/nss/ssl/sslauth.c (revision 63750) |
| 27 @@ -60,6 +60,42 @@ |
| 28 } |
| 29 |
| 30 /* NEED LOCKS IN HERE. */ |
| 31 +SECStatus |
| 32 +SSL_PeerCertificateChain(PRFileDesc *fd, CERTCertificate **certs, |
| 33 + unsigned int *certsSize) |
| 34 +{ |
| 35 + sslSocket *ss; |
| 36 + unsigned int inSize = *certsSize; |
| 37 + ssl3CertNode* cur; |
| 38 + |
| 39 + ss = ssl_FindSocket(fd); |
| 40 + if (!ss) { |
| 41 + SSL_DBG(("%d: SSL[%d]: bad socket in PeerCertificateChain", |
| 42 + SSL_GETPID(), fd)); |
| 43 + return SECFailure; |
| 44 + } |
| 45 + if (!ss->opt.useSecurity) |
| 46 + return SECFailure; |
| 47 + |
| 48 + if (ss->sec.peerCert == NULL) { |
| 49 + *certsSize = 0; |
| 50 + return SECSuccess; |
| 51 + } |
| 52 + |
| 53 + *certsSize = 1; /* for the leaf certificate */ |
| 54 + if (inSize > 0) |
| 55 + certs[0] = CERT_DupCertificate(ss->sec.peerCert); |
| 56 + |
| 57 + for (cur = ss->ssl3.peerCertChain; cur; cur = cur->next) { |
| 58 + if (*certsSize < inSize) |
| 59 + certs[*certsSize] = CERT_DupCertificate(cur->cert); |
| 60 + (*certsSize)++; |
| 61 + } |
| 62 + |
| 63 + return SECSuccess; |
| 64 +} |
| 65 + |
| 66 +/* NEED LOCKS IN HERE. */ |
| 67 CERTCertificate * |
| 68 SSL_LocalCertificate(PRFileDesc *fd) |
| 69 { |
| 70 Index: net/third_party/nss/ssl/ssl.def |
| 71 =================================================================== |
| 72 --- net/third_party/nss/ssl/ssl.def (revision 63749) |
| 73 +++ net/third_party/nss/ssl/ssl.def (revision 63750) |
| 74 @@ -163,6 +163,7 @@ |
| 75 ;+ global: |
| 76 SSL_GetPredictedServerHelloData; |
| 77 SSL_GetSnapStartResult; |
| 78 +SSL_PeerCertificateChain; |
| 79 SSL_SetPredictedPeerCertificates; |
| 80 SSL_SetPredictedServerHelloData; |
| 81 SSL_SetSnapStartApplicationData; |
OLD | NEW |