Merge pull request #2938 from yanesca/iotssl-2954-custom-io-unit-test
Mock TCP sockets and callbacks for SSL unit tests
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index e450207..afbaca4 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -6835,7 +6835,7 @@
if( peer_crt->raw.len != crt_buf_len )
return( -1 );
- return( memcmp( peer_crt->raw.p, crt_buf, crt_buf_len ) );
+ return( memcmp( peer_crt->raw.p, crt_buf, peer_crt->raw.len ) );
}
#else /* MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */
static int ssl_check_peer_crt_unchanged( mbedtls_ssl_context *ssl,
diff --git a/scripts/config.pl b/scripts/config.pl
index 95e3191..c836b37 100755
--- a/scripts/config.pl
+++ b/scripts/config.pl
@@ -19,9 +19,9 @@
## This file is part of Mbed TLS (https://tls.mbed.org)
my $py = $0;
-$py =~ s/\.pl$/.py/;
+$py =~ s/\.pl$/.py/ or die "Unable to determine the name of the Python script";
exec 'python3', $py, @ARGV;
-print STDERR "$0: python3: $!\n";
+print STDERR "$0: python3: $!. Trying python instead.\n";
exec 'python', $py, @ARGV;
print STDERR "$0: python: $!\n";
exit 127;