Switch to OpenSSL base64 routines

This commit is contained in:
Keith Winstein
2012-07-20 15:03:47 -04:00
parent 7f0fdd5160
commit 57c4904ed8
8 changed files with 122 additions and 621 deletions
+4 -5
View File
@@ -123,14 +123,13 @@ Base64Key::Base64Key()
string Base64Key::printable_key( void ) const
{
char base64[ 25 ];
char base64[ 24 ];
base64_encode( (char *)key, 16, base64, 25 );
base64_encode( (char *)key, 16, base64, 24 );
if ( (base64[ 24 ] != 0)
|| (base64[ 23 ] != '=')
if ( (base64[ 23 ] != '=')
|| (base64[ 22 ] != '=') ) {
throw CryptoException( "Unexpected output from base64_encode." );
throw CryptoException( string( "Unexpected output from base64_encode: " ) + string( base64, 24 ) );
}
base64[ 22 ] = 0;