aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-28 13:04:11 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-28 13:04:11 +0200
commita46fff931d631a176f56547692b16ae32c89299b (patch)
tree7e3047599adcf186cf24619e7de3a4b79add7622
parent056a07885e5023b69abd03c19e1d3029126d55bf (diff)
add patch from Niibe Yutaka for
#5328
-rw-r--r--src/util/crypto_ecc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c
index 1abf0fddc1..8d9091b23d 100644
--- a/src/util/crypto_ecc.c
+++ b/src/util/crypto_ecc.c
@@ -1281,6 +1281,16 @@ eddsa_d_to_a (gcry_mpi_t d)
gcry_mpi_print (GCRYMPI_FMT_USG,
rawmpi, rawmpilen, &rawmpilen,
d));
+ if (rawmpilen < 32)
+ {
+ memmove (rawmpi + 32 - rawmpilen,
+ rawmpi,
+ rawmpilen);
+ memset (rawmpi,
+ 0,
+ 32 - rawmpilen);
+ rawmpilen = 32;
+ }
hvec[0].data = digest;
hvec[0].off = 0;
hvec[0].len = b > rawmpilen ? (b - rawmpilen) : 0;