1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 // Tests handling of certificates marked as permitting delegated credentials
8 function shouldBeDelegatedCredential(aTransportSecurityInfo) {
10 aTransportSecurityInfo.isDelegatedCredential,
11 "This host should have used a delegated credential"
15 function shouldNotBeDelegatedCredential(aTransportSecurityInfo) {
17 !aTransportSecurityInfo.isDelegatedCredential,
18 "This host should not have used a delegated credential"
25 "DelegatedCredentialsServer",
26 "test_delegated_credentials"
30 // Server certificate supports DC
31 // Server DC support enabled
32 // Client DC support disabled
33 // Result: Successful connection without DC
34 add_test(function () {
36 Services.prefs.setBoolPref(
37 "security.tls.enable_delegated_credentials",
43 "delegated-enabled.example.com",
46 shouldNotBeDelegatedCredential
50 // Server certificate does not support DC
51 // Server DC support enabled
52 // Client DC support enabled
53 // Result: SSL_ERROR_DC_INVALID_KEY_USAGE from client when
54 // checking DC against EE cert, no DC in aTransportSecurityInfo.
55 add_test(function () {
57 Services.prefs.setBoolPref("security.tls.enable_delegated_credentials", true);
61 "standard-enabled.example.com",
62 SSL_ERROR_DC_INVALID_KEY_USAGE,
64 // We'll never |mHaveCipherSuiteAndProtocol|,
65 // and therefore can't check IsDelegatedCredential
70 // Server certificate supports DC
71 // Server DC support disabled
72 // Client DC support enabled
73 // Result: Successful connection without DC
75 "delegated-disabled.example.com",
78 shouldNotBeDelegatedCredential
82 // Server certificate supports DC
83 // Server DC support enabled
84 // Client DC support enabled
85 // Result: Successful connection with DC
87 "delegated-enabled.example.com",
90 shouldBeDelegatedCredential