pixel-react 1.15.21 → 1.15.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_virtual/aesCipherSuites.js +4 -0
- package/lib/_virtual/aesCipherSuites.js.map +1 -0
- package/lib/_virtual/asn1-validator.js +4 -0
- package/lib/_virtual/asn1-validator.js.map +1 -0
- package/lib/_virtual/asn1.js +4 -0
- package/lib/_virtual/asn1.js.map +1 -0
- package/lib/_virtual/cipherModes.js +4 -0
- package/lib/_virtual/cipherModes.js.map +1 -0
- package/lib/_virtual/hmac.js +4 -0
- package/lib/_virtual/hmac.js.map +1 -0
- package/lib/_virtual/index11.js +2 -2
- package/lib/_virtual/index12.js +2 -2
- package/lib/_virtual/index13.js +2 -2
- package/lib/_virtual/index14.js +4 -0
- package/lib/_virtual/index14.js.map +1 -0
- package/lib/_virtual/index2.js +5 -3
- package/lib/_virtual/index2.js.map +1 -1
- package/lib/_virtual/index3.js +4 -2
- package/lib/_virtual/index3.js.map +1 -1
- package/lib/_virtual/index4.js +2 -4
- package/lib/_virtual/index4.js.map +1 -1
- package/lib/_virtual/index5.js +4 -2
- package/lib/_virtual/index5.js.map +1 -1
- package/lib/_virtual/index6.js +2 -2
- package/lib/_virtual/index7.js +2 -6
- package/lib/_virtual/index7.js.map +1 -1
- package/lib/_virtual/index8.js +6 -2
- package/lib/_virtual/index8.js.map +1 -1
- package/lib/_virtual/index9.js +2 -2
- package/lib/_virtual/md5.js +4 -0
- package/lib/_virtual/md5.js.map +1 -0
- package/lib/_virtual/mgf1.js +4 -0
- package/lib/_virtual/mgf1.js.map +1 -0
- package/lib/_virtual/oids.js +4 -0
- package/lib/_virtual/oids.js.map +1 -0
- package/lib/_virtual/pem.js +4 -0
- package/lib/_virtual/pem.js.map +1 -0
- package/lib/_virtual/pkcs1.js +4 -0
- package/lib/_virtual/pkcs1.js.map +1 -0
- package/lib/_virtual/pkcs12.js +4 -0
- package/lib/_virtual/pkcs12.js.map +1 -0
- package/lib/_virtual/pkcs7.js +4 -0
- package/lib/_virtual/pkcs7.js.map +1 -0
- package/lib/_virtual/pkcs7asn1.js +4 -0
- package/lib/_virtual/pkcs7asn1.js.map +1 -0
- package/lib/_virtual/pki.js +4 -0
- package/lib/_virtual/pki.js.map +1 -0
- package/lib/_virtual/prime.js +4 -0
- package/lib/_virtual/prime.js.map +1 -0
- package/lib/_virtual/prng.js +4 -0
- package/lib/_virtual/prng.js.map +1 -0
- package/lib/_virtual/pss.js +4 -0
- package/lib/_virtual/pss.js.map +1 -0
- package/lib/_virtual/random.js +4 -0
- package/lib/_virtual/random.js.map +1 -0
- package/lib/_virtual/sha1.js +4 -0
- package/lib/_virtual/sha1.js.map +1 -0
- package/lib/_virtual/sha256.js +4 -0
- package/lib/_virtual/sha256.js.map +1 -0
- package/lib/_virtual/sha512.js +4 -0
- package/lib/_virtual/sha512.js.map +1 -0
- package/lib/_virtual/ssh.js +4 -0
- package/lib/_virtual/ssh.js.map +1 -0
- package/lib/_virtual/util.js +4 -0
- package/lib/_virtual/util.js.map +1 -0
- package/lib/_virtual/x509.js +4 -0
- package/lib/_virtual/x509.js.map +1 -0
- package/lib/assets/icons/testify_icon.svg.js +6 -0
- package/lib/assets/icons/testify_icon.svg.js.map +1 -0
- package/lib/assets/icons/testify_loader.svg.js +6 -0
- package/lib/assets/icons/testify_loader.svg.js.map +1 -0
- package/lib/assets/icons/testify_logo_name.svg.js +6 -0
- package/lib/assets/icons/testify_logo_name.svg.js.map +1 -0
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.js +3 -1
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.js.map +1 -1
- package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.js +2 -9
- package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.js.map +1 -1
- package/lib/components/Charts/DashboardDonutChart/types.d.ts +1 -1
- package/lib/components/ConditionalDropdown/ConditionalDropdown.js +2 -9
- package/lib/components/ConditionalDropdown/ConditionalDropdown.js.map +1 -1
- package/lib/components/Editor/Editor.js +37 -17
- package/lib/components/Editor/Editor.js.map +1 -1
- package/lib/components/Icon/iconList.js +6 -0
- package/lib/components/Icon/iconList.js.map +1 -1
- package/lib/components/MultiSelect/MultiSelect.js +9 -10
- package/lib/components/MultiSelect/MultiSelect.js.map +1 -1
- package/lib/components/PhoneInput/PhoneInput.js +1 -0
- package/lib/components/PhoneInput/PhoneInput.js.map +1 -1
- package/lib/components/SessionDropdown/SessionDropdown.js +4 -2
- package/lib/components/SessionDropdown/SessionDropdown.js.map +1 -1
- package/lib/index.cjs +27423 -379
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/node_modules/classnames/index.js +1 -1
- package/lib/node_modules/input-format/modules/react/Input.js +1 -1
- package/lib/node_modules/js-beautify/js/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/tokenizer.js +1 -1
- package/lib/node_modules/js-beautify/js/src/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/tokenizer.js +1 -1
- package/lib/node_modules/node-forge/lib/aes.js +1014 -0
- package/lib/node_modules/node-forge/lib/aes.js.map +1 -0
- package/lib/node_modules/node-forge/lib/aesCipherSuites.js +286 -0
- package/lib/node_modules/node-forge/lib/aesCipherSuites.js.map +1 -0
- package/lib/node_modules/node-forge/lib/asn1-validator.js +100 -0
- package/lib/node_modules/node-forge/lib/asn1-validator.js.map +1 -0
- package/lib/node_modules/node-forge/lib/asn1.js +1379 -0
- package/lib/node_modules/node-forge/lib/asn1.js.map +1 -0
- package/lib/node_modules/node-forge/lib/baseN.js +181 -0
- package/lib/node_modules/node-forge/lib/baseN.js.map +1 -0
- package/lib/node_modules/node-forge/lib/cipher.js +236 -0
- package/lib/node_modules/node-forge/lib/cipher.js.map +1 -0
- package/lib/node_modules/node-forge/lib/cipherModes.js +936 -0
- package/lib/node_modules/node-forge/lib/cipherModes.js.map +1 -0
- package/lib/node_modules/node-forge/lib/des.js +467 -0
- package/lib/node_modules/node-forge/lib/des.js.map +1 -0
- package/lib/node_modules/node-forge/lib/ed25519.js +1108 -0
- package/lib/node_modules/node-forge/lib/ed25519.js.map +1 -0
- package/lib/node_modules/node-forge/lib/forge.js +23 -0
- package/lib/node_modules/node-forge/lib/forge.js.map +1 -0
- package/lib/node_modules/node-forge/lib/hmac.js +158 -0
- package/lib/node_modules/node-forge/lib/hmac.js.map +1 -0
- package/lib/node_modules/node-forge/lib/index.js +70 -0
- package/lib/node_modules/node-forge/lib/index.js.map +1 -0
- package/lib/node_modules/node-forge/lib/jsbn.js +1481 -0
- package/lib/node_modules/node-forge/lib/jsbn.js.map +1 -0
- package/lib/node_modules/node-forge/lib/kem.js +178 -0
- package/lib/node_modules/node-forge/lib/kem.js.map +1 -0
- package/lib/node_modules/node-forge/lib/log.js +325 -0
- package/lib/node_modules/node-forge/lib/log.js.map +1 -0
- package/lib/node_modules/node-forge/lib/md.all.js +28 -0
- package/lib/node_modules/node-forge/lib/md.all.js.map +1 -0
- package/lib/node_modules/node-forge/lib/md.js +22 -0
- package/lib/node_modules/node-forge/lib/md.js.map +1 -0
- package/lib/node_modules/node-forge/lib/md5.js +288 -0
- package/lib/node_modules/node-forge/lib/md5.js.map +1 -0
- package/lib/node_modules/node-forge/lib/mgf.js +24 -0
- package/lib/node_modules/node-forge/lib/mgf.js.map +1 -0
- package/lib/node_modules/node-forge/lib/mgf1.js +68 -0
- package/lib/node_modules/node-forge/lib/mgf1.js.map +1 -0
- package/lib/node_modules/node-forge/lib/oids.js +185 -0
- package/lib/node_modules/node-forge/lib/oids.js.map +1 -0
- package/lib/node_modules/node-forge/lib/pbe.js +966 -0
- package/lib/node_modules/node-forge/lib/pbe.js.map +1 -0
- package/lib/node_modules/node-forge/lib/pbkdf2.js +209 -0
- package/lib/node_modules/node-forge/lib/pbkdf2.js.map +1 -0
- package/lib/node_modules/node-forge/lib/pem.js +250 -0
- package/lib/node_modules/node-forge/lib/pem.js.map +1 -0
- package/lib/node_modules/node-forge/lib/pkcs1.js +273 -0
- package/lib/node_modules/node-forge/lib/pkcs1.js.map +1 -0
- package/lib/node_modules/node-forge/lib/pkcs12.js +980 -0
- package/lib/node_modules/node-forge/lib/pkcs12.js.map +1 -0
- package/lib/node_modules/node-forge/lib/pkcs7.js +1073 -0
- package/lib/node_modules/node-forge/lib/pkcs7.js.map +1 -0
- package/lib/node_modules/node-forge/lib/pkcs7asn1.js +415 -0
- package/lib/node_modules/node-forge/lib/pkcs7asn1.js.map +1 -0
- package/lib/node_modules/node-forge/lib/pki.js +125 -0
- package/lib/node_modules/node-forge/lib/pki.js.map +1 -0
- package/lib/node_modules/node-forge/lib/prime.js +297 -0
- package/lib/node_modules/node-forge/lib/prime.js.map +1 -0
- package/lib/node_modules/node-forge/lib/prng.js +433 -0
- package/lib/node_modules/node-forge/lib/prng.js.map +1 -0
- package/lib/node_modules/node-forge/lib/pss.js +246 -0
- package/lib/node_modules/node-forge/lib/pss.js.map +1 -0
- package/lib/node_modules/node-forge/lib/random.js +191 -0
- package/lib/node_modules/node-forge/lib/random.js.map +1 -0
- package/lib/node_modules/node-forge/lib/rc2.js +382 -0
- package/lib/node_modules/node-forge/lib/rc2.js.map +1 -0
- package/lib/node_modules/node-forge/lib/rsa.js +1815 -0
- package/lib/node_modules/node-forge/lib/rsa.js.map +1 -0
- package/lib/node_modules/node-forge/lib/sha1.js +325 -0
- package/lib/node_modules/node-forge/lib/sha1.js.map +1 -0
- package/lib/node_modules/node-forge/lib/sha256.js +306 -0
- package/lib/node_modules/node-forge/lib/sha256.js.map +1 -0
- package/lib/node_modules/node-forge/lib/sha512.js +479 -0
- package/lib/node_modules/node-forge/lib/sha512.js.map +1 -0
- package/lib/node_modules/node-forge/lib/ssh.js +244 -0
- package/lib/node_modules/node-forge/lib/ssh.js.map +1 -0
- package/lib/node_modules/node-forge/lib/tls.js +4207 -0
- package/lib/node_modules/node-forge/lib/tls.js.map +1 -0
- package/lib/node_modules/node-forge/lib/util.js +2565 -0
- package/lib/node_modules/node-forge/lib/util.js.map +1 -0
- package/lib/node_modules/node-forge/lib/x509.js +2986 -0
- package/lib/node_modules/node-forge/lib/x509.js.map +1 -0
- package/lib/node_modules/prop-types/index.js +1 -1
- package/lib/node_modules/react-async-script/lib/esm/async-script-loader.js +1 -1
- package/lib/node_modules/react-google-recaptcha/lib/esm/recaptcha.js +1 -1
- package/lib/node_modules/react-is/index.js +1 -1
- package/lib/node_modules/react-phone-number-input/modules/CountryIcon.js +1 -1
- package/lib/node_modules/react-phone-number-input/modules/CountrySelect.js +1 -1
- package/lib/node_modules/react-phone-number-input/modules/Flag.js +1 -1
- package/lib/node_modules/react-phone-number-input/modules/InputBasic.js +1 -1
- package/lib/node_modules/react-phone-number-input/modules/InputSmart.js +1 -1
- package/lib/node_modules/react-phone-number-input/modules/InternationalIcon.js +1 -1
- package/lib/node_modules/react-phone-number-input/modules/PhoneInputWithCountry.js +1 -1
- package/lib/node_modules/react-phone-number-input/modules/PropTypes.js +1 -1
- package/lib/node_modules/scheduler/index.js +1 -1
- package/lib/node_modules/use-context-selector/dist/index.js +1 -1
- package/lib/styles.css +1 -1
- package/lib/styles.css.map +1 -1
- package/lib/utils/getEncryptedData/getEncryptedData.js +10 -13
- package/lib/utils/getEncryptedData/getEncryptedData.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { __module as pss } from '../../../_virtual/pss.js';
|
|
2
|
+
import { __require as requireForge } from './forge.js';
|
|
3
|
+
import { __require as requireRandom } from './random.js';
|
|
4
|
+
import { __require as requireUtil } from './util.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Javascript implementation of PKCS#1 PSS signature padding.
|
|
8
|
+
*
|
|
9
|
+
* @author Stefan Siegl
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
|
|
12
|
+
*/
|
|
13
|
+
var hasRequiredPss;
|
|
14
|
+
function requirePss() {
|
|
15
|
+
if (hasRequiredPss) return pss.exports;
|
|
16
|
+
hasRequiredPss = 1;
|
|
17
|
+
var forge = requireForge();
|
|
18
|
+
requireRandom();
|
|
19
|
+
requireUtil();
|
|
20
|
+
|
|
21
|
+
// shortcut for PSS API
|
|
22
|
+
var pss$1 = pss.exports = forge.pss = forge.pss || {};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Creates a PSS signature scheme object.
|
|
26
|
+
*
|
|
27
|
+
* There are several ways to provide a salt for encoding:
|
|
28
|
+
*
|
|
29
|
+
* 1. Specify the saltLength only and the built-in PRNG will generate it.
|
|
30
|
+
* 2. Specify the saltLength and a custom PRNG with 'getBytesSync' defined that
|
|
31
|
+
* will be used.
|
|
32
|
+
* 3. Specify the salt itself as a forge.util.ByteBuffer.
|
|
33
|
+
*
|
|
34
|
+
* @param options the options to use:
|
|
35
|
+
* md the message digest object to use, a forge md instance.
|
|
36
|
+
* mgf the mask generation function to use, a forge mgf instance.
|
|
37
|
+
* [saltLength] the length of the salt in octets.
|
|
38
|
+
* [prng] the pseudo-random number generator to use to produce a salt.
|
|
39
|
+
* [salt] the salt to use when encoding.
|
|
40
|
+
*
|
|
41
|
+
* @return a signature scheme object.
|
|
42
|
+
*/
|
|
43
|
+
pss$1.create = function (options) {
|
|
44
|
+
// backwards compatibility w/legacy args: hash, mgf, sLen
|
|
45
|
+
if (arguments.length === 3) {
|
|
46
|
+
options = {
|
|
47
|
+
md: arguments[0],
|
|
48
|
+
mgf: arguments[1],
|
|
49
|
+
saltLength: arguments[2]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
var hash = options.md;
|
|
53
|
+
var mgf = options.mgf;
|
|
54
|
+
var hLen = hash.digestLength;
|
|
55
|
+
var salt_ = options.salt || null;
|
|
56
|
+
if (typeof salt_ === 'string') {
|
|
57
|
+
// assume binary-encoded string
|
|
58
|
+
salt_ = forge.util.createBuffer(salt_);
|
|
59
|
+
}
|
|
60
|
+
var sLen;
|
|
61
|
+
if ('saltLength' in options) {
|
|
62
|
+
sLen = options.saltLength;
|
|
63
|
+
} else if (salt_ !== null) {
|
|
64
|
+
sLen = salt_.length();
|
|
65
|
+
} else {
|
|
66
|
+
throw new Error('Salt length not specified or specific salt not given.');
|
|
67
|
+
}
|
|
68
|
+
if (salt_ !== null && salt_.length() !== sLen) {
|
|
69
|
+
throw new Error('Given salt length does not match length of given salt.');
|
|
70
|
+
}
|
|
71
|
+
var prng = options.prng || forge.random;
|
|
72
|
+
var pssobj = {};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Encodes a PSS signature.
|
|
76
|
+
*
|
|
77
|
+
* This function implements EMSA-PSS-ENCODE as per RFC 3447, section 9.1.1.
|
|
78
|
+
*
|
|
79
|
+
* @param md the message digest object with the hash to sign.
|
|
80
|
+
* @param modsBits the length of the RSA modulus in bits.
|
|
81
|
+
*
|
|
82
|
+
* @return the encoded message as a binary-encoded string of length
|
|
83
|
+
* ceil((modBits - 1) / 8).
|
|
84
|
+
*/
|
|
85
|
+
pssobj.encode = function (md, modBits) {
|
|
86
|
+
var i;
|
|
87
|
+
var emBits = modBits - 1;
|
|
88
|
+
var emLen = Math.ceil(emBits / 8);
|
|
89
|
+
|
|
90
|
+
/* 2. Let mHash = Hash(M), an octet string of length hLen. */
|
|
91
|
+
var mHash = md.digest().getBytes();
|
|
92
|
+
|
|
93
|
+
/* 3. If emLen < hLen + sLen + 2, output "encoding error" and stop. */
|
|
94
|
+
if (emLen < hLen + sLen + 2) {
|
|
95
|
+
throw new Error('Message is too long to encrypt.');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* 4. Generate a random octet string salt of length sLen; if sLen = 0,
|
|
99
|
+
* then salt is the empty string. */
|
|
100
|
+
var salt;
|
|
101
|
+
if (salt_ === null) {
|
|
102
|
+
salt = prng.getBytesSync(sLen);
|
|
103
|
+
} else {
|
|
104
|
+
salt = salt_.bytes();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* 5. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt; */
|
|
108
|
+
var m_ = new forge.util.ByteBuffer();
|
|
109
|
+
m_.fillWithByte(0, 8);
|
|
110
|
+
m_.putBytes(mHash);
|
|
111
|
+
m_.putBytes(salt);
|
|
112
|
+
|
|
113
|
+
/* 6. Let H = Hash(M'), an octet string of length hLen. */
|
|
114
|
+
hash.start();
|
|
115
|
+
hash.update(m_.getBytes());
|
|
116
|
+
var h = hash.digest().getBytes();
|
|
117
|
+
|
|
118
|
+
/* 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2
|
|
119
|
+
* zero octets. The length of PS may be 0. */
|
|
120
|
+
var ps = new forge.util.ByteBuffer();
|
|
121
|
+
ps.fillWithByte(0, emLen - sLen - hLen - 2);
|
|
122
|
+
|
|
123
|
+
/* 8. Let DB = PS || 0x01 || salt; DB is an octet string of length
|
|
124
|
+
* emLen - hLen - 1. */
|
|
125
|
+
ps.putByte(0x01);
|
|
126
|
+
ps.putBytes(salt);
|
|
127
|
+
var db = ps.getBytes();
|
|
128
|
+
|
|
129
|
+
/* 9. Let dbMask = MGF(H, emLen - hLen - 1). */
|
|
130
|
+
var maskLen = emLen - hLen - 1;
|
|
131
|
+
var dbMask = mgf.generate(h, maskLen);
|
|
132
|
+
|
|
133
|
+
/* 10. Let maskedDB = DB \xor dbMask. */
|
|
134
|
+
var maskedDB = '';
|
|
135
|
+
for (i = 0; i < maskLen; i++) {
|
|
136
|
+
maskedDB += String.fromCharCode(db.charCodeAt(i) ^ dbMask.charCodeAt(i));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* 11. Set the leftmost 8emLen - emBits bits of the leftmost octet in
|
|
140
|
+
* maskedDB to zero. */
|
|
141
|
+
var mask = 0xFF00 >> 8 * emLen - emBits & 0xFF;
|
|
142
|
+
maskedDB = String.fromCharCode(maskedDB.charCodeAt(0) & ~mask) + maskedDB.substr(1);
|
|
143
|
+
|
|
144
|
+
/* 12. Let EM = maskedDB || H || 0xbc.
|
|
145
|
+
* 13. Output EM. */
|
|
146
|
+
return maskedDB + h + String.fromCharCode(0xbc);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Verifies a PSS signature.
|
|
151
|
+
*
|
|
152
|
+
* This function implements EMSA-PSS-VERIFY as per RFC 3447, section 9.1.2.
|
|
153
|
+
*
|
|
154
|
+
* @param mHash the message digest hash, as a binary-encoded string, to
|
|
155
|
+
* compare against the signature.
|
|
156
|
+
* @param em the encoded message, as a binary-encoded string
|
|
157
|
+
* (RSA decryption result).
|
|
158
|
+
* @param modsBits the length of the RSA modulus in bits.
|
|
159
|
+
*
|
|
160
|
+
* @return true if the signature was verified, false if not.
|
|
161
|
+
*/
|
|
162
|
+
pssobj.verify = function (mHash, em, modBits) {
|
|
163
|
+
var i;
|
|
164
|
+
var emBits = modBits - 1;
|
|
165
|
+
var emLen = Math.ceil(emBits / 8);
|
|
166
|
+
|
|
167
|
+
/* c. Convert the message representative m to an encoded message EM
|
|
168
|
+
* of length emLen = ceil((modBits - 1) / 8) octets, where modBits
|
|
169
|
+
* is the length in bits of the RSA modulus n */
|
|
170
|
+
em = em.substr(-emLen);
|
|
171
|
+
|
|
172
|
+
/* 3. If emLen < hLen + sLen + 2, output "inconsistent" and stop. */
|
|
173
|
+
if (emLen < hLen + sLen + 2) {
|
|
174
|
+
throw new Error('Inconsistent parameters to PSS signature verification.');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* 4. If the rightmost octet of EM does not have hexadecimal value
|
|
178
|
+
* 0xbc, output "inconsistent" and stop. */
|
|
179
|
+
if (em.charCodeAt(emLen - 1) !== 0xbc) {
|
|
180
|
+
throw new Error('Encoded message does not end in 0xBC.');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and
|
|
184
|
+
* let H be the next hLen octets. */
|
|
185
|
+
var maskLen = emLen - hLen - 1;
|
|
186
|
+
var maskedDB = em.substr(0, maskLen);
|
|
187
|
+
var h = em.substr(maskLen, hLen);
|
|
188
|
+
|
|
189
|
+
/* 6. If the leftmost 8emLen - emBits bits of the leftmost octet in
|
|
190
|
+
* maskedDB are not all equal to zero, output "inconsistent" and stop. */
|
|
191
|
+
var mask = 0xFF00 >> 8 * emLen - emBits & 0xFF;
|
|
192
|
+
if ((maskedDB.charCodeAt(0) & mask) !== 0) {
|
|
193
|
+
throw new Error('Bits beyond keysize not zero as expected.');
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* 7. Let dbMask = MGF(H, emLen - hLen - 1). */
|
|
197
|
+
var dbMask = mgf.generate(h, maskLen);
|
|
198
|
+
|
|
199
|
+
/* 8. Let DB = maskedDB \xor dbMask. */
|
|
200
|
+
var db = '';
|
|
201
|
+
for (i = 0; i < maskLen; i++) {
|
|
202
|
+
db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* 9. Set the leftmost 8emLen - emBits bits of the leftmost octet
|
|
206
|
+
* in DB to zero. */
|
|
207
|
+
db = String.fromCharCode(db.charCodeAt(0) & ~mask) + db.substr(1);
|
|
208
|
+
|
|
209
|
+
/* 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero
|
|
210
|
+
* or if the octet at position emLen - hLen - sLen - 1 (the leftmost
|
|
211
|
+
* position is "position 1") does not have hexadecimal value 0x01,
|
|
212
|
+
* output "inconsistent" and stop. */
|
|
213
|
+
var checkLen = emLen - hLen - sLen - 2;
|
|
214
|
+
for (i = 0; i < checkLen; i++) {
|
|
215
|
+
if (db.charCodeAt(i) !== 0x00) {
|
|
216
|
+
throw new Error('Leftmost octets not zero as expected');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (db.charCodeAt(checkLen) !== 0x01) {
|
|
220
|
+
throw new Error('Inconsistent PSS signature, 0x01 marker not found');
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* 11. Let salt be the last sLen octets of DB. */
|
|
224
|
+
var salt = db.substr(-sLen);
|
|
225
|
+
|
|
226
|
+
/* 12. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt */
|
|
227
|
+
var m_ = new forge.util.ByteBuffer();
|
|
228
|
+
m_.fillWithByte(0, 8);
|
|
229
|
+
m_.putBytes(mHash);
|
|
230
|
+
m_.putBytes(salt);
|
|
231
|
+
|
|
232
|
+
/* 13. Let H' = Hash(M'), an octet string of length hLen. */
|
|
233
|
+
hash.start();
|
|
234
|
+
hash.update(m_.getBytes());
|
|
235
|
+
var h_ = hash.digest().getBytes();
|
|
236
|
+
|
|
237
|
+
/* 14. If H = H', output "consistent." Otherwise, output "inconsistent." */
|
|
238
|
+
return h === h_;
|
|
239
|
+
};
|
|
240
|
+
return pssobj;
|
|
241
|
+
};
|
|
242
|
+
return pss.exports;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export { requirePss as __require };
|
|
246
|
+
//# sourceMappingURL=pss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pss.js","sources":["../../../../node_modules/node-forge/lib/pss.js"],"sourcesContent":["/**\n * Javascript implementation of PKCS#1 PSS signature padding.\n *\n * @author Stefan Siegl\n *\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n */\nvar forge = require('./forge');\nrequire('./random');\nrequire('./util');\n\n// shortcut for PSS API\nvar pss = module.exports = forge.pss = forge.pss || {};\n\n/**\n * Creates a PSS signature scheme object.\n *\n * There are several ways to provide a salt for encoding:\n *\n * 1. Specify the saltLength only and the built-in PRNG will generate it.\n * 2. Specify the saltLength and a custom PRNG with 'getBytesSync' defined that\n * will be used.\n * 3. Specify the salt itself as a forge.util.ByteBuffer.\n *\n * @param options the options to use:\n * md the message digest object to use, a forge md instance.\n * mgf the mask generation function to use, a forge mgf instance.\n * [saltLength] the length of the salt in octets.\n * [prng] the pseudo-random number generator to use to produce a salt.\n * [salt] the salt to use when encoding.\n *\n * @return a signature scheme object.\n */\npss.create = function(options) {\n // backwards compatibility w/legacy args: hash, mgf, sLen\n if(arguments.length === 3) {\n options = {\n md: arguments[0],\n mgf: arguments[1],\n saltLength: arguments[2]\n };\n }\n\n var hash = options.md;\n var mgf = options.mgf;\n var hLen = hash.digestLength;\n\n var salt_ = options.salt || null;\n if(typeof salt_ === 'string') {\n // assume binary-encoded string\n salt_ = forge.util.createBuffer(salt_);\n }\n\n var sLen;\n if('saltLength' in options) {\n sLen = options.saltLength;\n } else if(salt_ !== null) {\n sLen = salt_.length();\n } else {\n throw new Error('Salt length not specified or specific salt not given.');\n }\n\n if(salt_ !== null && salt_.length() !== sLen) {\n throw new Error('Given salt length does not match length of given salt.');\n }\n\n var prng = options.prng || forge.random;\n\n var pssobj = {};\n\n /**\n * Encodes a PSS signature.\n *\n * This function implements EMSA-PSS-ENCODE as per RFC 3447, section 9.1.1.\n *\n * @param md the message digest object with the hash to sign.\n * @param modsBits the length of the RSA modulus in bits.\n *\n * @return the encoded message as a binary-encoded string of length\n * ceil((modBits - 1) / 8).\n */\n pssobj.encode = function(md, modBits) {\n var i;\n var emBits = modBits - 1;\n var emLen = Math.ceil(emBits / 8);\n\n /* 2. Let mHash = Hash(M), an octet string of length hLen. */\n var mHash = md.digest().getBytes();\n\n /* 3. If emLen < hLen + sLen + 2, output \"encoding error\" and stop. */\n if(emLen < hLen + sLen + 2) {\n throw new Error('Message is too long to encrypt.');\n }\n\n /* 4. Generate a random octet string salt of length sLen; if sLen = 0,\n * then salt is the empty string. */\n var salt;\n if(salt_ === null) {\n salt = prng.getBytesSync(sLen);\n } else {\n salt = salt_.bytes();\n }\n\n /* 5. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt; */\n var m_ = new forge.util.ByteBuffer();\n m_.fillWithByte(0, 8);\n m_.putBytes(mHash);\n m_.putBytes(salt);\n\n /* 6. Let H = Hash(M'), an octet string of length hLen. */\n hash.start();\n hash.update(m_.getBytes());\n var h = hash.digest().getBytes();\n\n /* 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2\n * zero octets. The length of PS may be 0. */\n var ps = new forge.util.ByteBuffer();\n ps.fillWithByte(0, emLen - sLen - hLen - 2);\n\n /* 8. Let DB = PS || 0x01 || salt; DB is an octet string of length\n * emLen - hLen - 1. */\n ps.putByte(0x01);\n ps.putBytes(salt);\n var db = ps.getBytes();\n\n /* 9. Let dbMask = MGF(H, emLen - hLen - 1). */\n var maskLen = emLen - hLen - 1;\n var dbMask = mgf.generate(h, maskLen);\n\n /* 10. Let maskedDB = DB \\xor dbMask. */\n var maskedDB = '';\n for(i = 0; i < maskLen; i++) {\n maskedDB += String.fromCharCode(db.charCodeAt(i) ^ dbMask.charCodeAt(i));\n }\n\n /* 11. Set the leftmost 8emLen - emBits bits of the leftmost octet in\n * maskedDB to zero. */\n var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF;\n maskedDB = String.fromCharCode(maskedDB.charCodeAt(0) & ~mask) +\n maskedDB.substr(1);\n\n /* 12. Let EM = maskedDB || H || 0xbc.\n * 13. Output EM. */\n return maskedDB + h + String.fromCharCode(0xbc);\n };\n\n /**\n * Verifies a PSS signature.\n *\n * This function implements EMSA-PSS-VERIFY as per RFC 3447, section 9.1.2.\n *\n * @param mHash the message digest hash, as a binary-encoded string, to\n * compare against the signature.\n * @param em the encoded message, as a binary-encoded string\n * (RSA decryption result).\n * @param modsBits the length of the RSA modulus in bits.\n *\n * @return true if the signature was verified, false if not.\n */\n pssobj.verify = function(mHash, em, modBits) {\n var i;\n var emBits = modBits - 1;\n var emLen = Math.ceil(emBits / 8);\n\n /* c. Convert the message representative m to an encoded message EM\n * of length emLen = ceil((modBits - 1) / 8) octets, where modBits\n * is the length in bits of the RSA modulus n */\n em = em.substr(-emLen);\n\n /* 3. If emLen < hLen + sLen + 2, output \"inconsistent\" and stop. */\n if(emLen < hLen + sLen + 2) {\n throw new Error('Inconsistent parameters to PSS signature verification.');\n }\n\n /* 4. If the rightmost octet of EM does not have hexadecimal value\n * 0xbc, output \"inconsistent\" and stop. */\n if(em.charCodeAt(emLen - 1) !== 0xbc) {\n throw new Error('Encoded message does not end in 0xBC.');\n }\n\n /* 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and\n * let H be the next hLen octets. */\n var maskLen = emLen - hLen - 1;\n var maskedDB = em.substr(0, maskLen);\n var h = em.substr(maskLen, hLen);\n\n /* 6. If the leftmost 8emLen - emBits bits of the leftmost octet in\n * maskedDB are not all equal to zero, output \"inconsistent\" and stop. */\n var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF;\n if((maskedDB.charCodeAt(0) & mask) !== 0) {\n throw new Error('Bits beyond keysize not zero as expected.');\n }\n\n /* 7. Let dbMask = MGF(H, emLen - hLen - 1). */\n var dbMask = mgf.generate(h, maskLen);\n\n /* 8. Let DB = maskedDB \\xor dbMask. */\n var db = '';\n for(i = 0; i < maskLen; i++) {\n db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i));\n }\n\n /* 9. Set the leftmost 8emLen - emBits bits of the leftmost octet\n * in DB to zero. */\n db = String.fromCharCode(db.charCodeAt(0) & ~mask) + db.substr(1);\n\n /* 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero\n * or if the octet at position emLen - hLen - sLen - 1 (the leftmost\n * position is \"position 1\") does not have hexadecimal value 0x01,\n * output \"inconsistent\" and stop. */\n var checkLen = emLen - hLen - sLen - 2;\n for(i = 0; i < checkLen; i++) {\n if(db.charCodeAt(i) !== 0x00) {\n throw new Error('Leftmost octets not zero as expected');\n }\n }\n\n if(db.charCodeAt(checkLen) !== 0x01) {\n throw new Error('Inconsistent PSS signature, 0x01 marker not found');\n }\n\n /* 11. Let salt be the last sLen octets of DB. */\n var salt = db.substr(-sLen);\n\n /* 12. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt */\n var m_ = new forge.util.ByteBuffer();\n m_.fillWithByte(0, 8);\n m_.putBytes(mHash);\n m_.putBytes(salt);\n\n /* 13. Let H' = Hash(M'), an octet string of length hLen. */\n hash.start();\n hash.update(m_.getBytes());\n var h_ = hash.digest().getBytes();\n\n /* 14. If H = H', output \"consistent.\" Otherwise, output \"inconsistent.\" */\n return h === h_;\n };\n\n return pssobj;\n};\n"],"names":["forge","require$$0","require$$1","require$$2","pss","pssModule","exports","create","options","arguments","length","md","mgf","saltLength","hash","hLen","digestLength","salt_","salt","util","createBuffer","sLen","Error","prng","random","pssobj","encode","modBits","i","emBits","emLen","Math","ceil","mHash","digest","getBytes","getBytesSync","bytes","m_","ByteBuffer","fillWithByte","putBytes","start","update","h","ps","putByte","db","maskLen","dbMask","generate","maskedDB","String","fromCharCode","charCodeAt","mask","substr","verify","em","checkLen","h_"],"mappings":";;;;;;;;;;;;;;;;AAOA,EAAA,IAAIA,KAAK,GAAGC,YAAA,EAAkB;AAC9BC,EAAAA,aAAA,EAAmB;AACnBC,EAAAA,WAAA,EAAiB;;AAEjB;AACA,EAAA,IAAIC,KAAG,GAAGC,GAAA,CAAAC,OAAc,GAAGN,KAAK,CAACI,GAAG,GAAGJ,KAAK,CAACI,GAAG,IAAI,EAAE;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAA,EAAAA,KAAG,CAACG,MAAM,GAAG,UAASC,OAAO,EAAE;AAC/B;AACE,IAAA,IAAGC,SAAS,CAACC,MAAM,KAAK,CAAC,EAAE;AACzBF,MAAAA,OAAO,GAAG;AACRG,QAAAA,EAAE,EAAEF,SAAS,CAA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'../../../_virtual/random.js';
|
|
2
|
+
import { __require as requireForge } from './forge.js';
|
|
3
|
+
import { __require as requireAes } from './aes.js';
|
|
4
|
+
import { __require as requireSha256 } from './sha256.js';
|
|
5
|
+
import { __require as requirePrng } from './prng.js';
|
|
6
|
+
import { __require as requireUtil } from './util.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* An API for getting cryptographically-secure random bytes. The bytes are
|
|
10
|
+
* generated using the Fortuna algorithm devised by Bruce Schneier and
|
|
11
|
+
* Niels Ferguson.
|
|
12
|
+
*
|
|
13
|
+
* Getting strong random bytes is not yet easy to do in javascript. The only
|
|
14
|
+
* truish random entropy that can be collected is from the mouse, keyboard, or
|
|
15
|
+
* from timing with respect to page loads, etc. This generator makes a poor
|
|
16
|
+
* attempt at providing random bytes when those sources haven't yet provided
|
|
17
|
+
* enough entropy to initially seed or to reseed the PRNG.
|
|
18
|
+
*
|
|
19
|
+
* @author Dave Longley
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2009-2014 Digital Bazaar, Inc.
|
|
22
|
+
*/
|
|
23
|
+
var hasRequiredRandom;
|
|
24
|
+
function requireRandom() {
|
|
25
|
+
if (hasRequiredRandom) return random.exports;
|
|
26
|
+
hasRequiredRandom = 1;
|
|
27
|
+
var forge = requireForge();
|
|
28
|
+
requireAes();
|
|
29
|
+
requireSha256();
|
|
30
|
+
requirePrng();
|
|
31
|
+
requireUtil();
|
|
32
|
+
(function () {
|
|
33
|
+
// forge.random already defined
|
|
34
|
+
if (forge.random && forge.random.getBytes) {
|
|
35
|
+
random.exports = forge.random;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
(function (jQuery) {
|
|
39
|
+
// the default prng plugin, uses AES-128
|
|
40
|
+
var prng_aes = {};
|
|
41
|
+
var _prng_aes_output = new Array(4);
|
|
42
|
+
var _prng_aes_buffer = forge.util.createBuffer();
|
|
43
|
+
prng_aes.formatKey = function (key) {
|
|
44
|
+
// convert the key into 32-bit integers
|
|
45
|
+
var tmp = forge.util.createBuffer(key);
|
|
46
|
+
key = new Array(4);
|
|
47
|
+
key[0] = tmp.getInt32();
|
|
48
|
+
key[1] = tmp.getInt32();
|
|
49
|
+
key[2] = tmp.getInt32();
|
|
50
|
+
key[3] = tmp.getInt32();
|
|
51
|
+
|
|
52
|
+
// return the expanded key
|
|
53
|
+
return forge.aes._expandKey(key, false);
|
|
54
|
+
};
|
|
55
|
+
prng_aes.formatSeed = function (seed) {
|
|
56
|
+
// convert seed into 32-bit integers
|
|
57
|
+
var tmp = forge.util.createBuffer(seed);
|
|
58
|
+
seed = new Array(4);
|
|
59
|
+
seed[0] = tmp.getInt32();
|
|
60
|
+
seed[1] = tmp.getInt32();
|
|
61
|
+
seed[2] = tmp.getInt32();
|
|
62
|
+
seed[3] = tmp.getInt32();
|
|
63
|
+
return seed;
|
|
64
|
+
};
|
|
65
|
+
prng_aes.cipher = function (key, seed) {
|
|
66
|
+
forge.aes._updateBlock(key, seed, _prng_aes_output, false);
|
|
67
|
+
_prng_aes_buffer.putInt32(_prng_aes_output[0]);
|
|
68
|
+
_prng_aes_buffer.putInt32(_prng_aes_output[1]);
|
|
69
|
+
_prng_aes_buffer.putInt32(_prng_aes_output[2]);
|
|
70
|
+
_prng_aes_buffer.putInt32(_prng_aes_output[3]);
|
|
71
|
+
return _prng_aes_buffer.getBytes();
|
|
72
|
+
};
|
|
73
|
+
prng_aes.increment = function (seed) {
|
|
74
|
+
// FIXME: do we care about carry or signed issues?
|
|
75
|
+
++seed[3];
|
|
76
|
+
return seed;
|
|
77
|
+
};
|
|
78
|
+
prng_aes.md = forge.md.sha256;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Creates a new PRNG.
|
|
82
|
+
*/
|
|
83
|
+
function spawnPrng() {
|
|
84
|
+
var ctx = forge.prng.create(prng_aes);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Gets random bytes. If a native secure crypto API is unavailable, this
|
|
88
|
+
* method tries to make the bytes more unpredictable by drawing from data that
|
|
89
|
+
* can be collected from the user of the browser, eg: mouse movement.
|
|
90
|
+
*
|
|
91
|
+
* If a callback is given, this method will be called asynchronously.
|
|
92
|
+
*
|
|
93
|
+
* @param count the number of random bytes to get.
|
|
94
|
+
* @param [callback(err, bytes)] called once the operation completes.
|
|
95
|
+
*
|
|
96
|
+
* @return the random bytes in a string.
|
|
97
|
+
*/
|
|
98
|
+
ctx.getBytes = function (count, callback) {
|
|
99
|
+
return ctx.generate(count, callback);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Gets random bytes asynchronously. If a native secure crypto API is
|
|
104
|
+
* unavailable, this method tries to make the bytes more unpredictable by
|
|
105
|
+
* drawing from data that can be collected from the user of the browser,
|
|
106
|
+
* eg: mouse movement.
|
|
107
|
+
*
|
|
108
|
+
* @param count the number of random bytes to get.
|
|
109
|
+
*
|
|
110
|
+
* @return the random bytes in a string.
|
|
111
|
+
*/
|
|
112
|
+
ctx.getBytesSync = function (count) {
|
|
113
|
+
return ctx.generate(count);
|
|
114
|
+
};
|
|
115
|
+
return ctx;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// create default prng context
|
|
119
|
+
var _ctx = spawnPrng();
|
|
120
|
+
|
|
121
|
+
// add other sources of entropy only if window.crypto.getRandomValues is not
|
|
122
|
+
// available -- otherwise this source will be automatically used by the prng
|
|
123
|
+
var getRandomValues = null;
|
|
124
|
+
var globalScope = forge.util.globalScope;
|
|
125
|
+
var _crypto = globalScope.crypto || globalScope.msCrypto;
|
|
126
|
+
if (_crypto && _crypto.getRandomValues) {
|
|
127
|
+
getRandomValues = function (arr) {
|
|
128
|
+
return _crypto.getRandomValues(arr);
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (forge.options.usePureJavaScript || !forge.util.isNodejs && !getRandomValues) {
|
|
132
|
+
|
|
133
|
+
// get load time entropy
|
|
134
|
+
_ctx.collectInt(+new Date(), 32);
|
|
135
|
+
|
|
136
|
+
// add some entropy from navigator object
|
|
137
|
+
if (typeof navigator !== 'undefined') {
|
|
138
|
+
var _navBytes = '';
|
|
139
|
+
for (var key in navigator) {
|
|
140
|
+
try {
|
|
141
|
+
if (typeof navigator[key] == 'string') {
|
|
142
|
+
_navBytes += navigator[key];
|
|
143
|
+
}
|
|
144
|
+
} catch (e) {
|
|
145
|
+
/* Some navigator keys might not be accessible, e.g. the geolocation
|
|
146
|
+
attribute throws an exception if touched in Mozilla chrome://
|
|
147
|
+
context.
|
|
148
|
+
Silently ignore this and just don't use this as a source of
|
|
149
|
+
entropy. */
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
_ctx.collect(_navBytes);
|
|
153
|
+
_navBytes = null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// add mouse and keyboard collectors if jquery is available
|
|
157
|
+
if (jQuery) {
|
|
158
|
+
// set up mouse entropy capture
|
|
159
|
+
jQuery().mousemove(function (e) {
|
|
160
|
+
// add mouse coords
|
|
161
|
+
_ctx.collectInt(e.clientX, 16);
|
|
162
|
+
_ctx.collectInt(e.clientY, 16);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// set up keyboard entropy capture
|
|
166
|
+
jQuery().keypress(function (e) {
|
|
167
|
+
_ctx.collectInt(e.charCode, 8);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* Random API */
|
|
173
|
+
if (!forge.random) {
|
|
174
|
+
forge.random = _ctx;
|
|
175
|
+
} else {
|
|
176
|
+
// extend forge.random with _ctx
|
|
177
|
+
for (var key in _ctx) {
|
|
178
|
+
forge.random[key] = _ctx[key];
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// expose spawn PRNG
|
|
183
|
+
forge.random.createInstance = spawnPrng;
|
|
184
|
+
random.exports = forge.random;
|
|
185
|
+
})(typeof jQuery !== 'undefined' ? jQuery : null);
|
|
186
|
+
})();
|
|
187
|
+
return random.exports;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export { requireRandom as __require };
|
|
191
|
+
//# sourceMappingURL=random.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.js","sources":["../../../../node_modules/node-forge/lib/random.js"],"sourcesContent":["/**\n * An API for getting cryptographically-secure random bytes. The bytes are\n * generated using the Fortuna algorithm devised by Bruce Schneier and\n * Niels Ferguson.\n *\n * Getting strong random bytes is not yet easy to do in javascript. The only\n * truish random entropy that can be collected is from the mouse, keyboard, or\n * from timing with respect to page loads, etc. This generator makes a poor\n * attempt at providing random bytes when those sources haven't yet provided\n * enough entropy to initially seed or to reseed the PRNG.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2009-2014 Digital Bazaar, Inc.\n */\nvar forge = require('./forge');\nrequire('./aes');\nrequire('./sha256');\nrequire('./prng');\nrequire('./util');\n\n(function() {\n\n// forge.random already defined\nif(forge.random && forge.random.getBytes) {\n module.exports = forge.random;\n return;\n}\n\n(function(jQuery) {\n\n// the default prng plugin, uses AES-128\nvar prng_aes = {};\nvar _prng_aes_output = new Array(4);\nvar _prng_aes_buffer = forge.util.createBuffer();\nprng_aes.formatKey = function(key) {\n // convert the key into 32-bit integers\n var tmp = forge.util.createBuffer(key);\n key = new Array(4);\n key[0] = tmp.getInt32();\n key[1] = tmp.getInt32();\n key[2] = tmp.getInt32();\n key[3] = tmp.getInt32();\n\n // return the expanded key\n return forge.aes._expandKey(key, false);\n};\nprng_aes.formatSeed = function(seed) {\n // convert seed into 32-bit integers\n var tmp = forge.util.createBuffer(seed);\n seed = new Array(4);\n seed[0] = tmp.getInt32();\n seed[1] = tmp.getInt32();\n seed[2] = tmp.getInt32();\n seed[3] = tmp.getInt32();\n return seed;\n};\nprng_aes.cipher = function(key, seed) {\n forge.aes._updateBlock(key, seed, _prng_aes_output, false);\n _prng_aes_buffer.putInt32(_prng_aes_output[0]);\n _prng_aes_buffer.putInt32(_prng_aes_output[1]);\n _prng_aes_buffer.putInt32(_prng_aes_output[2]);\n _prng_aes_buffer.putInt32(_prng_aes_output[3]);\n return _prng_aes_buffer.getBytes();\n};\nprng_aes.increment = function(seed) {\n // FIXME: do we care about carry or signed issues?\n ++seed[3];\n return seed;\n};\nprng_aes.md = forge.md.sha256;\n\n/**\n * Creates a new PRNG.\n */\nfunction spawnPrng() {\n var ctx = forge.prng.create(prng_aes);\n\n /**\n * Gets random bytes. If a native secure crypto API is unavailable, this\n * method tries to make the bytes more unpredictable by drawing from data that\n * can be collected from the user of the browser, eg: mouse movement.\n *\n * If a callback is given, this method will be called asynchronously.\n *\n * @param count the number of random bytes to get.\n * @param [callback(err, bytes)] called once the operation completes.\n *\n * @return the random bytes in a string.\n */\n ctx.getBytes = function(count, callback) {\n return ctx.generate(count, callback);\n };\n\n /**\n * Gets random bytes asynchronously. If a native secure crypto API is\n * unavailable, this method tries to make the bytes more unpredictable by\n * drawing from data that can be collected from the user of the browser,\n * eg: mouse movement.\n *\n * @param count the number of random bytes to get.\n *\n * @return the random bytes in a string.\n */\n ctx.getBytesSync = function(count) {\n return ctx.generate(count);\n };\n\n return ctx;\n}\n\n// create default prng context\nvar _ctx = spawnPrng();\n\n// add other sources of entropy only if window.crypto.getRandomValues is not\n// available -- otherwise this source will be automatically used by the prng\nvar getRandomValues = null;\nvar globalScope = forge.util.globalScope;\nvar _crypto = globalScope.crypto || globalScope.msCrypto;\nif(_crypto && _crypto.getRandomValues) {\n getRandomValues = function(arr) {\n return _crypto.getRandomValues(arr);\n };\n}\n\nif(forge.options.usePureJavaScript ||\n (!forge.util.isNodejs && !getRandomValues)) {\n // if this is a web worker, do not use weak entropy, instead register to\n // receive strong entropy asynchronously from the main thread\n if(typeof window === 'undefined' || window.document === undefined) {\n // FIXME:\n }\n\n // get load time entropy\n _ctx.collectInt(+new Date(), 32);\n\n // add some entropy from navigator object\n if(typeof(navigator) !== 'undefined') {\n var _navBytes = '';\n for(var key in navigator) {\n try {\n if(typeof(navigator[key]) == 'string') {\n _navBytes += navigator[key];\n }\n } catch(e) {\n /* Some navigator keys might not be accessible, e.g. the geolocation\n attribute throws an exception if touched in Mozilla chrome://\n context.\n\n Silently ignore this and just don't use this as a source of\n entropy. */\n }\n }\n _ctx.collect(_navBytes);\n _navBytes = null;\n }\n\n // add mouse and keyboard collectors if jquery is available\n if(jQuery) {\n // set up mouse entropy capture\n jQuery().mousemove(function(e) {\n // add mouse coords\n _ctx.collectInt(e.clientX, 16);\n _ctx.collectInt(e.clientY, 16);\n });\n\n // set up keyboard entropy capture\n jQuery().keypress(function(e) {\n _ctx.collectInt(e.charCode, 8);\n });\n }\n}\n\n/* Random API */\nif(!forge.random) {\n forge.random = _ctx;\n} else {\n // extend forge.random with _ctx\n for(var key in _ctx) {\n forge.random[key] = _ctx[key];\n }\n}\n\n// expose spawn PRNG\nforge.random.createInstance = spawnPrng;\n\nmodule.exports = forge.random;\n\n})(typeof(jQuery) !== 'undefined' ? jQuery : null);\n\n})();\n"],"names":["forge","require$$0","require$$1","require$$2","require$$3","require$$4","random","getBytes","randomModule","exports","jQuery","prng_aes","_prng_aes_output","Array","_prng_aes_buffer","util","createBuffer","formatKey","key","tmp","getInt32","aes","_expandKey","formatSeed","seed","cipher","_updateBlock","putInt32","increment","md","sha256","spawnPrng","ctx","prng","create","count","callback","generate","getBytesSync","_ctx","getRandomValues","globalScope","_crypto","crypto","msCrypto","arr","options","usePureJavaScript","isNodejs","collectInt","Date","navigator","_navBytes","e","collect","mousemove","clientX","clientY","keypress","charCode","createInstance"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,EAAA,IAAIA,KAAK,GAAGC,YAAA,EAAkB;AAC9BC,EAAAA,UAAA,EAAgB;AAChBC,EAAAA,aAAA,EAAmB;AACnBC,EAAAA,WAAA,EAAiB;AACjBC,EAAAA,WAAA,EAAiB;AAEjB,EAAA,CAAC,YAAW;AAEZ;IACA,IAAGL,KAAK,CAACM,MAAM,IAAIN,KAAK,CAACM,MAAM,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