[Cryptech-Commits] [sw/libhal] 09/12: Avoid gratuitous assertion failure if caller gives us a larger buffer than necessary when writing private key to DER.

git at cryptech.is git at cryptech.is
Mon Sep 14 21:43:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch ecdsa
in repository sw/libhal.

commit 552892788514459055f665e2b021a780cbacd35b
Author: Rob Austein <sra at hactrn.net>
Date:   Fri Sep 11 02:51:38 2015 -0400

    Avoid gratuitous assertion failure if caller gives us a larger buffer
    than necessary when writing private key to DER.
---
 ecdsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ecdsa.c b/ecdsa.c
index 8799ece..264f2c5 100644
--- a/ecdsa.c
+++ b/ecdsa.c
@@ -1105,7 +1105,7 @@ hal_error_t hal_ecdsa_key_to_der(const hal_ecdsa_key_t * const key,
   fp_to_unsigned_bin(unconst_fp_int(key->Q->y), d + q_len - Qy_len);
   d += q_len;
 
-  assert(d == der + der_max);
+  assert(d <= der + der_max);
 
   return HAL_OK;
 }



More information about the Commits mailing list