From 79bd20fd1755d0d8a6d1d758b2f8858643621923 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 24 Nov 2008 17:27:08 +0000 Subject: Update from stable-branch. --- apps/apps.c | 4 ++-- apps/apps.h | 4 +++- apps/s_client.c | 14 +++++++++----- apps/s_server.c | 14 +++++++++----- 4 files changed, 23 insertions(+), 13 deletions(-) (limited to 'apps') diff --git a/apps/apps.c b/apps/apps.c index 6a65f94434..56e87ecd3b 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -137,7 +137,7 @@ #include #endif #include -#ifdef OPENSSL_EXPERIMENTAL_JPAKE +#ifndef OPENSSL_NO_JPAKE #include #endif @@ -2381,7 +2381,7 @@ void policies_print(BIO *out, X509_STORE_CTX *ctx) BIO_free(out); } -#if defined(OPENSSL_EXPERIMENTAL_JPAKE) && !defined(OPENSSL_NO_PSK) +#if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) static JPAKE_CTX *jpake_init(const char *us, const char *them, const char *secret) diff --git a/apps/apps.h b/apps/apps.h index 62a8659624..4b0a0e1660 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -308,8 +308,10 @@ int bio_to_mem(unsigned char **out, int maxlen, BIO *in); int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value); int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx, const char *algname, ENGINE *e, int do_param); -#ifdef OPENSSL_EXPERIMENTAL_JPAKE +#ifndef OPENSSL_NO_PSK extern char *psk_key; +#endif +#ifndef OPENSSL_NO_JPAKE void jpake_client_auth(BIO *out, BIO *conn, const char *secret); void jpake_server_auth(BIO *out, BIO *conn, const char *secret); #endif diff --git a/apps/s_client.c b/apps/s_client.c index 05ebff1f67..f0783bcd58 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -312,7 +312,7 @@ static void sc_usage(void) #ifndef OPENSSL_NO_PSK BIO_printf(bio_err," -psk_identity arg - PSK identity\n"); BIO_printf(bio_err," -psk arg - PSK in hex (without 0x)\n"); -# ifdef OPENSSL_EXPERIMENTAL_JPAKE +# ifndef OPENSSL_NO_JPAKE BIO_printf(bio_err," -jpake arg - JPAKE secret to use\n"); # endif #endif @@ -432,7 +432,7 @@ int MAIN(int argc, char **argv) int peerlen = sizeof(peer); int enable_timeouts = 0 ; long socket_mtu = 0; -#ifdef OPENSSL_EXPERIMENTAL_JPAKE +#ifndef OPENSSL_NO_JPAKE char *jpake_secret = NULL; #endif @@ -704,7 +704,7 @@ int MAIN(int argc, char **argv) /* meth=TLSv1_client_method(); */ } #endif -#ifdef OPENSSL_EXPERIMENTAL_JPAKE +#ifndef OPENSSL_NO_JPAKE else if (strcmp(*argv,"-jpake") == 0) { if (--argc < 1) goto bad; @@ -727,7 +727,7 @@ bad: goto end; } -#if defined(OPENSSL_EXPERIMENTAL_JPAKE) && !defined(OPENSSL_NO_PSK) +#if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) if (jpake_secret) { if (psk_key) @@ -845,7 +845,11 @@ bad: #endif #ifndef OPENSSL_NO_PSK +#ifdef OPENSSL_NO_JPAKE + if (psk_key != NULL) +#else if (psk_key != NULL || jpake_secret) +#endif { if (c_debug) BIO_printf(bio_c_out, "PSK key given or JPAKE in use, setting client callback\n"); @@ -1049,7 +1053,7 @@ SSL_set_tlsext_status_ids(con, ids); #endif } #endif -#ifdef OPENSSL_EXPERIMENTAL_JPAKE +#ifndef OPENSSL_NO_JPAKE if (jpake_secret) jpake_client_auth(bio_c_out, sbio, jpake_secret); #endif diff --git a/apps/s_server.c b/apps/s_server.c index 277b2f04f2..3b7fb07765 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -450,7 +450,7 @@ static void sv_usage(void) #ifndef OPENSSL_NO_PSK BIO_printf(bio_err," -psk_hint arg - PSK identity hint to use\n"); BIO_printf(bio_err," -psk arg - PSK in hex (without 0x)\n"); -# ifdef OPENSSL_EXPERIMENTAL_JPAKE +# ifndef OPENSSL_NO_JPAKE BIO_printf(bio_err," -jpake arg - JPAKE secret to use\n"); # endif #endif @@ -827,7 +827,7 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids)); int MAIN(int, char **); -#ifdef OPENSSL_EXPERIMENTAL_JPAKE +#ifndef OPENSSL_NO_JPAKE static char *jpake_secret = NULL; #endif @@ -1189,7 +1189,7 @@ int MAIN(int argc, char *argv[]) } #endif -#if defined(OPENSSL_EXPERIMENTAL_JPAKE) && !defined(OPENSSL_NO_PSK) +#if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) else if (strcmp(*argv,"-jpake") == 0) { if (--argc < 1) goto bad; @@ -1212,7 +1212,7 @@ bad: goto end; } -#if defined(OPENSSL_EXPERIMENTAL_JPAKE) && !defined(OPENSSL_NO_PSK) +#if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) if (jpake_secret) { if (psk_key) @@ -1616,7 +1616,11 @@ bad: #endif #ifndef OPENSSL_NO_PSK +#ifdef OPENSSL_NO_JPAKE + if (psk_key != NULL) +#else if (psk_key != NULL || jpake_secret) +#endif { if (s_debug) BIO_printf(bio_s_out, "PSK key given or JPAKE in use, setting server callback\n"); @@ -1843,7 +1847,7 @@ static int sv_body(char *hostname, int s, unsigned char *context) test=BIO_new(BIO_f_nbio_test()); sbio=BIO_push(test,sbio); } -#ifdef OPENSSL_EXPERIMENTAL_JPAKE +#ifndef OPENSSL_NO_JPAKE if(jpake_secret) jpake_server_auth(bio_s_out, sbio, jpake_secret); #endif -- cgit v1.2.3