cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From za...@apache.org
Subject [03/52] [abbrv] [partial] cordova-firefoxos git commit: CB-4548 Install new node-firefox-* dependencies in node_modules
Date Wed, 01 Apr 2015 14:22:30 GMT
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/node-forge/nodejs/test/pbkdf2.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/node-forge/nodejs/test/pbkdf2.js
b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/node-forge/nodejs/test/pbkdf2.js
new file mode 100644
index 0000000..0b53e27
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/node-forge/nodejs/test/pbkdf2.js
@@ -0,0 +1,123 @@
+(function() {
+
+function Tests(ASSERT, PBKDF2, MD, UTIL) {
+  describe('pbkdf2', function() {
+    it('should derive a password with hmac-sha-1 c=1', function() {
+      var dkHex = UTIL.bytesToHex(PBKDF2('password', 'salt', 1, 20));
+      ASSERT.equal(dkHex, '0c60c80f961f0e71f3a9b524af6012062fe037a6');
+    });
+
+    it('should derive a password with hmac-sha-1 c=2', function() {
+      var dkHex = UTIL.bytesToHex(PBKDF2('password', 'salt', 2, 20));
+      ASSERT.equal(dkHex, 'ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957');
+    });
+
+    it('should derive a password with hmac-sha-1 c=5 keylen=8', function() {
+      var salt = UTIL.hexToBytes('1234567878563412');
+      var dkHex = UTIL.bytesToHex(PBKDF2('password', salt, 5, 8));
+      ASSERT.equal(dkHex, 'd1daa78615f287e6');
+    });
+
+    it('should derive a password with hmac-sha-1 c=4096', function() {
+      // Note: might be too slow on old browsers
+      var dkHex = UTIL.bytesToHex(PBKDF2('password', 'salt', 4096, 20));
+      ASSERT.equal(dkHex, '4b007901b765489abead49d926f721d065a429c1');
+    });
+
+    /*
+    it('should derive a password with hmac-sha-1 c=16777216', function() {
+      // Note: too slow
+      var dkHex = UTIL.bytesToHex(PBKDF2('password', 'salt', 16777216, 20));
+      ASSERT.equal(dkHex, 'eefe3d61cd4da4e4e9945b3d6ba2158c2634e984');
+    });*/
+
+    it('should derive a password with hmac-sha-256 c=1000', function() {
+      // Note: might be too slow on old browsers
+      var salt = '4bcda0d1c689fe465c5b8a817f0ddf3d';
+      var md = MD.sha256.create();
+      var dkHex = UTIL.bytesToHex(PBKDF2('password', salt, 1000, 48, md));
+      ASSERT.equal(dkHex, '9da8a5f4ae605f35e82e5beac5f362df15c4255d88f738d641466a4107f9970238e768e72af29ac89a1b16ff277b31d2');
+    });
+
+    it('should asynchronously derive a password with hmac-sha-1 c=1', function(done) {
+      PBKDF2('password', 'salt', 1, 20, function(err, dk) {
+        var dkHex = UTIL.bytesToHex(dk);
+        ASSERT.equal(dkHex, '0c60c80f961f0e71f3a9b524af6012062fe037a6');
+        done();
+      });
+    });
+
+    it('should asynchronously derive a password with hmac-sha-1 c=2', function(done) {
+      PBKDF2('password', 'salt', 2, 20, function(err, dk) {
+        var dkHex = UTIL.bytesToHex(dk);
+        ASSERT.equal(dkHex, 'ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957');
+        done();
+      });
+    });
+
+    it('should asynchronously derive a password with hmac-sha-1 c=5 keylen=8', function(done)
{
+      var salt = UTIL.hexToBytes('1234567878563412');
+      PBKDF2('password', salt, 5, 8, function(err, dk) {
+        var dkHex = UTIL.bytesToHex(dk);
+        ASSERT.equal(dkHex, 'd1daa78615f287e6');
+        done();
+      });
+    });
+
+    it('should asynchronously derive a password with hmac-sha-1 c=4096', function(done) {
+      // Note: might be too slow on old browsers
+      PBKDF2('password', 'salt', 4096, 20, function(err, dk) {
+        var dkHex = UTIL.bytesToHex(dk);
+        ASSERT.equal(dkHex, '4b007901b765489abead49d926f721d065a429c1');
+        done();
+      });
+    });
+
+    /*
+    it('should asynchronously derive a password with hmac-sha-1 c=16777216', function(done)
{
+      // Note: too slow
+      PBKDF2('password', 'salt', 16777216, 20, function(err, dk) {
+        var dkHex = UTIL.bytesToHex(dk);
+        ASSERT.equal(dkHex, 'eefe3d61cd4da4e4e9945b3d6ba2158c2634e984');
+        done();
+      });
+    });*/
+
+    it('should asynchronously derive a password with hmac-sha-256 c=1000', function(done)
{
+      // Note: might be too slow on old browsers
+      var salt = '4bcda0d1c689fe465c5b8a817f0ddf3d';
+      var md = MD.sha256.create();
+      PBKDF2('password', salt, 1000, 48, md, function(err, dk) {
+        var dkHex = UTIL.bytesToHex(dk);
+        ASSERT.equal(dkHex, '9da8a5f4ae605f35e82e5beac5f362df15c4255d88f738d641466a4107f9970238e768e72af29ac89a1b16ff277b31d2');
+        done();
+      });
+    });
+  });
+}
+
+// check for AMD
+if(typeof define === 'function') {
+  define([
+    'forge/pbkdf2',
+    'forge/md',
+    'forge/util'
+  ], function(PBKDF2, MD, UTIL) {
+    Tests(
+      // Global provided by test harness
+      ASSERT,
+      PBKDF2(),
+      MD(),
+      UTIL()
+    );
+  });
+} else if(typeof module === 'object' && module.exports) {
+  // assume NodeJS
+  Tests(
+    require('assert'),
+    require('../../js/pbkdf2')(),
+    require('../../js/md')(),
+    require('../../js/util')());
+}
+
+})();

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/node-forge/nodejs/test/pem.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/node-forge/nodejs/test/pem.js
b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/node-forge/nodejs/test/pem.js
new file mode 100644
index 0000000..6b405cb
--- /dev/null
+++ b/node_modules/node-firefox-find-devices/node_modules/adbkit/node_modules/node-forge/nodejs/test/pem.js
@@ -0,0 +1,104 @@
+(function() {
+
+function Tests(ASSERT, PEM) {
+  var _input = '-----BEGIN PRIVACY-ENHANCED MESSAGE-----\r\n' +
+    'Proc-Type: 4,ENCRYPTED\r\n' +
+    'Content-Domain: RFC822\r\n' +
+    'DEK-Info: DES-CBC,F8143EDE5960C597\r\n' +
+    'Originator-ID-Symmetric: linn@zendia.enet.dec.com,,\r\n' +
+    'Recipient-ID-Symmetric: linn@zendia.enet.dec.com,ptf-kmc,3\r\n' +
+    'Key-Info: DES-ECB,RSA-MD2,9FD3AAD2F2691B9A,\r\n' +
+    ' B70665BB9BF7CBCDA60195DB94F727D3\r\n' +
+    'Recipient-ID-Symmetric: pem-dev@tis.com,ptf-kmc,4\r\n' +
+    'Key-Info: DES-ECB,RSA-MD2,161A3F75DC82EF26,\r\n' +
+    ' E2EF532C65CBCFF79F83A2658132DB47\r\n' +
+    '\r\n' +
+    'LLrHB0eJzyhP+/fSStdW8okeEnv47jxe7SJ/iN72ohNcUk2jHEUSoH1nvNSIWL9M\r\n' +
+    '8tEjmF/zxB+bATMtPjCUWbz8Lr9wloXIkjHUlBLpvXR0UrUzYbkNpk0agV2IzUpk\r\n' +
+    'J6UiRRGcDSvzrsoK+oNvqu6z7Xs5Xfz5rDqUcMlK1Z6720dcBWGGsDLpTpSCnpot\r\n' +
+    'dXd/H5LMDWnonNvPCwQUHg==\r\n' +
+    '-----END PRIVACY-ENHANCED MESSAGE-----\r\n' +
+    '-----BEGIN PRIVACY-ENHANCED MESSAGE-----\r\n' +
+    'Proc-Type: 4,ENCRYPTED\r\n' +
+    'Content-Domain: RFC822\r\n' +
+    'DEK-Info: DES-CBC,BFF968AA74691AC1\r\n' +
+    'Originator-Certificate:\r\n' +
+    ' MIIBlTCCAScCAWUwDQYJKoZIhvcNAQECBQAwUTELMAkGA1UEBhMCVVMxIDAeBgNV\r\n' +
+    ' BAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMQ8wDQYDVQQLEwZCZXRhIDExDzAN\r\n' +
+    ' BgNVBAsTBk5PVEFSWTAeFw05MTA5MDQxODM4MTdaFw05MzA5MDMxODM4MTZaMEUx\r\n' +
+    ' CzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEU\r\n' +
+    ' MBIGA1UEAxMLVGVzdCBVc2VyIDEwWTAKBgRVCAEBAgICAANLADBIAkEAwHZHl7i+\r\n' +
+    ' yJcqDtjJCowzTdBJrdAiLAnSC+CnnjOJELyuQiBgkGrgIh3j8/x0fM+YrsyF1u3F\r\n' +
+    ' LZPVtzlndhYFJQIDAQABMA0GCSqGSIb3DQEBAgUAA1kACKr0PqphJYw1j+YPtcIq\r\n' +
+    ' iWlFPuN5jJ79Khfg7ASFxskYkEMjRNZV/HZDZQEhtVaU7Jxfzs2wfX5byMp2X3U/\r\n' +
+    ' 5XUXGx7qusDgHQGs7Jk9W8CW1fuSWUgN4w==\r\n' +
+    'Key-Info: RSA,\r\n' +
+    ' I3rRIGXUGWAF8js5wCzRTkdhO34PTHdRZY9Tuvm03M+NM7fx6qc5udixps2Lng0+\r\n' +
+    ' wGrtiUm/ovtKdinz6ZQ/aQ==\r\n' +
+    'Issuer-Certificate:\r\n' +
+    ' MIIB3DCCAUgCAQowDQYJKoZIhvcNAQECBQAwTzELMAkGA1UEBhMCVVMxIDAeBgNV\r\n' +
+    ' BAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMQ8wDQYDVQQLEwZCZXRhIDExDTAL\r\n' +
+    ' BgNVBAsTBFRMQ0EwHhcNOTEwOTAxMDgwMDAwWhcNOTIwOTAxMDc1OTU5WjBRMQsw\r\n' +
+    ' CQYDVQQGEwJVUzEgMB4GA1UEChMXUlNBIERhdGEgU2VjdXJpdHksIEluYy4xDzAN\r\n' +
+    ' BgNVBAsTBkJldGEgMTEPMA0GA1UECxMGTk9UQVJZMHAwCgYEVQgBAQICArwDYgAw\r\n' +
+    ' XwJYCsnp6lQCxYykNlODwutF/jMJ3kL+3PjYyHOwk+/9rLg6X65B/LD4bJHtO5XW\r\n' +
+    ' cqAz/7R7XhjYCm0PcqbdzoACZtIlETrKrcJiDYoP+DkZ8k1gCk7hQHpbIwIDAQAB\r\n' +
+    ' MA0GCSqGSIb3DQEBAgUAA38AAICPv4f9Gx/tY4+p+4DB7MV+tKZnvBoy8zgoMGOx\r\n' +
+    ' dD2jMZ/3HsyWKWgSF0eH/AJB3qr9zosG47pyMnTf3aSy2nBO7CMxpUWRBcXUpE+x\r\n' +
+    ' EREZd9++32ofGBIXaialnOgVUn0OzSYgugiQ077nJLDUj0hQehCizEs5wUJ35a5h\r\n' +
+    'MIC-Info: RSA-MD5,RSA,\r\n' +
+    ' UdFJR8u/TIGhfH65ieewe2lOW4tooa3vZCvVNGBZirf/7nrgzWDABz8w9NsXSexv\r\n' +
+    ' AjRFbHoNPzBuxwmOAFeA0HJszL4yBvhG\r\n' +
+    'Recipient-ID-Asymmetric:\r\n' +
+    ' MFExCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5j\r\n' +
+    ' LjEPMA0GA1UECxMGQmV0YSAxMQ8wDQYDVQQLEwZOT1RBUlk=,66\r\n' +
+    'Key-Info: RSA,\r\n' +
+    ' O6BS1ww9CTyHPtS3bMLD+L0hejdvX6Qv1HK2ds2sQPEaXhX8EhvVphHYTjwekdWv\r\n' +
+    ' 7x0Z3Jx2vTAhOYHMcqqCjA==\r\n' +
+    '\r\n' +
+    'qeWlj/YJ2Uf5ng9yznPbtD0mYloSwIuV9FRYx+gzY+8iXd/NQrXHfi6/MhPfPF3d\r\n' +
+    'jIqCJAxvld2xgqQimUzoS1a4r7kQQ5c/Iua4LqKeq3ciFzEv/MbZhA==\r\n' +
+    '-----END PRIVACY-ENHANCED MESSAGE-----\r\n' +
+    '-----BEGIN RSA PRIVATE KEY-----\r\n' +
+    'MIIBPAIBAAJBALjXU+IdHkSkdBscgXf+EBoa55ruAIsU50uDFjFBkp+rWFt5AOGF\r\n' +
+    '9xL1/HNIby5M64BCw021nJTZKEOmXKdmzYsCAwEAAQJBAApyYRNOgf9vLAC8Q7T8\r\n' +
+    'bvyKuLxQ50b1D319EywFgLv1Yn0s/F9F+Rew6c04Q0pIqmuOGUM7z94ul/y5OlNJ\r\n' +
+    '2cECIQDveEW1ib2+787l7Y0tMeDzf/HQl4MAWdcxXWOeUFK+7QIhAMWZsukutEn9\r\n' +
+    '9/yqFMt8bL/dclfNn1IAgUL4+dMJ7zdXAiEAhaxGhVKxN28XuCOFhe/s2R/XdQ/O\r\n' +
+    'UZjU1bqCzDGcLvUCIGYmxu71Tg7SVFkyM/3eHPozKOFrU2m5CRnuTHhlMl2RAiEA\r\n' +
+    '0vhM5TEmmNWz0anPVabqDj9TA0z5MsDJQcn5NmO9xnw=\r\n' +
+    '-----END RSA PRIVATE KEY-----\r\n';
+
+  describe('pem', function() {
+    it('should decode and re-encode PEM messages', function() {
+      var msgs = PEM.decode(_input);
+
+      var output = '';
+      for(var i = 0; i < msgs.length; ++i) {
+        output += PEM.encode(msgs[i]);
+      }
+
+      ASSERT.equal(output, _input);
+    });
+  });
+}
+
+// check for AMD
+if(typeof define === 'function') {
+  define([
+    'forge/pem'
+  ], function(PEM) {
+    Tests(
+      // Global provided by test harness
+      ASSERT,
+      PEM()
+    );
+  });
+} else if(typeof module === 'object' && module.exports) {
+  // assume NodeJS
+  Tests(
+    require('assert'),
+    require('../../js/pem')());
+}
+
+})();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message