Skip to content

Commit

Permalink
fix(RAMF): Fix error message thrown by validate()
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Aug 3, 2022
1 parent 3049bbb commit beda018
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/messages/RAMFMessage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`),
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/lib/messages/RAMFMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default abstract class RAMFMessage<Payload extends PayloadPlaintext> {
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;
Expand Down

0 comments on commit beda018

Please sign in to comment.