diff options
author | markj <markj@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f> | 2020-10-30 17:05:36 +0000 |
---|---|---|
committer | markj <markj@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f> | 2020-10-30 17:05:36 +0000 |
commit | 02a157df8f6f60d94587da20825aa9aa13711cb2 (patch) | |
tree | d75cfd1aa6b382996b739241bc2568f7801c9555 | |
parent | 26aca9c216db98c30ebff05cb31905f125ee76c6 (diff) | |
download | freebsd-02a157df8f6f60d94587da20825aa9aa13711cb2.tar.gz freebsd-02a157df8f6f60d94587da20825aa9aa13711cb2.tar.bz2 |
opencrypto: Annotate hmac_init_(i|o)pad() to make auth_hash const
This makes them friendlier to drivers that try to use const pointers
whenever possible in their internal structures.
Reviewed by: jhb
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D26901
git-svn-id: http://svn.freebsd.org/base/head@367174 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
-rw-r--r-- | sys/opencrypto/crypto.c | 8 | ||||
-rw-r--r-- | sys/opencrypto/cryptodev.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index b7a03ba7355..f698616e72b 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -411,8 +411,8 @@ crypto_terminate(struct proc **pp, void *q) } static void -hmac_init_pad(struct auth_hash *axf, const char *key, int klen, void *auth_ctx, - uint8_t padval) +hmac_init_pad(const struct auth_hash *axf, const char *key, int klen, + void *auth_ctx, uint8_t padval) { uint8_t hmac_key[HMAC_MAX_BLOCK_LEN]; u_int i; @@ -442,7 +442,7 @@ hmac_init_pad(struct auth_hash *axf, const char *key, int klen, void *auth_ctx, } void -hmac_init_ipad(struct auth_hash *axf, const char *key, int klen, +hmac_init_ipad(const struct auth_hash *axf, const char *key, int klen, void *auth_ctx) { @@ -450,7 +450,7 @@ hmac_init_ipad(struct auth_hash *axf, const char *key, int klen, } void -hmac_init_opad(struct auth_hash *axf, const char *key, int klen, +hmac_init_opad(const struct auth_hash *axf, const char *key, int klen, void *auth_ctx) { diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index de85fff925a..999aa03b28c 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -683,9 +683,9 @@ SYSCTL_DECL(_kern_crypto); /* Helper routines for drivers to initialize auth contexts for HMAC. */ struct auth_hash; -void hmac_init_ipad(struct auth_hash *axf, const char *key, int klen, +void hmac_init_ipad(const struct auth_hash *axf, const char *key, int klen, void *auth_ctx); -void hmac_init_opad(struct auth_hash *axf, const char *key, int klen, +void hmac_init_opad(const struct auth_hash *axf, const char *key, int klen, void *auth_ctx); /* |