Date: Fri, 30 Oct 2020 17:05:37 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367174 - head/sys/opencrypto Message-ID: <202010301705.09UH5bRH071618@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Fri Oct 30 17:05:36 2020 New Revision: 367174 URL: https://svnweb.freebsd.org/changeset/base/367174 Log: 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 Modified: head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Fri Oct 30 15:43:52 2020 (r367173) +++ head/sys/opencrypto/crypto.c Fri Oct 30 17:05:36 2020 (r367174) @@ -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, } 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, } 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) { Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Fri Oct 30 15:43:52 2020 (r367173) +++ head/sys/opencrypto/cryptodev.h Fri Oct 30 17:05:36 2020 (r367174) @@ -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); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010301705.09UH5bRH071618>