| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 PR_TRUE, /* detectRollBack */ | 179 PR_TRUE, /* detectRollBack */ |
| 180 PR_FALSE, /* noStepDown */ | 180 PR_FALSE, /* noStepDown */ |
| 181 PR_FALSE, /* bypassPKCS11 */ | 181 PR_FALSE, /* bypassPKCS11 */ |
| 182 PR_FALSE, /* noLocks */ | 182 PR_FALSE, /* noLocks */ |
| 183 PR_FALSE, /* enableSessionTickets */ | 183 PR_FALSE, /* enableSessionTickets */ |
| 184 PR_FALSE, /* enableDeflate */ | 184 PR_FALSE, /* enableDeflate */ |
| 185 2, /* enableRenegotiation (default: requires extension) */ | 185 2, /* enableRenegotiation (default: requires extension) */ |
| 186 PR_FALSE, /* requireSafeNegotiation */ | 186 PR_FALSE, /* requireSafeNegotiation */ |
| 187 PR_FALSE, /* enableFalseStart */ | 187 PR_FALSE, /* enableFalseStart */ |
| 188 PR_FALSE, /* enableOCSPStapling */ | 188 PR_FALSE, /* enableOCSPStapling */ |
| 189 PR_FALSE, /* enableCachedInfo */ |
| 189 }; | 190 }; |
| 190 | 191 |
| 191 sslSessionIDLookupFunc ssl_sid_lookup; | 192 sslSessionIDLookupFunc ssl_sid_lookup; |
| 192 sslSessionIDCacheFunc ssl_sid_cache; | 193 sslSessionIDCacheFunc ssl_sid_cache; |
| 193 sslSessionIDUncacheFunc ssl_sid_uncache; | 194 sslSessionIDUncacheFunc ssl_sid_uncache; |
| 194 | 195 |
| 195 static PRBool ssl_inited = PR_FALSE; | 196 static PRBool ssl_inited = PR_FALSE; |
| 196 static PRDescIdentity ssl_layer_id; | 197 static PRDescIdentity ssl_layer_id; |
| 197 | 198 |
| 198 PRBool locksEverDisabled; /* implicitly PR_FALSE */ | 199 PRBool locksEverDisabled; /* implicitly PR_FALSE */ |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 break; | 741 break; |
| 741 | 742 |
| 742 case SSL_ENABLE_FALSE_START: | 743 case SSL_ENABLE_FALSE_START: |
| 743 ss->opt.enableFalseStart = on; | 744 ss->opt.enableFalseStart = on; |
| 744 break; | 745 break; |
| 745 | 746 |
| 746 case SSL_ENABLE_OCSP_STAPLING: | 747 case SSL_ENABLE_OCSP_STAPLING: |
| 747 ss->opt.enableOCSPStapling = on; | 748 ss->opt.enableOCSPStapling = on; |
| 748 break; | 749 break; |
| 749 | 750 |
| 751 case SSL_ENABLE_CACHED_INFO: |
| 752 ss->opt.enableCachedInfo = on; |
| 753 break; |
| 754 |
| 750 default: | 755 default: |
| 751 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 756 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 752 rv = SECFailure; | 757 rv = SECFailure; |
| 753 } | 758 } |
| 754 | 759 |
| 755 /* We can't use the macros for releasing the locks here, | 760 /* We can't use the macros for releasing the locks here, |
| 756 * because ss->opt.noLocks might have changed just above. | 761 * because ss->opt.noLocks might have changed just above. |
| 757 * We must release these locks (monitors) here, if we aquired them above, | 762 * We must release these locks (monitors) here, if we aquired them above, |
| 758 * regardless of the current value of ss->opt.noLocks. | 763 * regardless of the current value of ss->opt.noLocks. |
| 759 */ | 764 */ |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 case SSL_ENABLE_SESSION_TICKETS: | 810 case SSL_ENABLE_SESSION_TICKETS: |
| 806 on = ss->opt.enableSessionTickets; | 811 on = ss->opt.enableSessionTickets; |
| 807 break; | 812 break; |
| 808 case SSL_ENABLE_DEFLATE: on = ss->opt.enableDeflate; break; | 813 case SSL_ENABLE_DEFLATE: on = ss->opt.enableDeflate; break; |
| 809 case SSL_ENABLE_RENEGOTIATION: | 814 case SSL_ENABLE_RENEGOTIATION: |
| 810 on = ss->opt.enableRenegotiation; break; | 815 on = ss->opt.enableRenegotiation; break; |
| 811 case SSL_REQUIRE_SAFE_NEGOTIATION: | 816 case SSL_REQUIRE_SAFE_NEGOTIATION: |
| 812 on = ss->opt.requireSafeNegotiation; break; | 817 on = ss->opt.requireSafeNegotiation; break; |
| 813 case SSL_ENABLE_FALSE_START: on = ss->opt.enableFalseStart; break; | 818 case SSL_ENABLE_FALSE_START: on = ss->opt.enableFalseStart; break; |
| 814 case SSL_ENABLE_OCSP_STAPLING: on = ss->opt.enableOCSPStapling; break; | 819 case SSL_ENABLE_OCSP_STAPLING: on = ss->opt.enableOCSPStapling; break; |
| 820 case SSL_ENABLE_CACHED_INFO: on = ss->opt.enableCachedInfo; break; |
| 815 | 821 |
| 816 default: | 822 default: |
| 817 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 823 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 818 rv = SECFailure; | 824 rv = SECFailure; |
| 819 } | 825 } |
| 820 | 826 |
| 821 ssl_ReleaseSSL3HandshakeLock(ss); | 827 ssl_ReleaseSSL3HandshakeLock(ss); |
| 822 ssl_Release1stHandshakeLock(ss); | 828 ssl_Release1stHandshakeLock(ss); |
| 823 | 829 |
| 824 *pOn = on; | 830 *pOn = on; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 case SSL_ENABLE_DEFLATE: on = ssl_defaults.enableDeflate; break; | 865 case SSL_ENABLE_DEFLATE: on = ssl_defaults.enableDeflate; break; |
| 860 case SSL_ENABLE_RENEGOTIATION: | 866 case SSL_ENABLE_RENEGOTIATION: |
| 861 on = ssl_defaults.enableRenegotiation; break; | 867 on = ssl_defaults.enableRenegotiation; break; |
| 862 case SSL_REQUIRE_SAFE_NEGOTIATION: | 868 case SSL_REQUIRE_SAFE_NEGOTIATION: |
| 863 on = ssl_defaults.requireSafeNegotiation; | 869 on = ssl_defaults.requireSafeNegotiation; |
| 864 break; | 870 break; |
| 865 case SSL_ENABLE_FALSE_START: on = ssl_defaults.enableFalseStart; break; | 871 case SSL_ENABLE_FALSE_START: on = ssl_defaults.enableFalseStart; break; |
| 866 case SSL_ENABLE_OCSP_STAPLING: | 872 case SSL_ENABLE_OCSP_STAPLING: |
| 867 on = ssl_defaults.enableOCSPStapling; | 873 on = ssl_defaults.enableOCSPStapling; |
| 868 break; | 874 break; |
| 875 case SSL_ENABLE_CACHED_INFO: on = ssl_defaults.enableCachedInfo; break; |
| 869 | 876 |
| 870 default: | 877 default: |
| 871 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 878 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 872 rv = SECFailure; | 879 rv = SECFailure; |
| 873 } | 880 } |
| 874 | 881 |
| 875 *pOn = on; | 882 *pOn = on; |
| 876 return rv; | 883 return rv; |
| 877 } | 884 } |
| 878 | 885 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 break; | 1017 break; |
| 1011 | 1018 |
| 1012 case SSL_ENABLE_FALSE_START: | 1019 case SSL_ENABLE_FALSE_START: |
| 1013 ssl_defaults.enableFalseStart = on; | 1020 ssl_defaults.enableFalseStart = on; |
| 1014 break; | 1021 break; |
| 1015 | 1022 |
| 1016 case SSL_ENABLE_OCSP_STAPLING: | 1023 case SSL_ENABLE_OCSP_STAPLING: |
| 1017 ssl_defaults.enableOCSPStapling = on; | 1024 ssl_defaults.enableOCSPStapling = on; |
| 1018 break; | 1025 break; |
| 1019 | 1026 |
| 1027 case SSL_ENABLE_CACHED_INFO: |
| 1028 ssl_defaults.enableCachedInfo = on; |
| 1029 break; |
| 1030 |
| 1020 default: | 1031 default: |
| 1021 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 1032 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 1022 return SECFailure; | 1033 return SECFailure; |
| 1023 } | 1034 } |
| 1024 return SECSuccess; | 1035 return SECSuccess; |
| 1025 } | 1036 } |
| 1026 | 1037 |
| 1027 /* function tells us if the cipher suite is one that we no longer support. */ | 1038 /* function tells us if the cipher suite is one that we no longer support. */ |
| 1028 static PRBool | 1039 static PRBool |
| 1029 ssl_IsRemovedCipherSuite(PRInt32 suite) | 1040 ssl_IsRemovedCipherSuite(PRInt32 suite) |
| (...skipping 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2524 loser: | 2535 loser: |
| 2525 ssl_DestroySocketContents(ss); | 2536 ssl_DestroySocketContents(ss); |
| 2526 ssl_DestroyLocks(ss); | 2537 ssl_DestroyLocks(ss); |
| 2527 PORT_Free(ss); | 2538 PORT_Free(ss); |
| 2528 ss = NULL; | 2539 ss = NULL; |
| 2529 } | 2540 } |
| 2530 } | 2541 } |
| 2531 return ss; | 2542 return ss; |
| 2532 } | 2543 } |
| 2533 | 2544 |
| OLD | NEW |