Преглед изворни кода

Fix `hmac_memory_multi()` invocation

It expects a pair of type `(unsigned char*,unsigned long)` and not
`(unsigned char*,unsigned int)`.

Fixes: 46fa363f ("Finish up RFC6979 ECDSA keygen")
Reported-via: https://github.com/libtom/libtomcrypt/pull/699#issuecomment-3414862539 ff.
Signed-off-by: Steffen Jaeckel <[email protected]>
Steffen Jaeckel пре 1 месец
родитељ
комит
ac291e8bdd
2 измењених фајлова са 4 додато и 3 уклоњено
  1. 2 1
      src/mac/hmac/hmac_memory_multi.c
  2. 2 2
      src/pk/ecc/ecc_rfc6979_key.c

+ 2 - 1
src/mac/hmac/hmac_memory_multi.c

@@ -18,7 +18,8 @@
    @param outlen    [in/out] Max size and resulting size of authentication tag
    @param in        The data to HMAC
    @param inlen     The length of the data to HMAC (octets)
-   @param ...       tuples of (data,len) pairs to HMAC, terminated with a (NULL,x) (x=don't care)
+   @param ...       tuples of (data,len) pairs of type (unsigned char*,unsigned long) to HMAC,
+                     terminated with a (NULL,x) (x=don't care)
    @return CRYPT_OK if successful
 */
 int hmac_memory_multi(int hash,

+ 2 - 2
src/pk/ecc/ecc_rfc6979_key.c

@@ -68,7 +68,7 @@ int ecc_rfc6979_key(const ecc_key *priv, const unsigned char *in, unsigned long
                                k, hashsize,
                                k, &klen,
                                v, hashsize,
-                               sep, 1,
+                               sep, 1uL,
                                buffer, zero_extend,
                                privkey, qlen - zero_extend,
                                buffer, len_diff,
@@ -86,7 +86,7 @@ int ecc_rfc6979_key(const ecc_key *priv, const unsigned char *in, unsigned long
                                k, klen,
                                k, &klen,
                                v, hashsize,
-                               sep, 1,
+                               sep, 1uL,
                                buffer, zero_extend,
                                privkey, qlen - zero_extend,
                                buffer, len_diff,