From 51ff738c3400f2364431166312f30a5f93dbbb7b Mon Sep 17 00:00:00 2001 From: Christoph Diehl <1614333+posidron@users.noreply.github.com> Date: Wed, 31 Jan 2018 12:21:29 +0100 Subject: [PATCH] Return an object instead of null for empty JWK presets --- lib/make/crypto.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/make/crypto.js b/lib/make/crypto.js index 35b1ea3..be645c4 100644 --- a/lib/make/crypto.js +++ b/lib/make/crypto.js @@ -194,7 +194,7 @@ make.crypto = { return this.alg() }, presets: { - raw: null, + raw: {}, jwk: [ { kty: 'RSA', @@ -256,7 +256,7 @@ make.crypto = { return this.alg() }, presets: { - raw: null, + raw: {}, jwk: [ { kty: 'RSA', @@ -329,7 +329,7 @@ make.crypto = { return this.alg() }, presets: { - raw: null, + raw: {}, jkw: [ { kty: 'RSA', @@ -390,7 +390,7 @@ make.crypto = { return this.alg() }, presets: { - raw: null, + raw: {}, jwk: [ { kty: 'EC', @@ -446,7 +446,7 @@ make.crypto = { ) }, presets: { - raw: null, + raw: {}, jwk: [ { kty: 'EC', @@ -519,8 +519,8 @@ make.crypto = { ext: true } ], - spki: null, - pkcs8: null + spki: {}, + pkcs8: {} } }, 'AES-CBC': { @@ -581,8 +581,8 @@ make.crypto = { ext: true } ], - spki: null, - pkcs8: null + spki: {}, + pkcs8: {} } }, 'AES-GCM': { @@ -646,8 +646,8 @@ make.crypto = { ext: true } ], - spki: null, - pkcs8: null + spki: {}, + pkcs8: {} } }, 'AES-KW': { @@ -694,8 +694,8 @@ make.crypto = { ext: true } ], - spki: null, - pkcs8: null + spki: {}, + pkcs8: {} } }, 'HMAC': { @@ -738,8 +738,8 @@ make.crypto = { alg: 'HS256', ext: true }, - spki: null, - pkcs8: null + spki: {}, + pkcs8: {} } }, 'HKDF': { @@ -813,9 +813,9 @@ make.crypto = { }, presets: { raw: crypto.getRandomValues(new Uint8Array(16)), - jwk: null, - spki: null, - pkcs8: null + jwk: {}, + spki: {}, + pkcs8: {} } }, 'DH': { @@ -853,10 +853,10 @@ make.crypto = { ) }, presets: { - raw: null, - jwk: null, - spki: null, - pkcs8: null + raw: {}, + jwk: {}, + spki: {}, + pkcs8: {} } } },