SMTP lines are officially terminated with CRLF, ssl_mail_client fixed

This commit is contained in:
Paul Bakker 2014-01-24 16:11:17 +01:00
parent 1e7c3d2500
commit af0ccc8fa0
2 changed files with 13 additions and 12 deletions

View file

@ -16,6 +16,7 @@ Bugfix
* Fix ASM format in bn_mul.h
* Potential memory leak in bignum_selftest()
* Replaced expired test certificate
* ssl_mail_client now terminates lines with CRLF, instead of LF
= Version 1.2.10 released 2013-10-07
Changes

View file

@ -625,7 +625,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
gethostname( hostname, 32 );
len = sprintf( (char *) buf, "EHLO %s\n", hostname );
len = sprintf( (char *) buf, "EHLO %s\r\n", hostname );
ret = write_ssl_and_get_response( &ssl, buf, len );
if( ret < 200 || ret > 299 )
{
@ -651,7 +651,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
gethostname( hostname, 32 );
len = sprintf( (char *) buf, "EHLO %s\n", hostname );
len = sprintf( (char *) buf, "EHLO %s\r\n", hostname );
ret = write_and_get_response( server_fd, buf, len );
if( ret < 200 || ret > 299 )
{
@ -665,7 +665,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
gethostname( hostname, 32 );
len = sprintf( (char *) buf, "STARTTLS\n" );
len = sprintf( (char *) buf, "STARTTLS\r\n" );
ret = write_and_get_response( server_fd, buf, len );
if( ret < 200 || ret > 299 )
{
@ -685,7 +685,7 @@ int main( int argc, char *argv[] )
printf( " > Write AUTH LOGIN to server:" );
fflush( stdout );
len = sprintf( (char *) buf, "AUTH LOGIN\n" );
len = sprintf( (char *) buf, "AUTH LOGIN\r\n" );
ret = write_ssl_and_get_response( &ssl, buf, len );
if( ret < 200 || ret > 399 )
{
@ -701,7 +701,7 @@ int main( int argc, char *argv[] )
n = sizeof( buf );
len = base64_encode( base, &n, (const unsigned char *) opt.user_name,
strlen( opt.user_name ) );
len = sprintf( (char *) buf, "%s\n", base );
len = sprintf( (char *) buf, "%s\r\n", base );
ret = write_ssl_and_get_response( &ssl, buf, len );
if( ret < 300 || ret > 399 )
{
@ -716,7 +716,7 @@ int main( int argc, char *argv[] )
len = base64_encode( base, &n, (const unsigned char *) opt.user_pwd,
strlen( opt.user_pwd ) );
len = sprintf( (char *) buf, "%s\n", base );
len = sprintf( (char *) buf, "%s\r\n", base );
ret = write_ssl_and_get_response( &ssl, buf, len );
if( ret < 200 || ret > 399 )
{
@ -731,7 +731,7 @@ int main( int argc, char *argv[] )
printf( " > Write MAIL FROM to server:" );
fflush( stdout );
len = sprintf( (char *) buf, "MAIL FROM:<%s>\n", opt.mail_from );
len = sprintf( (char *) buf, "MAIL FROM:<%s>\r\n", opt.mail_from );
ret = write_ssl_and_get_response( &ssl, buf, len );
if( ret < 200 || ret > 299 )
{
@ -744,7 +744,7 @@ int main( int argc, char *argv[] )
printf( " > Write RCPT TO to server:" );
fflush( stdout );
len = sprintf( (char *) buf, "RCPT TO:<%s>\n", opt.mail_to );
len = sprintf( (char *) buf, "RCPT TO:<%s>\r\n", opt.mail_to );
ret = write_ssl_and_get_response( &ssl, buf, len );
if( ret < 200 || ret > 299 )
{
@ -757,7 +757,7 @@ int main( int argc, char *argv[] )
printf( " > Write DATA to server:" );
fflush( stdout );
len = sprintf( (char *) buf, "DATA\n" );
len = sprintf( (char *) buf, "DATA\r\n" );
ret = write_ssl_and_get_response( &ssl, buf, len );
if( ret < 300 || ret > 399 )
{
@ -770,10 +770,10 @@ int main( int argc, char *argv[] )
printf( " > Write content to server:" );
fflush( stdout );
len = sprintf( (char *) buf, "From: %s\nSubject: PolarSSL Test mail\n\n"
len = sprintf( (char *) buf, "From: %s\r\nSubject: PolarSSL Test mail\r\n\r\n"
"This is a simple test mail from the "
"PolarSSL mail client example.\n"
"\n"
"PolarSSL mail client example.\r\n"
"\r\n"
"Enjoy!", opt.mail_from );
ret = write_ssl_data( &ssl, buf, len );