summaryrefslogtreecommitdiff
path: root/apps/s_client.c
diff options
context:
space:
mode:
authorkyungwook tak <k.tak@samsung.com>2015-03-12 11:36:31 +0900
committerkyungwook tak <k.tak@samsung.com>2015-03-12 11:42:31 +0900
commit057bf157b3a518b7a0fa333c5d4c907df5b9cb4a (patch)
treeb4ee9b579b660890d23f72d4ea098e72f1a484de /apps/s_client.c
parentb87d7a90f2f67d906be0ee4d2ed9c4fa189d39a9 (diff)
downloadopenssl-057bf157b3a518b7a0fa333c5d4c907df5b9cb4a.tar.gz
openssl-057bf157b3a518b7a0fa333c5d4c907df5b9cb4a.tar.bz2
openssl-057bf157b3a518b7a0fa333c5d4c907df5b9cb4a.zip
Imported Upstream version 1.0.1lupstream/1.0.1l
Change-Id: I99680d38528c4117e59bb5377cc54820b22b93a2
Diffstat (limited to 'apps/s_client.c')
-rw-r--r--apps/s_client.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/apps/s_client.c b/apps/s_client.c
index c2e160c..19545e2 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -329,10 +329,12 @@ static void sc_usage(void)
BIO_printf(bio_err," -srppass arg - password for 'user'\n");
BIO_printf(bio_err," -srp_lateuser - SRP username into second ClientHello message\n");
BIO_printf(bio_err," -srp_moregroups - Tolerate other than the known g N values.\n");
- BIO_printf(bio_err," -srp_strength int - minimal mength in bits for N (default %d).\n",SRP_MINIMAL_N);
+ BIO_printf(bio_err," -srp_strength int - minimal length in bits for N (default %d).\n",SRP_MINIMAL_N);
#endif
BIO_printf(bio_err," -ssl2 - just use SSLv2\n");
+#ifndef OPENSSL_NO_SSL3_METHOD
BIO_printf(bio_err," -ssl3 - just use SSLv3\n");
+#endif
BIO_printf(bio_err," -tls1_2 - just use TLSv1.2\n");
BIO_printf(bio_err," -tls1_1 - just use TLSv1.1\n");
BIO_printf(bio_err," -tls1 - just use TLSv1\n");
@@ -807,7 +809,7 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"-ssl2") == 0)
meth=SSLv2_client_method();
#endif
-#ifndef OPENSSL_NO_SSL3
+#ifndef OPENSSL_NO_SSL3_METHOD
else if (strcmp(*argv,"-ssl3") == 0)
meth=SSLv3_client_method();
#endif
@@ -1319,10 +1321,22 @@ re_start:
BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout);
}
- if (socket_mtu > 28)
+ if (socket_mtu)
{
+ if(socket_mtu < DTLS_get_link_min_mtu(con))
+ {
+ BIO_printf(bio_err,"MTU too small. Must be at least %ld\n",
+ DTLS_get_link_min_mtu(con));
+ BIO_free(sbio);
+ goto shut;
+ }
SSL_set_options(con, SSL_OP_NO_QUERY_MTU);
- SSL_set_mtu(con, socket_mtu - 28);
+ if(!DTLS_set_link_mtu(con, socket_mtu))
+ {
+ BIO_printf(bio_err, "Failed to set MTU\n");
+ BIO_free(sbio);
+ goto shut;
+ }
}
else
/* want to do MTU discovery */