node-forge 0.9.1 → 1.1.0
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 +97 -0
- package/README.md +11 -39
- package/dist/forge.all.min.js +1 -1
- package/dist/forge.all.min.js.map +1 -1
- package/dist/forge.min.js +1 -1
- package/dist/forge.min.js.map +1 -1
- package/dist/prime.worker.min.js +1 -1
- package/lib/http.js +16 -34
- package/lib/index.js +0 -2
- package/lib/log.js +10 -5
- package/lib/oids.js +4 -1
- package/lib/pem.js +8 -1
- package/lib/pkcs7.js +6 -3
- package/lib/pkcs7asn1.js +2 -1
- package/lib/prng.js +1 -1
- package/lib/util.js +0 -348
- package/lib/x509.js +6 -2
- package/lib/xhr.js +8 -6
- package/package.json +20 -17
- package/lib/debug.js +0 -78
- package/lib/task.js +0 -725
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,103 @@
|
|
|
1
1
|
Forge ChangeLog
|
|
2
2
|
===============
|
|
3
3
|
|
|
4
|
+
## 1.1.0 - 2022-01-06
|
|
5
|
+
|
|
6
|
+
### Fixed
|
|
7
|
+
- [x509]: Correctly compute certificate issuer and subject hashes to match
|
|
8
|
+
behavior of openssl.
|
|
9
|
+
- [pem]: Accept certificate requests with "NEW" in the label. "BEGIN NEW
|
|
10
|
+
CERTIFICATE REQUEST" handled as "BEGIN CERTIFICATE REQUEST".
|
|
11
|
+
|
|
12
|
+
## 1.0.0 - 2022-01-04
|
|
13
|
+
|
|
14
|
+
### Notes
|
|
15
|
+
- **1.0.0**!
|
|
16
|
+
- This project is over a decade old! Time for a 1.0.0 release.
|
|
17
|
+
- The URL related changes may expose bugs in some of the networking related
|
|
18
|
+
code (unrelated to the much wider used cryptography code). The automated and
|
|
19
|
+
manual test coverage for this code is weak at best. Issues or patches to
|
|
20
|
+
update the code or tests would be appreciated.
|
|
21
|
+
|
|
22
|
+
### Removed
|
|
23
|
+
- **SECURITY**, **BREAKING**: Remove `forge.debug` API. The API has the
|
|
24
|
+
potential for prototype pollution. This API was only briefly used by the
|
|
25
|
+
maintainers for internal project debug purposes and was never intended to be
|
|
26
|
+
used with untrusted user inputs. This API was not documented or advertised
|
|
27
|
+
and is being removed rather than fixed.
|
|
28
|
+
- **SECURITY**, **BREAKING**: Remove `forge.util.parseUrl()` (and
|
|
29
|
+
`forge.http.parseUrl` alias) and use the [WHATWG URL
|
|
30
|
+
Standard](https://url.spec.whatwg.org/). `URL` is supported by modern browers
|
|
31
|
+
and modern Node.js. This change is needed to address URL parsing security
|
|
32
|
+
issues. If `forge.util.parseUrl()` is used directly or through `forge.xhr` or
|
|
33
|
+
`forge.http` APIs, and support is needed for environments without `URL`
|
|
34
|
+
support, then a polyfill must be used.
|
|
35
|
+
- **BREAKING**: Remove `forge.task` API. This API was never used, documented,
|
|
36
|
+
or advertised by the maintainers. If anyone was using this API and wishes to
|
|
37
|
+
continue development it in other project, please let the maintainers know.
|
|
38
|
+
Due to use in the test suite, a modified version is located in
|
|
39
|
+
`tests/support/`.
|
|
40
|
+
- **BREAKING**: Remove `forge.util.makeLink`, `forge.util.makeRequest`,
|
|
41
|
+
`forge.util.parseFragment`, `forge.util.getQueryVariables`. Replace with
|
|
42
|
+
`URL`, `URLSearchParams`, and custom code as needed.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
- **BREAKING**: Increase supported Node.js version to 6.13.0 for URL support.
|
|
46
|
+
- **BREAKING**: Renamed `master` branch to `main`.
|
|
47
|
+
- **BREAKING**: Release process updated to use tooling that prefixes versions
|
|
48
|
+
with `v`. Other tools, scripts, or scanners may need to adapt.
|
|
49
|
+
- **BREAKING**: Remove docs related to Bower and
|
|
50
|
+
[forge-dist](https://github.com/digitalbazaar/forge-dist). Install using
|
|
51
|
+
[another method](./README.md#installation).
|
|
52
|
+
|
|
53
|
+
### Added
|
|
54
|
+
- OIDs for `surname`, `title`, and `givenName`.
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
- **BREAKING**: OID 2.5.4.5 name fixed from `serialName` to `serialNumber`.
|
|
58
|
+
Depending on how applications used this id to name association it could cause
|
|
59
|
+
compatibility issues.
|
|
60
|
+
|
|
61
|
+
## 0.10.0 - 2020-09-01
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
- **BREAKING**: Node.js 4 no longer supported. The code *may* still work, and
|
|
65
|
+
non-invasive patches to keep it working will be considered. However, more
|
|
66
|
+
modern tools no longer support old Node.js versions making testing difficult.
|
|
67
|
+
|
|
68
|
+
### Removed
|
|
69
|
+
- **BREAKING**: Remove `util.getPath`, `util.setPath`, and `util.deletePath`.
|
|
70
|
+
`util.setPath` had a potential prototype pollution security issue when used
|
|
71
|
+
with unsafe inputs. These functions are not used by `forge` itself. They date
|
|
72
|
+
from an early time when `forge` was targeted at providing general helper
|
|
73
|
+
functions. The library direction changed to be more focused on cryptography.
|
|
74
|
+
Many other excellent libraries are more suitable for general utilities. If
|
|
75
|
+
you need a replacement for these functions, consider `get`, `set`, and `unset`
|
|
76
|
+
from [lodash](https://lodash.com/). But also consider the potential similar
|
|
77
|
+
security issues with those APIs.
|
|
78
|
+
|
|
79
|
+
## 0.9.2 - 2020-09-01
|
|
80
|
+
|
|
81
|
+
### Changed
|
|
82
|
+
- Added `util.setPath` security note to function docs and to README.
|
|
83
|
+
|
|
84
|
+
### Notes
|
|
85
|
+
- **SECURITY**: The `util.setPath` function has the potential to cause
|
|
86
|
+
prototype pollution if used with unsafe input.
|
|
87
|
+
- This function is **not** used internally by `forge`.
|
|
88
|
+
- The rest of the library is unaffected by this issue.
|
|
89
|
+
- **Do not** use unsafe input with this function.
|
|
90
|
+
- Usage with known input should function as expected. (Including input
|
|
91
|
+
intentionally using potentially problematic keys.)
|
|
92
|
+
- No code changes will be made to address this issue in 0.9.x. The current
|
|
93
|
+
behavior *could* be considered a feature rather than a security issue.
|
|
94
|
+
0.10.0 will be released that removes `util.getPath` and `util.setPath`.
|
|
95
|
+
Consider `get` and `set` from [lodash](https://lodash.com/) if you need
|
|
96
|
+
replacements. But also consider the potential similar security issues with
|
|
97
|
+
those APIs.
|
|
98
|
+
- https://snyk.io/vuln/SNYK-JS-NODEFORGE-598677
|
|
99
|
+
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7720
|
|
100
|
+
|
|
4
101
|
## 0.9.1 - 2019-09-26
|
|
5
102
|
|
|
6
103
|
### Fixed
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://nodei.co/npm/node-forge/)
|
|
4
4
|
|
|
5
|
-
[](https://github.com/digitalbazaar/forge/actions?query=workflow%3A%22Main+Checks%22)
|
|
6
6
|
|
|
7
7
|
A native implementation of [TLS][] (and various other cryptographic tools) in
|
|
8
8
|
[JavaScript][].
|
|
@@ -80,7 +80,6 @@ Documentation
|
|
|
80
80
|
* [Tasks](#task)
|
|
81
81
|
* [Utilities](#util)
|
|
82
82
|
* [Logging](#log)
|
|
83
|
-
* [Debugging](#debug)
|
|
84
83
|
* [Flash Networking Support](#flash)
|
|
85
84
|
|
|
86
85
|
### Other
|
|
@@ -106,7 +105,7 @@ not be regularly updated.
|
|
|
106
105
|
|
|
107
106
|
If you want to use forge with [Node.js][], it is available through `npm`:
|
|
108
107
|
|
|
109
|
-
https://npmjs.
|
|
108
|
+
https://www.npmjs.com/package/node-forge
|
|
110
109
|
|
|
111
110
|
Installation:
|
|
112
111
|
|
|
@@ -121,24 +120,12 @@ var forge = require('node-forge');
|
|
|
121
120
|
The npm package includes pre-built `forge.min.js`, `forge.all.min.js`, and
|
|
122
121
|
`prime.worker.min.js` using the [UMD][] format.
|
|
123
122
|
|
|
124
|
-
### Bundle / Bower
|
|
125
|
-
|
|
126
|
-
Each release is published in a separate repository as pre-built and minimized
|
|
127
|
-
basic forge bundles using the [UMD][] format.
|
|
128
|
-
|
|
129
|
-
https://github.com/digitalbazaar/forge-dist
|
|
130
|
-
|
|
131
|
-
This bundle can be used in many environments. In particular it can be installed
|
|
132
|
-
with [Bower][]:
|
|
133
|
-
|
|
134
|
-
bower install forge
|
|
135
|
-
|
|
136
123
|
### jsDelivr CDN
|
|
137
124
|
|
|
138
125
|
To use it via [jsDelivr](https://www.jsdelivr.com/package/npm/node-forge) include this in your html:
|
|
139
126
|
|
|
140
127
|
```html
|
|
141
|
-
<script src="https://cdn.jsdelivr.net/npm/node-forge@0.
|
|
128
|
+
<script src="https://cdn.jsdelivr.net/npm/node-forge@1.0.0/dist/forge.min.js"></script>
|
|
142
129
|
```
|
|
143
130
|
|
|
144
131
|
### unpkg CDN
|
|
@@ -146,7 +133,7 @@ To use it via [jsDelivr](https://www.jsdelivr.com/package/npm/node-forge) includ
|
|
|
146
133
|
To use it via [unpkg](https://unpkg.com/#/) include this in your html:
|
|
147
134
|
|
|
148
135
|
```html
|
|
149
|
-
<script src="https://unpkg.com/node-forge@0.
|
|
136
|
+
<script src="https://unpkg.com/node-forge@1.0.0/dist/forge.min.js"></script>
|
|
150
137
|
```
|
|
151
138
|
|
|
152
139
|
### Development Requirements
|
|
@@ -1452,7 +1439,7 @@ __Examples__
|
|
|
1452
1439
|
|
|
1453
1440
|
```js
|
|
1454
1441
|
// generate a key pair
|
|
1455
|
-
var keys = forge.pki.rsa.generateKeyPair(
|
|
1442
|
+
var keys = forge.pki.rsa.generateKeyPair(2048);
|
|
1456
1443
|
|
|
1457
1444
|
// create a certification request (CSR)
|
|
1458
1445
|
var csr = forge.pki.createCertificationRequest();
|
|
@@ -1969,10 +1956,6 @@ var nodeBuffer = Buffer.from(forgeBuffer.getBytes(), 'binary');
|
|
|
1969
1956
|
// make sure you specify the encoding as 'binary'
|
|
1970
1957
|
var nodeBuffer = Buffer.from('CAFE', 'hex');
|
|
1971
1958
|
var forgeBuffer = forge.util.createBuffer(nodeBuffer.toString('binary'));
|
|
1972
|
-
|
|
1973
|
-
// parse a URL
|
|
1974
|
-
var parsed = forge.util.parseUrl('http://example.com/foo?bar=baz');
|
|
1975
|
-
// parsed.scheme, parsed.host, parsed.port, parsed.path, parsed.fullHost
|
|
1976
1959
|
```
|
|
1977
1960
|
|
|
1978
1961
|
<a name="log" />
|
|
@@ -1988,19 +1971,6 @@ __Examples__
|
|
|
1988
1971
|
// TODO
|
|
1989
1972
|
```
|
|
1990
1973
|
|
|
1991
|
-
<a name="debug" />
|
|
1992
|
-
|
|
1993
|
-
### Debugging
|
|
1994
|
-
|
|
1995
|
-
Provides storage of debugging information normally inaccessible in
|
|
1996
|
-
closures for viewing/investigation.
|
|
1997
|
-
|
|
1998
|
-
__Examples__
|
|
1999
|
-
|
|
2000
|
-
```js
|
|
2001
|
-
// TODO
|
|
2002
|
-
```
|
|
2003
|
-
|
|
2004
1974
|
<a name="flash" />
|
|
2005
1975
|
|
|
2006
1976
|
### Flash Networking Support
|
|
@@ -2021,8 +1991,8 @@ When using this code please keep the following in mind:
|
|
|
2021
1991
|
runtime characteristics, runtime optimization, code optimization, code
|
|
2022
1992
|
minimization, code obfuscation, bundling tools, possible bugs, the Forge code
|
|
2023
1993
|
itself, and so on.
|
|
2024
|
-
- If using pre-built bundles from [
|
|
2025
|
-
ran the tools to create those files.
|
|
1994
|
+
- If using pre-built bundles from [NPM][], another CDN, or similar, be aware
|
|
1995
|
+
someone else ran the tools to create those files.
|
|
2026
1996
|
- Use a secure transport channel such as [TLS][] to load scripts and consider
|
|
2027
1997
|
using additional security mechanisms such as [Subresource Integrity][] script
|
|
2028
1998
|
attributes.
|
|
@@ -2048,7 +2018,8 @@ Contact
|
|
|
2048
2018
|
* Code: https://github.com/digitalbazaar/forge
|
|
2049
2019
|
* Bugs: https://github.com/digitalbazaar/forge/issues
|
|
2050
2020
|
* Email: support@digitalbazaar.com
|
|
2051
|
-
* IRC: [#forgejs][] on [freenode][]
|
|
2021
|
+
* IRC: [#forgejs][] on [Libera.Chat][] (people may also be on [freenode][] for
|
|
2022
|
+
historical reasons).
|
|
2052
2023
|
|
|
2053
2024
|
Donations
|
|
2054
2025
|
---------
|
|
@@ -2063,7 +2034,6 @@ Financial support is welcome and helps contribute to futher development:
|
|
|
2063
2034
|
[3DES]: https://en.wikipedia.org/wiki/Triple_DES
|
|
2064
2035
|
[AES]: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
|
|
2065
2036
|
[ASN.1]: https://en.wikipedia.org/wiki/ASN.1
|
|
2066
|
-
[Bower]: https://bower.io/
|
|
2067
2037
|
[Browserify]: http://browserify.org/
|
|
2068
2038
|
[CBC]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
|
|
2069
2039
|
[CFB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
|
|
@@ -2076,7 +2046,9 @@ Financial support is welcome and helps contribute to futher development:
|
|
|
2076
2046
|
[HMAC]: https://en.wikipedia.org/wiki/HMAC
|
|
2077
2047
|
[JavaScript]: https://en.wikipedia.org/wiki/JavaScript
|
|
2078
2048
|
[Karma]: https://karma-runner.github.io/
|
|
2049
|
+
[Libera.Chat]: https://libera.chat/
|
|
2079
2050
|
[MD5]: https://en.wikipedia.org/wiki/MD5
|
|
2051
|
+
[NPM]: https://www.npmjs.com/
|
|
2080
2052
|
[Node.js]: https://nodejs.org/
|
|
2081
2053
|
[OFB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
|
|
2082
2054
|
[PKCS#10]: https://en.wikipedia.org/wiki/Certificate_signing_request
|