aboutsummaryrefslogtreecommitdiffstats
path: root/libar2_hash.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-12 21:56:50 +0100
committerMattias Andrée <maandree@kth.se>2022-02-12 21:56:50 +0100
commit33c953317cad9ea06d8a26fe2cc2ed0ed9e29692 (patch)
tree9e34e8fd215966299d11cf93d5471c76b3a933a7 /libar2_hash.c
parentlibar2_encode_base64: data may be NULL if buf is NULL (diff)
downloadlibar2-33c953317cad9ea06d8a26fe2cc2ed0ed9e29692.tar.gz
libar2-33c953317cad9ea06d8a26fe2cc2ed0ed9e29692.tar.bz2
libar2-33c953317cad9ea06d8a26fe2cc2ed0ed9e29692.tar.xz
Use params->version == 0 for implicit specification of version 1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libar2_hash.c')
-rw-r--r--libar2_hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libar2_hash.c b/libar2_hash.c
index 0eb9211..7f3cf3b 100644
--- a/libar2_hash.c
+++ b/libar2_hash.c
@@ -339,7 +339,7 @@ initial_hash(unsigned char hash[static 64], void *msg, size_t msglen,
n += store32(&block[n], (uint_least32_t)params->hashlen);
n += store32(&block[n], params->m_cost);
n += store32(&block[n], params->t_cost);
- n += store32(&block[n], (uint_least32_t)params->version);
+ n += store32(&block[n], (uint_least32_t)(params->version ? params->version : LIBAR2_ARGON2_VERSION_10));
n += store32(&block[n], (uint_least32_t)params->type);
n += store32(&block[n], (uint_least32_t)msglen);
if (msglen) {