From fca50eaebcacbbf0bb252718606d24d937a89791 Mon Sep 17 00:00:00 2001 From: Matt Morehouse Date: Wed, 7 Jun 2023 11:55:19 -0500 Subject: [PATCH] common: make hdr parameter const cryptomsg_decrypt_header doesn't modify hdr, so we should make it const. --- common/cryptomsg.c | 3 ++- common/cryptomsg.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/cryptomsg.c b/common/cryptomsg.c index 8c4bd93c2..1b50a1f18 100644 --- a/common/cryptomsg.c +++ b/common/cryptomsg.c @@ -118,7 +118,8 @@ u8 *cryptomsg_decrypt_body(const tal_t *ctx, return decrypted; } -bool cryptomsg_decrypt_header(struct crypto_state *cs, u8 hdr[18], u16 *lenp) +bool cryptomsg_decrypt_header(struct crypto_state *cs, const u8 hdr[18], + u16 *lenp) { unsigned char npub[crypto_aead_chacha20poly1305_ietf_NPUBBYTES]; unsigned long long mlen; diff --git a/common/cryptomsg.h b/common/cryptomsg.h index 19c6d3e90..3da33879c 100644 --- a/common/cryptomsg.h +++ b/common/cryptomsg.h @@ -25,7 +25,8 @@ u8 *cryptomsg_encrypt_msg(const tal_t *ctx, struct crypto_state *cs, const u8 *msg); -bool cryptomsg_decrypt_header(struct crypto_state *cs, u8 hdr[18], u16 *lenp); +bool cryptomsg_decrypt_header(struct crypto_state *cs, const u8 hdr[18], + u16 *lenp); u8 *cryptomsg_decrypt_body(const tal_t *ctx, struct crypto_state *cs, const u8 *in); #endif /* LIGHTNING_COMMON_CRYPTOMSG_H */