From f097400abcbc45948cb9665eb5abc4f48fc4313a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 28 Jan 2015 16:49:26 +0000 Subject: [PATCH] Fix small bug in base64_encode() --- ChangeLog | 8 ++++++++ library/base64.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 597d144cd..2ab2cabac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,14 @@ Bugfix * Fix unchecked return code in x509_crt_parse_path() on Windows (found by Peter Vaskovic). * Fix assembly selection for MIPS64 (thanks to James Cowgill). + * ssl_get_verify_result() now works even if the handshake was aborted due + to a failed verification (found by Fredrik Axelsson). + * Skip writing and parsing signature_algorithm extension if none of the + key exchanges enabled needs certificates. This fixes a possible interop + issue with some servers when a zero-length extension was sent. (Reported + by Peter Dettman.) + * On a 0-length input, base64_encode() did not correctly set output length + (found by Hendrik van den Boogaard). Changes * Blind RSA private operations even when POLARSSL_RSA_NO_CRT is defined. diff --git a/library/base64.c b/library/base64.c index 05b2d8055..139c5cc07 100644 --- a/library/base64.c +++ b/library/base64.c @@ -72,7 +72,10 @@ int base64_encode( unsigned char *dst, size_t *dlen, unsigned char *p; if( slen == 0 ) + { + *dlen = 0; return( 0 ); + } n = (slen << 3) / 6;