aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/eli
diff options
context:
space:
mode:
authorMariusz Zaborski <oshogbo@FreeBSD.org>2019-06-05 22:46:18 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2019-06-05 22:46:18 +0000
commit1808673cc4d4d012f74fd57e51dbb2c414773a87 (patch)
tree343323f9c6dce9aa0c1644928c11282d0c7e0770 /sys/geom/eli
parentb4d2c3385ca87afb38d3e18c9abfb325d9416467 (diff)
Notes
Diffstat (limited to 'sys/geom/eli')
-rw-r--r--sys/geom/eli/g_eli.h4
-rw-r--r--sys/geom/eli/g_eli_hmac.c4
-rw-r--r--sys/geom/eli/pkcs5v2.c4
-rw-r--r--sys/geom/eli/pkcs5v2.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/sys/geom/eli/g_eli.h b/sys/geom/eli/g_eli.h
index 36ab0b87649e5..6c8c22a2a97de 100644
--- a/sys/geom/eli/g_eli.h
+++ b/sys/geom/eli/g_eli.h
@@ -721,12 +721,12 @@ struct hmac_ctx {
SHA512_CTX outerctx;
};
-void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uint8_t *hkey,
+void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const char hkey[],
size_t hkeylen);
void g_eli_crypto_hmac_update(struct hmac_ctx *ctx, const uint8_t *data,
size_t datasize);
void g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t *md, size_t mdsize);
-void g_eli_crypto_hmac(const uint8_t *hkey, size_t hkeysize,
+void g_eli_crypto_hmac(const char hkey[], size_t hkeysize,
const uint8_t *data, size_t datasize, uint8_t *md, size_t mdsize);
void g_eli_key_fill(struct g_eli_softc *sc, struct g_eli_key *key,
diff --git a/sys/geom/eli/g_eli_hmac.c b/sys/geom/eli/g_eli_hmac.c
index dd3140d15b29c..7d5a838201034 100644
--- a/sys/geom/eli/g_eli_hmac.c
+++ b/sys/geom/eli/g_eli_hmac.c
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
#include <geom/eli/g_eli.h>
void
-g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uint8_t *hkey,
+g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const char hkey[],
size_t hkeylen)
{
u_char k_ipad[128], k_opad[128], key[128];
@@ -110,7 +110,7 @@ g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t *md, size_t mdsize)
}
void
-g_eli_crypto_hmac(const uint8_t *hkey, size_t hkeysize, const uint8_t *data,
+g_eli_crypto_hmac(const char hkey[], size_t hkeysize, const uint8_t *data,
size_t datasize, uint8_t *md, size_t mdsize)
{
struct hmac_ctx ctx;
diff --git a/sys/geom/eli/pkcs5v2.c b/sys/geom/eli/pkcs5v2.c
index 0006fe0de1f14..defe91b455001 100644
--- a/sys/geom/eli/pkcs5v2.c
+++ b/sys/geom/eli/pkcs5v2.c
@@ -52,7 +52,7 @@ xor(uint8_t *dst, const uint8_t *src, size_t size)
void
pkcs5v2_genkey(uint8_t *key, unsigned keylen, const uint8_t *salt,
- size_t saltsize, const char *passphrase, u_int iterations)
+ size_t saltsize, const char passphrase[], u_int iterations)
{
uint8_t md[SHA512_MDLEN], saltcount[saltsize + sizeof(uint32_t)];
uint8_t *counter, *keyp;
@@ -97,7 +97,7 @@ static int
pkcs5v2_probe(int iterations)
{
uint8_t key[G_ELI_USERKEYLEN], salt[G_ELI_SALTLEN];
- uint8_t passphrase[] = "passphrase";
+ const char passphrase[] = "passphrase";
struct rusage start, end;
int usecs;
diff --git a/sys/geom/eli/pkcs5v2.h b/sys/geom/eli/pkcs5v2.h
index da812e98c9615..d271c32145368 100644
--- a/sys/geom/eli/pkcs5v2.h
+++ b/sys/geom/eli/pkcs5v2.h
@@ -31,7 +31,7 @@
#ifndef _PKCS5V2_H_
#define _PKCS5V2_H_
void pkcs5v2_genkey(uint8_t *key, unsigned keylen, const uint8_t *salt,
- size_t saltsize, const char *passphrase, u_int iterations);
+ size_t saltsize, const char passphrase[], u_int iterations);
#ifndef _KERNEL
int pkcs5v2_calculate(int usecs);
#endif