From 8268d45f028ba9ad053d95504add76a290e4e3a7 Mon Sep 17 00:00:00 2001 From: Simon Umbricht Date: Fri, 27 Jun 2025 09:39:53 +0200 Subject: [PATCH 1/2] Fix errors due to IV not being used for key decryption --- lib/keymanagers/defaultKeyEncryptor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/keymanagers/defaultKeyEncryptor.js b/lib/keymanagers/defaultKeyEncryptor.js index f80d2d3..94d9975 100644 --- a/lib/keymanagers/defaultKeyEncryptor.js +++ b/lib/keymanagers/defaultKeyEncryptor.js @@ -5,5 +5,5 @@ const { encrypt, decrypt } = require('../crypto/encryptDecrypt'); module.exports = ({ passphrase, iv, algorithm = 'aes-256-cbc' }) => ({ encrypt: data => encrypt(data, algorithm, passphrase, iv), - decrypt: data => decrypt(data, algorithm, passphrase), + decrypt: data => decrypt(data, algorithm, passphrase, iv), }); From 82b0296eabef04f84bea3a9398a6e17fe082218e Mon Sep 17 00:00:00 2001 From: Simon Umbricht Date: Thu, 14 Aug 2025 10:10:31 +0200 Subject: [PATCH 2/2] Add businessCodes and technicalCodes to upload operation output --- lib/Client.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/Client.js b/lib/Client.js index f345e38..5ad6ff5 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -199,7 +199,33 @@ module.exports = class Client { this.tracesStorage.connect().ofType('TRANSFER.ORDER.UPLOAD'); res = await this.ebicsRequest(order); - return [transactionId, orderId]; + const returnedTechnicalCode = res.technicalCode(); + const returnedBusinessCode = res.businessCode(); + + return { + transactionId, + orderId, + + technicalCode: returnedTechnicalCode, + technicalCodeSymbol: res.technicalSymbol(), + technicalCodeShortText: res.technicalShortText( + returnedTechnicalCode, + ), + technicalCodeMeaning: res.technicalMeaning(returnedTechnicalCode), + + businessCode: returnedBusinessCode, + businessCodeSymbol: res.businessSymbol(returnedBusinessCode), + businessCodeShortText: res.businessShortText(returnedBusinessCode), + businessCodeMeaning: res.businessMeaning(returnedBusinessCode), + + // for backwards compatibility with the earlier return value [transactionId, orderId]: + '0': transactionId, + '1': orderId, + [Symbol.iterator]: function*() { + yield transactionId + yield orderId + }, + }; } ebicsRequest(order) {