From beda018b31ab52962f253682ad126c2b5bf0b359 Mon Sep 17 00:00:00 2001 From: Gus Narea Date: Wed, 3 Aug 2022 16:57:21 +0100 Subject: [PATCH] fix(RAMF): Fix error message thrown by `validate()` --- src/lib/messages/RAMFMessage.spec.ts | 2 +- src/lib/messages/RAMFMessage.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/messages/RAMFMessage.spec.ts b/src/lib/messages/RAMFMessage.spec.ts index 3c501524f..c862ae981 100644 --- a/src/lib/messages/RAMFMessage.spec.ts +++ b/src/lib/messages/RAMFMessage.spec.ts @@ -218,7 +218,7 @@ describe('RAMFMessage', () => { ); await expect(message.validate([rootCertificate])).rejects.toEqual( - new InvalidMessageError(`Sender is not authorized to reach ${message.recipient}`), + new InvalidMessageError(`Sender is not authorized to reach ${message.recipient.id}`), ); }); }); diff --git a/src/lib/messages/RAMFMessage.ts b/src/lib/messages/RAMFMessage.ts index 4e6c4ff8e..b6cc8e2ec 100644 --- a/src/lib/messages/RAMFMessage.ts +++ b/src/lib/messages/RAMFMessage.ts @@ -166,7 +166,7 @@ export default abstract class RAMFMessage { const recipientCertificate = certificationPath[1]; const recipientId = await recipientCertificate.calculateSubjectId(); if (recipientId !== this.recipient.id) { - throw new InvalidMessageError(`Sender is not authorized to reach ${this.recipient}`); + throw new InvalidMessageError(`Sender is not authorized to reach ${this.recipient.id}`); } return certificationPath;