node-forge 0.7.5 → 0.8.2
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/CHANGELOG.md +58 -0
- package/README.md +41 -39
- package/dist/forge.all.min.js +1 -1
- package/dist/forge.min.js +1 -1
- package/flash/package.json +28 -0
- package/lib/aesCipherSuites.js +2 -4
- package/lib/cipherModes.js +1 -1
- package/lib/des.js +2 -1
- package/lib/kem.js +2 -2
- package/lib/oids.js +2 -0
- package/lib/pkcs1.js +1 -1
- package/lib/pkcs7.js +30 -16
- package/lib/prng.js +6 -7
- package/lib/random.js +7 -7
- package/lib/rsa.js +162 -100
- package/lib/sha1.js +6 -6
- package/lib/sha512.js +1 -1
- package/lib/tls.js +43 -30
- package/lib/util.js +17 -2
- package/lib/x509.js +313 -251
- package/package.json +10 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
Forge ChangeLog
|
|
2
2
|
===============
|
|
3
3
|
|
|
4
|
+
## 0.8.2 - 2019-03-18
|
|
5
|
+
|
|
6
|
+
### Fixed
|
|
7
|
+
- Fix tag calculation when continuing an AES-GCM block.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Switch to eslint.
|
|
11
|
+
|
|
12
|
+
## 0.8.1 - 2019-02-23
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- Fix off-by-1 bug with kem random generation.
|
|
16
|
+
|
|
17
|
+
## 0.8.0 - 2019-01-31
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- Handle creation of certificates with `notBefore` and `notAfter` dates less
|
|
21
|
+
than Jan 1, 1950 or greater than or equal to Jan 1, 2050.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- Add OID 2.5.4.13 "description".
|
|
25
|
+
- Add OID 2.16.840.1.113730.1.13 "nsComment".
|
|
26
|
+
- Also handle extension when creating a certificate.
|
|
27
|
+
- `pki.verifyCertificateChain`:
|
|
28
|
+
- Add `validityCheckDate` option to allow checking the certificate validity
|
|
29
|
+
period against an arbitrary `Date` or `null` for no check at all. The
|
|
30
|
+
current date is used by default.
|
|
31
|
+
- `tls.createConnection`:
|
|
32
|
+
- Add `verifyOptions` option that passes through to
|
|
33
|
+
`pki.verifyCertificateChain`. Can be used for the above `validityCheckDate`
|
|
34
|
+
option.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- Support WebCrypto API in web workers.
|
|
38
|
+
- `rsa.generateKeyPair`:
|
|
39
|
+
- Use `crypto.generateKeyPair`/`crypto.generateKeyPairSync` on Node.js if
|
|
40
|
+
available (10.12.0+) and not in pure JS mode.
|
|
41
|
+
- Use JS fallback in `rsa.generateKeyPair` if `prng` option specified since
|
|
42
|
+
this isn't supported by current native APIs.
|
|
43
|
+
- Only run key generation comparison tests if keys will be deterministic.
|
|
44
|
+
- PhantomJS is deprecated, now using Headless Chrome with Karma.
|
|
45
|
+
- **Note**: Using Headless Chrome vs PhantomJS may cause newer JS features to
|
|
46
|
+
slip into releases without proper support for older runtimes and browsers.
|
|
47
|
+
Please report such issues and they will be addressed.
|
|
48
|
+
- `pki.verifyCertificateChain`:
|
|
49
|
+
- Signature changed to `(caStore, chain, options)`. Older `(caStore, chain,
|
|
50
|
+
verify)` signature is still supported. New style is to to pass in a
|
|
51
|
+
`verify` option.
|
|
52
|
+
|
|
53
|
+
## 0.7.6 - 2018-08-14
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
- Test on Node.js 10.x.
|
|
57
|
+
- Support for PKCS#7 detached signatures.
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
- Improve webpack/browser detection.
|
|
61
|
+
|
|
4
62
|
## 0.7.5 - 2018-03-30
|
|
5
63
|
|
|
6
64
|
### Fixed
|
package/README.md
CHANGED
|
@@ -209,8 +209,6 @@ forge you need.
|
|
|
209
209
|
Testing
|
|
210
210
|
-------
|
|
211
211
|
|
|
212
|
-
See the [testing README](./tests/README.md) for full details.
|
|
213
|
-
|
|
214
212
|
### Prepare to run tests
|
|
215
213
|
|
|
216
214
|
npm install
|
|
@@ -221,10 +219,10 @@ Forge natively runs in a [Node.js][] environment:
|
|
|
221
219
|
|
|
222
220
|
npm test
|
|
223
221
|
|
|
224
|
-
### Running automated tests with
|
|
222
|
+
### Running automated tests with Headless Chrome
|
|
225
223
|
|
|
226
|
-
Automated testing is done via [Karma][]. By default it will run the tests
|
|
227
|
-
|
|
224
|
+
Automated testing is done via [Karma][]. By default it will run the tests with
|
|
225
|
+
Headless Chrome.
|
|
228
226
|
|
|
229
227
|
npm run test-karma
|
|
230
228
|
|
|
@@ -241,7 +239,7 @@ By default [webpack][] is used. [Browserify][] can also be used.
|
|
|
241
239
|
|
|
242
240
|
You can also specify one or more browsers to use.
|
|
243
241
|
|
|
244
|
-
npm run test-karma -- --browsers Chrome,Firefox,Safari,
|
|
242
|
+
npm run test-karma -- --browsers Chrome,Firefox,Safari,ChromeHeadless
|
|
245
243
|
|
|
246
244
|
The reporter option and `BUNDLER` environment variable can also be used.
|
|
247
245
|
|
|
@@ -961,14 +959,14 @@ __Examples__
|
|
|
961
959
|
var rsa = forge.pki.rsa;
|
|
962
960
|
|
|
963
961
|
// generate an RSA key pair synchronously
|
|
964
|
-
// *NOT RECOMMENDED
|
|
965
|
-
// use native
|
|
962
|
+
// *NOT RECOMMENDED*: Can be significantly slower than async and may block
|
|
963
|
+
// JavaScript execution. Will use native Node.js 10.12.0+ API if possible.
|
|
966
964
|
var keypair = rsa.generateKeyPair({bits: 2048, e: 0x10001});
|
|
967
965
|
|
|
968
966
|
// generate an RSA key pair asynchronously (uses web workers if available)
|
|
969
967
|
// use workers: -1 to run a fast core estimator to optimize # of workers
|
|
970
|
-
// *RECOMMENDED
|
|
971
|
-
//
|
|
968
|
+
// *RECOMMENDED*: Can be significantly faster than sync. Will use native
|
|
969
|
+
// Node.js 10.12.0+ or WebCrypto API if possible.
|
|
972
970
|
rsa.generateKeyPair({bits: 2048, workers: 2}, function(err, keypair) {
|
|
973
971
|
// keypair.privateKey, keypair.publicKey
|
|
974
972
|
});
|
|
@@ -1378,6 +1376,10 @@ p7.addSigner({
|
|
|
1378
1376
|
p7.sign();
|
|
1379
1377
|
var pem = forge.pkcs7.messageToPem(p7);
|
|
1380
1378
|
|
|
1379
|
+
// PKCS#7 Sign in detached mode.
|
|
1380
|
+
// Includes the signature and certificate without the signed data.
|
|
1381
|
+
p7.sign({detached: true});
|
|
1382
|
+
|
|
1381
1383
|
```
|
|
1382
1384
|
|
|
1383
1385
|
<a name="pkcs8" />
|
|
@@ -2035,8 +2037,8 @@ When using this code please keep the following in mind:
|
|
|
2035
2037
|
Library Background
|
|
2036
2038
|
------------------
|
|
2037
2039
|
|
|
2038
|
-
*
|
|
2039
|
-
*
|
|
2040
|
+
* https://digitalbazaar.com/2010/07/20/javascript-tls-1/
|
|
2041
|
+
* https://digitalbazaar.com/2010/07/20/javascript-tls-2/
|
|
2040
2042
|
|
|
2041
2043
|
Contact
|
|
2042
2044
|
-------
|
|
@@ -2056,40 +2058,40 @@ Financial support is welcome and helps contribute to futher development:
|
|
|
2056
2058
|
|
|
2057
2059
|
[#forgejs]: https://webchat.freenode.net/?channels=#forgejs
|
|
2058
2060
|
[0.6.x]: https://github.com/digitalbazaar/forge/tree/0.6.x
|
|
2059
|
-
[3DES]:
|
|
2060
|
-
[AES]:
|
|
2061
|
-
[ASN.1]:
|
|
2061
|
+
[3DES]: https://en.wikipedia.org/wiki/Triple_DES
|
|
2062
|
+
[AES]: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
|
|
2063
|
+
[ASN.1]: https://en.wikipedia.org/wiki/ASN.1
|
|
2062
2064
|
[Bower]: https://bower.io/
|
|
2063
2065
|
[Browserify]: http://browserify.org/
|
|
2064
|
-
[CBC]:
|
|
2065
|
-
[CFB]:
|
|
2066
|
-
[CTR]:
|
|
2066
|
+
[CBC]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
|
|
2067
|
+
[CFB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
|
|
2068
|
+
[CTR]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
|
|
2067
2069
|
[CommonJS]: https://en.wikipedia.org/wiki/CommonJS
|
|
2068
|
-
[DES]:
|
|
2069
|
-
[ECB]:
|
|
2070
|
-
[Fortuna]:
|
|
2071
|
-
[GCM]:
|
|
2072
|
-
[HMAC]:
|
|
2073
|
-
[JavaScript]:
|
|
2070
|
+
[DES]: https://en.wikipedia.org/wiki/Data_Encryption_Standard
|
|
2071
|
+
[ECB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
|
|
2072
|
+
[Fortuna]: https://en.wikipedia.org/wiki/Fortuna_(PRNG)
|
|
2073
|
+
[GCM]: https://en.wikipedia.org/wiki/GCM_mode
|
|
2074
|
+
[HMAC]: https://en.wikipedia.org/wiki/HMAC
|
|
2075
|
+
[JavaScript]: https://en.wikipedia.org/wiki/JavaScript
|
|
2074
2076
|
[Karma]: https://karma-runner.github.io/
|
|
2075
|
-
[MD5]:
|
|
2076
|
-
[Node.js]:
|
|
2077
|
-
[OFB]:
|
|
2078
|
-
[PKCS#10]:
|
|
2079
|
-
[PKCS#12]:
|
|
2080
|
-
[PKCS#5]:
|
|
2081
|
-
[PKCS#7]:
|
|
2077
|
+
[MD5]: https://en.wikipedia.org/wiki/MD5
|
|
2078
|
+
[Node.js]: https://nodejs.org/
|
|
2079
|
+
[OFB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
|
|
2080
|
+
[PKCS#10]: https://en.wikipedia.org/wiki/Certificate_signing_request
|
|
2081
|
+
[PKCS#12]: https://en.wikipedia.org/wiki/PKCS_%E2%99%AF12
|
|
2082
|
+
[PKCS#5]: https://en.wikipedia.org/wiki/PKCS
|
|
2083
|
+
[PKCS#7]: https://en.wikipedia.org/wiki/Cryptographic_Message_Syntax
|
|
2082
2084
|
[PayPal]: https://www.paypal.com/
|
|
2083
|
-
[RC2]:
|
|
2084
|
-
[SHA-1]:
|
|
2085
|
-
[SHA-256]:
|
|
2086
|
-
[SHA-384]:
|
|
2087
|
-
[SHA-512]:
|
|
2085
|
+
[RC2]: https://en.wikipedia.org/wiki/RC2
|
|
2086
|
+
[SHA-1]: https://en.wikipedia.org/wiki/SHA-1
|
|
2087
|
+
[SHA-256]: https://en.wikipedia.org/wiki/SHA-256
|
|
2088
|
+
[SHA-384]: https://en.wikipedia.org/wiki/SHA-384
|
|
2089
|
+
[SHA-512]: https://en.wikipedia.org/wiki/SHA-512
|
|
2088
2090
|
[Subresource Integrity]: https://www.w3.org/TR/SRI/
|
|
2089
|
-
[TLS]:
|
|
2091
|
+
[TLS]: https://en.wikipedia.org/wiki/Transport_Layer_Security
|
|
2090
2092
|
[UMD]: https://github.com/umdjs/umd
|
|
2091
|
-
[X.509]:
|
|
2093
|
+
[X.509]: https://en.wikipedia.org/wiki/X.509
|
|
2092
2094
|
[freenode]: https://freenode.net/
|
|
2093
2095
|
[unpkg]: https://unpkg.com/
|
|
2094
2096
|
[webpack]: https://webpack.github.io/
|
|
2095
|
-
[TweetNaCl]: https://github.com/dchest/tweetnacl-js
|
|
2097
|
+
[TweetNaCl.js]: https://github.com/dchest/tweetnacl-js
|