diff options
author | tim <> | 2019-11-21 20:02:20 +0000 |
---|---|---|
committer | tim <> | 2019-11-21 20:02:20 +0000 |
commit | 31d2d72847eddaad8498eaa0129b72d27f6f9aee (patch) | |
tree | 4e45012925b74590197b592d4cd7ae64e53a3a92 | |
parent | 0bdd867641c3ea3d68538d13cab621114d85493f (diff) | |
download | openbsd-31d2d72847eddaad8498eaa0129b72d27f6f9aee.tar.gz openbsd-31d2d72847eddaad8498eaa0129b72d27f6f9aee.tar.bz2 openbsd-31d2d72847eddaad8498eaa0129b72d27f6f9aee.zip |
A touch of style(9)
OK tb@ tedu@
-rw-r--r-- | src/lib/libcrypto/hkdf/hkdf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/hkdf/hkdf.c b/src/lib/libcrypto/hkdf/hkdf.c index 2327bdf625..b8be10bfcb 100644 --- a/src/lib/libcrypto/hkdf/hkdf.c +++ b/src/lib/libcrypto/hkdf/hkdf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: hkdf.c,v 1.3 2019/11/21 20:01:06 tim Exp $ */ | 1 | /* $OpenBSD: hkdf.c,v 1.4 2019/11/21 20:02:20 tim Exp $ */ |
2 | /* Copyright (c) 2014, Google Inc. | 2 | /* Copyright (c) 2014, Google Inc. |
3 | * | 3 | * |
4 | * Permission to use, copy, modify, and/or distribute this software for any | 4 | * Permission to use, copy, modify, and/or distribute this software for any |
@@ -32,10 +32,10 @@ HKDF(uint8_t *out_key, size_t out_len, const EVP_MD *digest, | |||
32 | size_t prk_len; | 32 | size_t prk_len; |
33 | 33 | ||
34 | if (!HKDF_extract(prk, &prk_len, digest, secret, secret_len, salt, | 34 | if (!HKDF_extract(prk, &prk_len, digest, secret, secret_len, salt, |
35 | salt_len)) | 35 | salt_len)) |
36 | return 0; | 36 | return 0; |
37 | if (!HKDF_expand(out_key, out_len, digest, prk, prk_len, info, | 37 | if (!HKDF_expand(out_key, out_len, digest, prk, prk_len, info, |
38 | info_len)) | 38 | info_len)) |
39 | return 0; | 39 | return 0; |
40 | 40 | ||
41 | return 1; | 41 | return 1; |
@@ -50,8 +50,8 @@ HKDF_extract(uint8_t *out_key, size_t *out_len, | |||
50 | unsigned int len; | 50 | unsigned int len; |
51 | 51 | ||
52 | /* | 52 | /* |
53 | * If salt is not given, HashLength zeros are used. However, HMAC does that | 53 | * If salt is not given, HashLength zeros are used. However, HMAC does |
54 | * internally already so we can ignore it. | 54 | * that internally already so we can ignore it. |
55 | */ | 55 | */ |
56 | if (HMAC(digest, salt, salt_len, secret, secret_len, out_key, &len) == | 56 | if (HMAC(digest, salt, salt_len, secret, secret_len, out_key, &len) == |
57 | NULL) { | 57 | NULL) { |
@@ -91,7 +91,7 @@ HKDF_expand(uint8_t *out_key, size_t out_len, | |||
91 | size_t todo; | 91 | size_t todo; |
92 | 92 | ||
93 | if (i != 0 && (!HMAC_Init_ex(&hmac, NULL, 0, NULL, NULL) || | 93 | if (i != 0 && (!HMAC_Init_ex(&hmac, NULL, 0, NULL, NULL) || |
94 | !HMAC_Update(&hmac, previous, digest_len))) | 94 | !HMAC_Update(&hmac, previous, digest_len))) |
95 | goto out; | 95 | goto out; |
96 | 96 | ||
97 | if (!HMAC_Update(&hmac, info, info_len) || | 97 | if (!HMAC_Update(&hmac, info, info_len) || |