node-forge 0.9.0 → 1.0.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 CHANGED
@@ -1,6 +1,100 @@
1
1
  Forge ChangeLog
2
2
  ===============
3
3
 
4
+ ## 1.0.0 - 2022-01-04
5
+
6
+ ### Notes
7
+ - **1.0.0**!
8
+ - This project is over a decade old! Time for a 1.0.0 release.
9
+ - The URL related changes may expose bugs in some of the networking related
10
+ code (unrelated to the much wider used cryptography code). The automated and
11
+ manual test coverage for this code is weak at best. Issues or patches to
12
+ update the code or tests would be appreciated.
13
+
14
+ ### Removed
15
+ - **SECURITY**, **BREAKING**: Remove `forge.debug` API. The API has the
16
+ potential for prototype pollution. This API was only briefly used by the
17
+ maintainers for internal project debug purposes and was never intended to be
18
+ used with untrusted user inputs. This API was not documented or advertised
19
+ and is being removed rather than fixed.
20
+ - **SECURITY**, **BREAKING**: Remove `forge.util.parseUrl()` (and
21
+ `forge.http.parseUrl` alias) and use the [WHATWG URL
22
+ Standard](https://url.spec.whatwg.org/). `URL` is supported by modern browers
23
+ and modern Node.js. This change is needed to address URL parsing security
24
+ issues. If `forge.util.parseUrl()` is used directly or through `forge.xhr` or
25
+ `forge.http` APIs, and support is needed for environments without `URL`
26
+ support, then a polyfill must be used.
27
+ - **BREAKING**: Remove `forge.task` API. This API was never used, documented,
28
+ or advertised by the maintainers. If anyone was using this API and wishes to
29
+ continue development it in other project, please let the maintainers know.
30
+ Due to use in the test suite, a modified version is located in
31
+ `tests/support/`.
32
+ - **BREAKING**: Remove `forge.util.makeLink`, `forge.util.makeRequest`,
33
+ `forge.util.parseFragment`, `forge.util.getQueryVariables`. Replace with
34
+ `URL`, `URLSearchParams`, and custom code as needed.
35
+
36
+ ### Changed
37
+ - **BREAKING**: Increase supported Node.js version to 6.13.0 for URL support.
38
+ - **BREAKING**: Renamed `master` branch to `main`.
39
+ - **BREAKING**: Release process updated to use tooling that prefixes versions
40
+ with `v`. Other tools, scripts, or scanners may need to adapt.
41
+ - **BREAKING**: Remove docs related to Bower and
42
+ [forge-dist](https://github.com/digitalbazaar/forge-dist). Install using
43
+ [another method](./README.md#installation).
44
+
45
+ ### Added
46
+ - OIDs for `surname`, `title`, and `givenName`.
47
+
48
+ ### Fixed
49
+ - **BREAKING**: OID 2.5.4.5 name fixed from `serialName` to `serialNumber`.
50
+ Depending on how applications used this id to name association it could cause
51
+ compatibility issues.
52
+
53
+ ## 0.10.0 - 2020-09-01
54
+
55
+ ### Changed
56
+ - **BREAKING**: Node.js 4 no longer supported. The code *may* still work, and
57
+ non-invasive patches to keep it working will be considered. However, more
58
+ modern tools no longer support old Node.js versions making testing difficult.
59
+
60
+ ### Removed
61
+ - **BREAKING**: Remove `util.getPath`, `util.setPath`, and `util.deletePath`.
62
+ `util.setPath` had a potential prototype pollution security issue when used
63
+ with unsafe inputs. These functions are not used by `forge` itself. They date
64
+ from an early time when `forge` was targeted at providing general helper
65
+ functions. The library direction changed to be more focused on cryptography.
66
+ Many other excellent libraries are more suitable for general utilities. If
67
+ you need a replacement for these functions, consider `get`, `set`, and `unset`
68
+ from [lodash](https://lodash.com/). But also consider the potential similar
69
+ security issues with those APIs.
70
+
71
+ ## 0.9.2 - 2020-09-01
72
+
73
+ ### Changed
74
+ - Added `util.setPath` security note to function docs and to README.
75
+
76
+ ### Notes
77
+ - **SECURITY**: The `util.setPath` function has the potential to cause
78
+ prototype pollution if used with unsafe input.
79
+ - This function is **not** used internally by `forge`.
80
+ - The rest of the library is unaffected by this issue.
81
+ - **Do not** use unsafe input with this function.
82
+ - Usage with known input should function as expected. (Including input
83
+ intentionally using potentially problematic keys.)
84
+ - No code changes will be made to address this issue in 0.9.x. The current
85
+ behavior *could* be considered a feature rather than a security issue.
86
+ 0.10.0 will be released that removes `util.getPath` and `util.setPath`.
87
+ Consider `get` and `set` from [lodash](https://lodash.com/) if you need
88
+ replacements. But also consider the potential similar security issues with
89
+ those APIs.
90
+ - https://snyk.io/vuln/SNYK-JS-NODEFORGE-598677
91
+ - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7720
92
+
93
+ ## 0.9.1 - 2019-09-26
94
+
95
+ ### Fixed
96
+ - Ensure DES-CBC given IV is long enough for block size.
97
+
4
98
  ## 0.9.0 - 2019-09-04
5
99
 
6
100
  ### Added
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm package](https://nodei.co/npm/node-forge.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/node-forge/)
4
4
 
5
- [![Build status](https://img.shields.io/travis/digitalbazaar/forge.svg?branch=master)](https://travis-ci.org/digitalbazaar/forge)
5
+ [![Build Status](https://github.com/digitalbazaar/forge/workflows/Main%20Checks/badge.svg)](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.org/package/node-forge
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.7.0/dist/forge.min.js"></script>
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.7.0/dist/forge.min.js"></script>
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(1024);
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 [Bower][] or similar be aware someone else
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