diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index ca4d7c74e..591f4c49e 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -805,6 +805,10 @@ exit: fflush( stdout ); getchar(); #endif + // Shell can not handle large exit numbers -> 1 for errors + if( ret < 0 ) + ret = 1; + return( ret ); } #endif /* POLARSSL_BIGNUM_C && POLARSSL_ENTROPY_C && POLARSSL_SSL_TLS_C && diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index c12e2d031..9628afb06 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -865,6 +865,10 @@ exit: fflush( stdout ); getchar(); #endif + // Shell can not handle large exit numbers -> 1 for errors + if( ret < 0 ) + ret = 1; + return( ret ); } #endif /* POLARSSL_BIGNUM_C && POLARSSL_ENTROPY_C && POLARSSL_SSL_TLS_C &&