Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * vtables (and methods that call through them) for the 4 types of | 2 * vtables (and methods that call through them) for the 4 types of |
| 3 * SSLSockets supported. Only one type is still supported. | 3 * SSLSockets supported. Only one type is still supported. |
| 4 * Various other functions. | 4 * Various other functions. |
| 5 * | 5 * |
| 6 * ***** BEGIN LICENSE BLOCK ***** | 6 * ***** BEGIN LICENSE BLOCK ***** |
| 7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 8 * | 8 * |
| 9 * The contents of this file are subject to the Mozilla Public License Version | 9 * The contents of this file are subject to the Mozilla Public License Version |
| 10 * 1.1 (the "License"); you may not use this file except in compliance with | 10 * 1.1 (the "License"); you may not use this file except in compliance with |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 #ifdef NSS_PLATFORM_CLIENT_AUTH | 366 #ifdef NSS_PLATFORM_CLIENT_AUTH |
| 367 ss->getPlatformClientAuthData = os->getPlatformClientAuthData; | 367 ss->getPlatformClientAuthData = os->getPlatformClientAuthData; |
| 368 ss->getPlatformClientAuthDataArg = os->getPlatformClientAuthDataArg; | 368 ss->getPlatformClientAuthDataArg = os->getPlatformClientAuthDataArg; |
| 369 #endif | 369 #endif |
| 370 ss->sniSocketConfig = os->sniSocketConfig; | 370 ss->sniSocketConfig = os->sniSocketConfig; |
| 371 ss->sniSocketConfigArg = os->sniSocketConfigArg; | 371 ss->sniSocketConfigArg = os->sniSocketConfigArg; |
| 372 ss->handleBadCert = os->handleBadCert; | 372 ss->handleBadCert = os->handleBadCert; |
| 373 ss->badCertArg = os->badCertArg; | 373 ss->badCertArg = os->badCertArg; |
| 374 ss->handshakeCallback = os->handshakeCallback; | 374 ss->handshakeCallback = os->handshakeCallback; |
| 375 ss->handshakeCallbackData = os->handshakeCallbackData; | 375 ss->handshakeCallbackData = os->handshakeCallbackData; |
| 376 ss->pkcs11PinArg = os->pkcs11PinArg; | 376 ss->pkcs11PinArg = os->pkcs11PinArg; |
|
wtc
2012/05/31 00:36:32
Copy os->channelIDCallback and its argument.
agl
2012/05/31 17:19:53
Done.
| |
| 377 | 377 |
| 378 /* Create security data */ | 378 /* Create security data */ |
| 379 rv = ssl_CopySecurityInfo(ss, os); | 379 rv = ssl_CopySecurityInfo(ss, os); |
| 380 if (rv != SECSuccess) { | 380 if (rv != SECSuccess) { |
| 381 goto loser; | 381 goto loser; |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 return ss; | 385 return ss; |
| 386 | 386 |
| (...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1680 ss->sniSocketConfigArg = sm->sniSocketConfigArg; | 1680 ss->sniSocketConfigArg = sm->sniSocketConfigArg; |
| 1681 if (sm->handleBadCert) | 1681 if (sm->handleBadCert) |
| 1682 ss->handleBadCert = sm->handleBadCert; | 1682 ss->handleBadCert = sm->handleBadCert; |
| 1683 if (sm->badCertArg) | 1683 if (sm->badCertArg) |
| 1684 ss->badCertArg = sm->badCertArg; | 1684 ss->badCertArg = sm->badCertArg; |
| 1685 if (sm->handshakeCallback) | 1685 if (sm->handshakeCallback) |
| 1686 ss->handshakeCallback = sm->handshakeCallback; | 1686 ss->handshakeCallback = sm->handshakeCallback; |
| 1687 if (sm->handshakeCallbackData) | 1687 if (sm->handshakeCallbackData) |
| 1688 ss->handshakeCallbackData = sm->handshakeCallbackData; | 1688 ss->handshakeCallbackData = sm->handshakeCallbackData; |
| 1689 if (sm->pkcs11PinArg) | 1689 if (sm->pkcs11PinArg) |
| 1690 ss->pkcs11PinArg = sm->pkcs11PinArg; | 1690 ss->pkcs11PinArg = sm->pkcs11PinArg; |
|
wtc
2012/05/31 00:36:32
Copy sm->channelIDCallback and its argument.
agl
2012/05/31 17:19:53
Done.
| |
| 1691 return fd; | 1691 return fd; |
| 1692 loser: | 1692 loser: |
| 1693 return NULL; | 1693 return NULL; |
| 1694 #endif | 1694 #endif |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 PRBool | 1697 PRBool |
| 1698 ssl3_VersionIsSupported(SSLProtocolVariant protocolVariant, | 1698 ssl3_VersionIsSupported(SSLProtocolVariant protocolVariant, |
| 1699 SSL3ProtocolVersion version) | 1699 SSL3ProtocolVersion version) |
| 1700 { | 1700 { |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1871 if (!ss) { | 1871 if (!ss) { |
| 1872 SSL_DBG(("%d: SSL[%d]: bad socket in SSL_HandshakeResumedSession", | 1872 SSL_DBG(("%d: SSL[%d]: bad socket in SSL_HandshakeResumedSession", |
| 1873 SSL_GETPID(), fd)); | 1873 SSL_GETPID(), fd)); |
| 1874 return SECFailure; | 1874 return SECFailure; |
| 1875 } | 1875 } |
| 1876 | 1876 |
| 1877 *handshake_resumed = ss->ssl3.hs.isResuming; | 1877 *handshake_resumed = ss->ssl3.hs.isResuming; |
| 1878 return SECSuccess; | 1878 return SECSuccess; |
| 1879 } | 1879 } |
| 1880 | 1880 |
| 1881 SECStatus | |
| 1882 SSL_SetClientChannelIDCallback(PRFileDesc *fd, | |
|
wtc
2012/05/31 00:36:32
Define this function in sslauth.c, right below the
agl
2012/05/31 17:19:53
Done.
| |
| 1883 SSLClientChannelIDCallback callback, | |
| 1884 void *arg) { | |
| 1885 sslSocket *ss = ssl_FindSocket(fd); | |
| 1886 | |
| 1887 if (!ss) { | |
| 1888 SSL_DBG(("%d: SSL[%d]: bad socket in SSL_SetClientChannelIDCallback", | |
| 1889 SSL_GETPID(), fd)); | |
| 1890 return SECFailure; | |
| 1891 } | |
| 1892 | |
| 1893 ss->ssl3.channelIDCallback = callback; | |
| 1894 ss->ssl3.channelIDCallbackArg = arg; | |
| 1895 | |
| 1896 return SECSuccess; | |
| 1897 } | |
| 1898 | |
| 1881 const SECItem * | 1899 const SECItem * |
| 1882 SSL_GetRequestedClientCertificateTypes(PRFileDesc *fd) | 1900 SSL_GetRequestedClientCertificateTypes(PRFileDesc *fd) |
| 1883 { | 1901 { |
| 1884 sslSocket *ss = ssl_FindSocket(fd); | 1902 sslSocket *ss = ssl_FindSocket(fd); |
| 1885 | 1903 |
| 1886 if (!ss) { | 1904 if (!ss) { |
| 1887 SSL_DBG(("%d: SSL[%d]: bad socket in " | 1905 SSL_DBG(("%d: SSL[%d]: bad socket in " |
| 1888 "SSL_GetRequestedClientCertificateTypes", SSL_GETPID(), fd)); | 1906 "SSL_GetRequestedClientCertificateTypes", SSL_GETPID(), fd)); |
| 1889 return NULL; | 1907 return NULL; |
| 1890 } | 1908 } |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2930 ss->authCertificateArg = (void *)ss->dbHandle; | 2948 ss->authCertificateArg = (void *)ss->dbHandle; |
| 2931 ss->sniSocketConfig = NULL; | 2949 ss->sniSocketConfig = NULL; |
| 2932 ss->sniSocketConfigArg = NULL; | 2950 ss->sniSocketConfigArg = NULL; |
| 2933 ss->getClientAuthData = NULL; | 2951 ss->getClientAuthData = NULL; |
| 2934 #ifdef NSS_PLATFORM_CLIENT_AUTH | 2952 #ifdef NSS_PLATFORM_CLIENT_AUTH |
| 2935 ss->getPlatformClientAuthData = NULL; | 2953 ss->getPlatformClientAuthData = NULL; |
| 2936 ss->getPlatformClientAuthDataArg = NULL; | 2954 ss->getPlatformClientAuthDataArg = NULL; |
| 2937 #endif /* NSS_PLATFORM_CLIENT_AUTH */ | 2955 #endif /* NSS_PLATFORM_CLIENT_AUTH */ |
| 2938 ss->handleBadCert = NULL; | 2956 ss->handleBadCert = NULL; |
| 2939 ss->badCertArg = NULL; | 2957 ss->badCertArg = NULL; |
| 2940 ss->pkcs11PinArg = NULL; | 2958 ss->pkcs11PinArg = NULL; |
|
wtc
2012/05/31 00:36:32
Initialize ss->channelIDCallback and its argument
agl
2012/05/31 17:19:53
Done.
| |
| 2941 | 2959 |
| 2942 ssl_ChooseOps(ss); | 2960 ssl_ChooseOps(ss); |
| 2943 ssl2_InitSocketPolicy(ss); | 2961 ssl2_InitSocketPolicy(ss); |
| 2944 ssl3_InitSocketPolicy(ss); | 2962 ssl3_InitSocketPolicy(ss); |
| 2945 | 2963 |
| 2946 if (makeLocks) { | 2964 if (makeLocks) { |
| 2947 status = ssl_MakeLocks(ss); | 2965 status = ssl_MakeLocks(ss); |
| 2948 if (status != SECSuccess) | 2966 if (status != SECSuccess) |
| 2949 goto loser; | 2967 goto loser; |
| 2950 } | 2968 } |
| 2951 status = ssl_CreateSecurityInfo(ss); | 2969 status = ssl_CreateSecurityInfo(ss); |
| 2952 if (status != SECSuccess) | 2970 if (status != SECSuccess) |
| 2953 goto loser; | 2971 goto loser; |
| 2954 status = ssl_InitGather(&ss->gs); | 2972 status = ssl_InitGather(&ss->gs); |
| 2955 if (status != SECSuccess) { | 2973 if (status != SECSuccess) { |
| 2956 loser: | 2974 loser: |
| 2957 ssl_DestroySocketContents(ss); | 2975 ssl_DestroySocketContents(ss); |
| 2958 ssl_DestroyLocks(ss); | 2976 ssl_DestroyLocks(ss); |
| 2959 PORT_Free(ss); | 2977 PORT_Free(ss); |
| 2960 ss = NULL; | 2978 ss = NULL; |
| 2961 } | 2979 } |
| 2962 ss->protocolVariant = protocolVariant; | 2980 ss->protocolVariant = protocolVariant; |
| 2963 } | 2981 } |
| 2964 return ss; | 2982 return ss; |
| 2965 } | 2983 } |
| 2966 | 2984 |
| OLD | NEW |