commit | 6c343d7d9ad1de103c3091ff8edaab1cec1a61a9 | [log] [tgz] |
---|---|---|
author | Paul Bakker <p.j.bakker@polarssl.org> | Thu Jul 10 14:36:19 2014 +0200 |
committer | Paul Bakker <p.j.bakker@polarssl.org> | Thu Jul 10 15:27:10 2014 +0200 |
tree | 48ba94f4297ba2846039d1034e86f8f7bc4e5ce3 | |
parent | 5b11d026cd0403833ea23a660bd71ea76c31c3b6 [diff] [blame] |
Fix mpi_write_string() to write "00" as hex output for empty MPI
diff --git a/library/bignum.c b/library/bignum.c index e7b8d6d..80cf0f8 100644 --- a/library/bignum.c +++ b/library/bignum.c
@@ -530,7 +530,7 @@ { c = ( X->p[i - 1] >> ( ( j - 1 ) << 3) ) & 0xFF; - if( c == 0 && k == 0 && ( i + j + 3 ) != 0 ) + if( c == 0 && k == 0 && ( i + j ) != 2 ) continue; *(p++) = "0123456789ABCDEF" [c / 16];