Firebase Update

This commit is contained in:
Lukas Nowy
2018-12-22 23:30:39 +01:00
parent befb44764d
commit acffe619b3
11523 changed files with 1614327 additions and 930246 deletions

View File

@ -1,20 +1,6 @@
Forge ChangeLog
===============
## 0.7.6 - 2018-08-14
### Added
- Test on Node.js 10.x.
- Support for PKCS#7 detached signatures.
### Changed
- Improve webpack/browser detection.
## 0.7.5 - 2018-03-30
### Fixed
- Remove use of `const`.
## 0.7.4 - 2018-03-07
### Fixed

View File

@ -1378,10 +1378,6 @@ p7.addSigner({
p7.sign();
var pem = forge.pkcs7.messageToPem(p7);
// PKCS#7 Sign in detached mode.
// Includes the signature and certificate without the signed data.
p7.sign({detached: true});
```
<a name="pkcs8" />

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -215,7 +215,7 @@ function sha512(msg, msgLen) {
var md = forge.md.sha512.create();
var buffer = new ByteBuffer(msg);
md.update(buffer.getBytes(msgLen), 'binary');
var hash = md.digest().getBytes();
const hash = md.digest().getBytes();
if(typeof Buffer !== 'undefined') {
return new Buffer(hash, 'binary');
}

View File

@ -328,11 +328,8 @@ p7.createSignedData = function() {
/**
* Signs the content.
* @param options Options to apply when signing:
* [detached] boolean. If signing should be done in detached mode. Defaults to false.
*/
sign: function(options) {
options = options || {};
sign: function() {
// auto-generate content info
if(typeof msg.content !== 'object' || msg.contentInfo === null) {
// use Data ContentInfo
@ -352,16 +349,12 @@ p7.createSignedData = function() {
content = forge.util.encodeUtf8(msg.content);
}
if (options.detached) {
msg.detachedContent = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, content);
} else {
msg.contentInfo.value.push(
// [0] EXPLICIT content
asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
content)
]));
}
msg.contentInfo.value.push(
// [0] EXPLICIT content
asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
content)
]));
}
}
@ -444,22 +437,10 @@ p7.createSignedData = function() {
}
function addSignerInfos(mds) {
var content;
if (msg.detachedContent) {
// Signature has been made in detached mode.
content = msg.detachedContent;
} else {
// Note: ContentInfo is a SEQUENCE with 2 values, second value is
// the content field and is optional for a ContentInfo but required here
// since signers are present
// get ContentInfo content
content = msg.contentInfo.value[1];
// skip [0] EXPLICIT content wrapper
content = content.value[0];
}
if(!content) {
// Note: ContentInfo is a SEQUENCE with 2 values, second value is
// the content field and is optional for a ContentInfo but required here
// since signers are present
if(msg.contentInfo.value.length < 2) {
throw new Error(
'Could not sign PKCS#7 message; there is no content to sign.');
}
@ -467,6 +448,11 @@ p7.createSignedData = function() {
// get ContentInfo content type
var contentType = asn1.derToOid(msg.contentInfo.value[0].value);
// get ContentInfo content
var content = msg.contentInfo.value[1];
// skip [0] EXPLICIT content wrapper
content = content.value[0];
// serialize content
var bytes = asn1.toDer(content);

View File

@ -13,10 +13,8 @@ var util = module.exports = forge.util = forge.util || {};
// define setImmediate and nextTick
(function() {
// use native nextTick (unless we're in webpack)
// webpack (or better node-libs-browser polyfill) sets process.browser.
// this way we can detect webpack properly
if(typeof process !== 'undefined' && process.nextTick && !process.browser) {
// use native nextTick
if(typeof process !== 'undefined' && process.nextTick) {
util.nextTick = process.nextTick;
if(typeof setImmediate === 'function') {
util.setImmediate = setImmediate;

View File

@ -1,27 +1,27 @@
{
"_from": "node-forge@^0.7.4",
"_id": "node-forge@0.7.6",
"_from": "node-forge@0.7.4",
"_id": "node-forge@0.7.4",
"_inBundle": false,
"_integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==",
"_integrity": "sha512-8Df0906+tq/omxuCZD6PqhPaQDYuyJ1d+VITgxoIA8zvQd1ru+nMJcDChHH324MWitIgbVkAkQoGEEVJNpn/PA==",
"_location": "/node-forge",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "node-forge@^0.7.4",
"raw": "node-forge@0.7.4",
"name": "node-forge",
"escapedName": "node-forge",
"rawSpec": "^0.7.4",
"rawSpec": "0.7.4",
"saveSpec": null,
"fetchSpec": "^0.7.4"
"fetchSpec": "0.7.4"
},
"_requiredBy": [
"/google-p12-pem"
"/firebase-admin"
],
"_resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz",
"_shasum": "fdf3b418aee1f94f0ef642cd63486c77ca9724ac",
"_spec": "node-forge@^0.7.4",
"_where": "C:\\Users\\Georg\\GitHub\\SmartShopper\\express-server\\node_modules\\google-p12-pem",
"_resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.4.tgz",
"_shasum": "8e6e9f563a1e32213aa7508cded22aa791dbf986",
"_spec": "node-forge@0.7.4",
"_where": "D:\\Desktop\\Git\\Firebase\\SmartShopperFirebase\\node_modules\\firebase-admin",
"author": {
"name": "Digital Bazaar, Inc.",
"email": "support@digitalbazaar.com",
@ -156,5 +156,5 @@
"test-server-webid": "node tests/websockets/server-webid.js",
"test-server-ws": "node tests/websockets/server-ws.js"
},
"version": "0.7.6"
"version": "0.7.4"
}