commit | c75c56fef73745975a8a82271d6f2e8bde526ca4 | [log] [tgz] |
---|---|---|
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Mon Sep 02 16:25:37 2013 +0200 |
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Mon Sep 02 16:25:37 2013 +0200 |
tree | 32b2529deb145f92f4837055ec4c7c7c975ef9c2 | |
parent | e09d2f8261723acfecaf22d6fcde723913ee8ff0 [diff] [blame] |
Fix off-by-one error in ecdsa_write_signature() Made some signature fail with 521-bit curve
diff --git a/library/ecdsa.c b/library/ecdsa.c index bbdb5d5..dc169ce 100644 --- a/library/ecdsa.c +++ b/library/ecdsa.c
@@ -220,8 +220,8 @@ void *p_rng ) { int ret; - unsigned char buf[MAX_SIG_LEN]; - unsigned char *p = buf + MAX_SIG_LEN - 1; + unsigned char buf[MAX_SIG_LEN + 3]; + unsigned char *p = buf + MAX_SIG_LEN; size_t len = 0; if( ( ret = ecdsa_sign( &ctx->grp, &ctx->r, &ctx->s, &ctx->d,