Skip to content

Commit

Permalink
Fixed a small bug when checking object properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Christos Patsonakis committed Apr 13, 2021
1 parent ee8b7d9 commit ba7fca0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function getDecodedECDHPublicKeyFromEncEnvelope(encEnvelope) {
function checkEncryptedEnvelopeMandatoryProperties(encryptedEnvelope) {
const mandatoryProperties = ["to_ecdh", "r", "ct", "iv", "tag"];
mandatoryProperties.forEach((property) => {
if (typeof encryptedEnvelope[property] === undefined) {
if (typeof encryptedEnvelope[property] === 'undefined') {
throw new Error("Mandatory property " + property + " is missing from input encrypted envelope");
}
})
Expand Down
2 changes: 1 addition & 1 deletion crypto/cipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function symmetricEncrypt(key, plaintext, iv) {

function symmetricDecrypt(key, ciphertext, iv) {
if (key.length != config.symmetricCipherKeySize) {
throw new Error('Invalid length of input symmetric dencryption key')
throw new Error('Invalid length of input symmetric decryption key')
}
if (iv === undefined) {
iv = null
Expand Down
2 changes: 1 addition & 1 deletion ecies-doa-kmac/decrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const common = require('../common')
function checkWrappedMessageMandatoryProperties(wrappedMessage) {
const mandatoryProperties = ["from_ecdh", "msg"];
mandatoryProperties.forEach((property) => {
if (typeof wrappedMessage[property] === undefined) {
if (typeof wrappedMessage[property] === 'undefined') {
throw new Error("Mandatory property " + property + " is missing from wrapped message");
}
})
Expand Down

0 comments on commit ba7fca0

Please sign in to comment.