fix RSA macro, tickets without server, and add test case

This commit is contained in:
Jacob Barthelmeh
2018-03-08 14:36:43 -07:00
parent e960e0544a
commit e0afec0600
3 changed files with 18 additions and 17 deletions

View File

@ -32170,9 +32170,21 @@ int wolfSSL_SSL_do_handshake(WOLFSSL *s)
if (s == NULL)
return WOLFSSL_FAILURE;
if (s->options.side == WOLFSSL_CLIENT_END)
if (s->options.side == WOLFSSL_CLIENT_END) {
#ifndef NO_WOLFSSL_CLIENT
return wolfSSL_connect(s);
#else
WOLFSSL_MSG("Client not compiled in");
return WOLFSSL_FAILURE;
#endif
}
#ifndef NO_WOLFSSL_SERVER
return wolfSSL_accept(s);
#else
WOLFSSL_MSG("Server not compiled in");
return WOLFSSL_FAILURE;
#endif
}
int wolfSSL_SSL_in_init(WOLFSSL *s)
@ -32298,7 +32310,7 @@ int wolfSSL_i2a_ASN1_INTEGER(BIO *bp, const WOLFSSL_ASN1_INTEGER *a)
}
#ifdef HAVE_SESSION_TICKET
#if defined(HAVE_SESSION_TICKET) && !defined(NO_WOLFSSL_SERVER)
/* Expected return values from implementations of OpenSSL ticket key callback.
*/
#define TICKET_KEY_CB_RET_FAILURE -1

View File

@ -15844,6 +15844,7 @@ static void test_wolfSSL_ERR_put_error(void)
file = NULL;
AssertIntEQ(ERR_get_error_line(&file, &line), 0);
AssertNull(file);
AssertIntEQ(ERR_get_error_line_data(&file, &line, NULL, NULL), 0);
/* Empty and free up all error nodes */
ERR_clear_error();

View File

@ -32,21 +32,9 @@
extern "C" {
#endif
#if !defined(NO_RSA) && !defined(HAVE_USER_RSA)
#if defined(HAVE_FIPS) || \
(defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION < 2))
/*
choice of padding added after fips, so not available when using fips RSA
*/
/* Padding types */
#define RSA_PKCS1_PADDING 0
#define RSA_PKCS1_OAEP_PADDING 1
#else
#define RSA_PKCS1_PADDING WC_RSA_PKCSV15_PAD
#define RSA_PKCS1_OAEP_PADDING WC_RSA_OAEP_PAD
#endif /* HAVE_FIPS */
#endif
/* Padding types */
#define RSA_PKCS1_PADDING 0
#define RSA_PKCS1_OAEP_PADDING 1
#ifndef WOLFSSL_RSA_TYPE_DEFINED /* guard on redeclaration */
typedef struct WOLFSSL_RSA WOLFSSL_RSA;