| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 var systemTokenEnabled = (location.search.indexOf("systemTokenEnabled") != -1); | 7 var systemTokenEnabled = (location.search.indexOf("systemTokenEnabled") != -1); |
| 8 var selectedTestSuite = location.hash.slice(1); | 8 var selectedTestSuite = location.hash.slice(1); |
| 9 console.log('[SELECTED TEST SUITE] ' + selectedTestSuite + | 9 console.log('[SELECTED TEST SUITE] ' + selectedTestSuite + |
| 10 ', systemTokenEnable ' + systemTokenEnabled); | 10 ', systemTokenEnable ' + systemTokenEnabled); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // which is set to be trusted by the test setup. | 29 // which is set to be trusted by the test setup. |
| 30 // Generated by create_test_certs.sh . | 30 // Generated by create_test_certs.sh . |
| 31 trusted_l1_interm_cert: 'l1_interm.der', | 31 trusted_l1_interm_cert: 'l1_interm.der', |
| 32 | 32 |
| 33 // X.509 certificate in DER encoding issued by 'l1_interm'. | 33 // X.509 certificate in DER encoding issued by 'l1_interm'. |
| 34 // Generated by create_test_certs.sh . | 34 // Generated by create_test_certs.sh . |
| 35 trusted_l2_leaf_cert: 'l2_leaf.der', | 35 trusted_l2_leaf_cert: 'l2_leaf.der', |
| 36 | 36 |
| 37 // X.509 client certificate in DER encoding. | 37 // X.509 client certificate in DER encoding. |
| 38 // Algorithm in SPKI: rsaEncryption. | 38 // Algorithm in SPKI: rsaEncryption. |
| 39 // openssl x509 -in net/data/ssl/certificates/client_1.pem -outform DER -out | 39 // Generated by create_net_cert_data.sh . |
| 40 // client_1.der | |
| 41 client_1: 'client_1.der', | 40 client_1: 'client_1.der', |
| 42 | 41 |
| 43 // X.509 client certificate in DER encoding. | 42 // X.509 client certificate in DER encoding. |
| 44 // Algorithm in SPKI: rsaEncryption. | 43 // Algorithm in SPKI: rsaEncryption. |
| 45 // openssl x509 -in net/data/ssl/certificates/client_2.pem -outform DER -out | 44 // Generated by create_net_cert_data.sh . |
| 46 // client_2.der | |
| 47 client_2: 'client_2.der', | 45 client_2: 'client_2.der', |
| 48 | 46 |
| 49 // The public key of client_1 as Subject Public Key Info in DER encoding. | 47 // The public key of client_1 as Subject Public Key Info in DER encoding. |
| 50 // openssl rsa -in net/data/ssl/certificates/client_1.key -inform PEM -out | 48 // Generated by create_net_cert_data.sh . |
| 51 // pubkey.der -pubout -outform DER | |
| 52 client_1_spki: 'client_1_spki.der', | 49 client_1_spki: 'client_1_spki.der', |
| 53 | 50 |
| 54 // The distinguished name of the CA that issued client_1 in DER encoding. | 51 // The distinguished name of the CA that issued client_1 in DER encoding. |
| 55 // openssl asn1parse -in client_1.der -inform DER -strparse 32 -out | 52 // Generated by create_net_cert_data.sh . |
| 56 // client_1_issuer_dn.der | |
| 57 client_1_issuer_dn: 'client_1_issuer_dn.der', | 53 client_1_issuer_dn: 'client_1_issuer_dn.der', |
| 58 | 54 |
| 59 // echo -n "hello world" > data | 55 // The string "hello world". |
| 56 // Generated by create_net_cert_data.sh . |
| 60 raw_data: 'data', | 57 raw_data: 'data', |
| 61 | 58 |
| 62 // openssl rsautl -inkey net/data/ssl/certificates/client_1.key -sign -in | 59 // A signature of raw_data using RSASSA-PKCS1-v1_5 with client_1, but treating |
| 63 // data -pkcs -out signature_nohash_pkcs | 60 // raw_data as a raw digest and without adding the DigestInfo prefix. |
| 61 // Generated by create_net_cert_data.sh . |
| 64 signature_nohash_pkcs: 'signature_nohash_pkcs', | 62 signature_nohash_pkcs: 'signature_nohash_pkcs', |
| 65 | 63 |
| 66 // openssl dgst -sha1 -sign net/data/ssl/certificates/client_1.key | 64 // A signature of raw_data using RSASSA-PKCS1-v1_5 with client_1, using SHA-1 |
| 67 // -out signature_sha1_pkcs data | 65 // as the hash function. |
| 66 // Generated by create_net_cert_data.sh . |
| 68 signature_sha1_pkcs: 'signature_sha1_pkcs', | 67 signature_sha1_pkcs: 'signature_sha1_pkcs', |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 // Reads the binary file at |path| and passes it as a Uin8Array to |callback|. | 70 // Reads the binary file at |path| and passes it as a Uint8Array to |callback|. |
| 72 function readFile(path, callback) { | 71 function readFile(path, callback) { |
| 73 var oReq = new XMLHttpRequest(); | 72 var oReq = new XMLHttpRequest(); |
| 74 oReq.responseType = "arraybuffer"; | 73 oReq.responseType = "arraybuffer"; |
| 75 oReq.open("GET", path, true /* asynchronous */); | 74 oReq.open("GET", path, true /* asynchronous */); |
| 76 oReq.onload = function() { | 75 oReq.onload = function() { |
| 77 var arrayBuffer = oReq.response; | 76 var arrayBuffer = oReq.response; |
| 78 if (arrayBuffer) { | 77 if (arrayBuffer) { |
| 79 callback(new Uint8Array(arrayBuffer)); | 78 callback(new Uint8Array(arrayBuffer)); |
| 80 } else { | 79 } else { |
| 81 callback(null); | 80 callback(null); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 // Interactive selection must not prompt the user and not return any | 648 // Interactive selection must not prompt the user and not return any |
| 650 // certificate. | 649 // certificate. |
| 651 testInteractiveSelectNoCerts, | 650 testInteractiveSelectNoCerts, |
| 652 ]; | 651 ]; |
| 653 chrome.test.runTests(tests); | 652 chrome.test.runTests(tests); |
| 654 }, | 653 }, |
| 655 | 654 |
| 656 }; | 655 }; |
| 657 | 656 |
| 658 setUp(testSuites[selectedTestSuite]); | 657 setUp(testSuites[selectedTestSuite]); |
| OLD | NEW |