common: make hdr parameter const

cryptomsg_decrypt_header doesn't modify hdr, so we should make it const.
This commit is contained in:
Matt Morehouse 2023-06-07 11:55:19 -05:00 committed by Rusty Russell
parent 8d9f033954
commit fca50eaebc
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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 */