| 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 break; | 745 break; |
| 745 | 746 |
| 746 case SSL_ENABLE_SNAP_START: | 747 case SSL_ENABLE_SNAP_START: |
| 747 ss->opt.enableSnapStart = on; | 748 ss->opt.enableSnapStart = on; |
| 748 break; | 749 break; |
| 749 | 750 |
| 750 case SSL_ENABLE_OCSP_STAPLING: | 751 case SSL_ENABLE_OCSP_STAPLING: |
| 751 ss->opt.enableOCSPStapling = on; | 752 ss->opt.enableOCSPStapling = on; |
| 752 break; | 753 break; |
| 753 | 754 |
| 755 case SSL_ENABLE_CACHED_INFO: |
| 756 ss->opt.enableCachedInfo = on; |
| 757 break; |
| 758 |
| 754 default: | 759 default: |
| 755 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 760 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 756 rv = SECFailure; | 761 rv = SECFailure; |
| 757 } | 762 } |
| 758 | 763 |
| 759 /* We can't use the macros for releasing the locks here, | 764 /* We can't use the macros for releasing the locks here, |
| 760 * because ss->opt.noLocks might have changed just above. | 765 * because ss->opt.noLocks might have changed just above. |
| 761 * We must release these locks (monitors) here, if we aquired them above, | 766 * We must release these locks (monitors) here, if we aquired them above, |
| 762 * regardless of the current value of ss->opt.noLocks. | 767 * regardless of the current value of ss->opt.noLocks. |
| 763 */ | 768 */ |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 on = ss->opt.enableSessionTickets; | 815 on = ss->opt.enableSessionTickets; |
| 811 break; | 816 break; |
| 812 case SSL_ENABLE_DEFLATE: on = ss->opt.enableDeflate; break; | 817 case SSL_ENABLE_DEFLATE: on = ss->opt.enableDeflate; break; |
| 813 case SSL_ENABLE_RENEGOTIATION: | 818 case SSL_ENABLE_RENEGOTIATION: |
| 814 on = ss->opt.enableRenegotiation; break; | 819 on = ss->opt.enableRenegotiation; break; |
| 815 case SSL_REQUIRE_SAFE_NEGOTIATION: | 820 case SSL_REQUIRE_SAFE_NEGOTIATION: |
| 816 on = ss->opt.requireSafeNegotiation; break; | 821 on = ss->opt.requireSafeNegotiation; break; |
| 817 case SSL_ENABLE_FALSE_START: on = ss->opt.enableFalseStart; break; | 822 case SSL_ENABLE_FALSE_START: on = ss->opt.enableFalseStart; break; |
| 818 case SSL_ENABLE_SNAP_START: on = ss->opt.enableSnapStart; break; | 823 case SSL_ENABLE_SNAP_START: on = ss->opt.enableSnapStart; break; |
| 819 case SSL_ENABLE_OCSP_STAPLING: on = ss->opt.enableOCSPStapling; break; | 824 case SSL_ENABLE_OCSP_STAPLING: on = ss->opt.enableOCSPStapling; break; |
| 825 case SSL_ENABLE_CACHED_INFO: on = ss->opt.enableCachedInfo; break; |
| 820 | 826 |
| 821 default: | 827 default: |
| 822 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 828 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 823 rv = SECFailure; | 829 rv = SECFailure; |
| 824 } | 830 } |
| 825 | 831 |
| 826 ssl_ReleaseSSL3HandshakeLock(ss); | 832 ssl_ReleaseSSL3HandshakeLock(ss); |
| 827 ssl_Release1stHandshakeLock(ss); | 833 ssl_Release1stHandshakeLock(ss); |
| 828 | 834 |
| 829 *pOn = on; | 835 *pOn = on; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 case SSL_ENABLE_RENEGOTIATION: | 871 case SSL_ENABLE_RENEGOTIATION: |
| 866 on = ssl_defaults.enableRenegotiation; break; | 872 on = ssl_defaults.enableRenegotiation; break; |
| 867 case SSL_REQUIRE_SAFE_NEGOTIATION: | 873 case SSL_REQUIRE_SAFE_NEGOTIATION: |
| 868 on = ssl_defaults.requireSafeNegotiation; | 874 on = ssl_defaults.requireSafeNegotiation; |
| 869 break; | 875 break; |
| 870 case SSL_ENABLE_FALSE_START: on = ssl_defaults.enableFalseStart; break; | 876 case SSL_ENABLE_FALSE_START: on = ssl_defaults.enableFalseStart; break; |
| 871 case SSL_ENABLE_SNAP_START: on = ssl_defaults.enableSnapStart; break; | 877 case SSL_ENABLE_SNAP_START: on = ssl_defaults.enableSnapStart; break; |
| 872 case SSL_ENABLE_OCSP_STAPLING: | 878 case SSL_ENABLE_OCSP_STAPLING: |
| 873 on = ssl_defaults.enableOCSPStapling; | 879 on = ssl_defaults.enableOCSPStapling; |
| 874 break; | 880 break; |
| 881 case SSL_ENABLE_CACHED_INFO: on = ssl_defaults.enableCachedInfo; break; |
| 875 | 882 |
| 876 default: | 883 default: |
| 877 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 884 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 878 rv = SECFailure; | 885 rv = SECFailure; |
| 879 } | 886 } |
| 880 | 887 |
| 881 *pOn = on; | 888 *pOn = on; |
| 882 return rv; | 889 return rv; |
| 883 } | 890 } |
| 884 | 891 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 break; | 1027 break; |
| 1021 | 1028 |
| 1022 case SSL_ENABLE_SNAP_START: | 1029 case SSL_ENABLE_SNAP_START: |
| 1023 ssl_defaults.enableSnapStart = on; | 1030 ssl_defaults.enableSnapStart = on; |
| 1024 break; | 1031 break; |
| 1025 | 1032 |
| 1026 case SSL_ENABLE_OCSP_STAPLING: | 1033 case SSL_ENABLE_OCSP_STAPLING: |
| 1027 ssl_defaults.enableOCSPStapling = on; | 1034 ssl_defaults.enableOCSPStapling = on; |
| 1028 break; | 1035 break; |
| 1029 | 1036 |
| 1037 case SSL_ENABLE_CACHED_INFO: |
| 1038 ssl_defaults.enableCachedInfo = on; |
| 1039 break; |
| 1040 |
| 1030 default: | 1041 default: |
| 1031 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 1042 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 1032 return SECFailure; | 1043 return SECFailure; |
| 1033 } | 1044 } |
| 1034 return SECSuccess; | 1045 return SECSuccess; |
| 1035 } | 1046 } |
| 1036 | 1047 |
| 1037 /* function tells us if the cipher suite is one that we no longer support. */ | 1048 /* function tells us if the cipher suite is one that we no longer support. */ |
| 1038 static PRBool | 1049 static PRBool |
| 1039 ssl_IsRemovedCipherSuite(PRInt32 suite) | 1050 ssl_IsRemovedCipherSuite(PRInt32 suite) |
| (...skipping 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2534 loser: | 2545 loser: |
| 2535 ssl_DestroySocketContents(ss); | 2546 ssl_DestroySocketContents(ss); |
| 2536 ssl_DestroyLocks(ss); | 2547 ssl_DestroyLocks(ss); |
| 2537 PORT_Free(ss); | 2548 PORT_Free(ss); |
| 2538 ss = NULL; | 2549 ss = NULL; |
| 2539 } | 2550 } |
| 2540 } | 2551 } |
| 2541 return ss; | 2552 return ss; |
| 2542 } | 2553 } |
| 2543 | 2554 |
| OLD | NEW |