diff --git a/src/bio.c b/src/bio.c index 6ace590ca1..5a28cafb99 100644 --- a/src/bio.c +++ b/src/bio.c @@ -391,7 +391,7 @@ int wolfSSL_BIO_read(WOLFSSL_BIO* bio, void* buf, int len) } #ifdef WOLFSSL_BIO_HAVE_FLOW_STATS - if ((ret > 0) && (! inhibit_flow_increment)) { + if ((ret > 0) && (!inhibit_flow_increment)) { bio->bytes_read += (word32)ret; } #endif @@ -902,7 +902,8 @@ long wolfSSL_BIO_ctrl(WOLFSSL_BIO *bio, int cmd, long larg, void *parg) if (parg == NULL) { wolfSSL_BIO_ADDR_clear(&bio->peer_addr); bio->connected = 0; - } else { + } + else { socklen_t addr_size = wolfSSL_BIO_ADDR_size((WOLFSSL_BIO_ADDR *)parg); if (addr_size == 0) { ret = WOLFSSL_FAILURE; diff --git a/src/ssl.c b/src/ssl.c index b7a9f3c8c7..67cc8a71cb 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -7347,13 +7347,6 @@ int wolfSSL_i2d_PUBKEY(const WOLFSSL_EVP_PKEY *key, unsigned char **der) return wolfSSL_i2d_PublicKey(key, der); } -int wolfSSL_i2d_X509_PUBKEY(WOLFSSL_X509_PUBKEY* x509_PubKey, unsigned char** der) -{ - if (x509_PubKey == NULL) - return WOLFSSL_FATAL_ERROR; - return wolfSSL_i2d_PublicKey(x509_PubKey->pkey, der); -} - #endif /* OPENSSL_EXTRA && !NO_CERTS && !NO_ASN && !NO_PWDBASED */ static WOLFSSL_EVP_PKEY* _d2i_PublicKey(int type, WOLFSSL_EVP_PKEY** out, diff --git a/src/wolfio.c b/src/wolfio.c index e52565934d..c5b00d20d3 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -1461,7 +1461,8 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec) #ifdef HAVE_IO_TIMEOUT if ((ret != 0) && (to_sec > 0)) { #ifdef USE_WINDOWS_API - if ((ret == SOCKET_ERROR) && (wolfSSL_LastError(ret, *sockfd) == SOCKET_EWOULDBLOCK)) + if ((ret == SOCKET_ERROR) && + (wolfSSL_LastError(ret, *sockfd) == SOCKET_EWOULDBLOCK)) #else if (errno == EINPROGRESS) #endif diff --git a/src/x509.c b/src/x509.c index f03e7cfb84..d4ba3200ab 100644 --- a/src/x509.c +++ b/src/x509.c @@ -9592,6 +9592,17 @@ int wolfSSL_X509_PUBKEY_set(WOLFSSL_X509_PUBKEY **x, WOLFSSL_EVP_PKEY *key) #endif /* OPENSSL_ALL || WOLFSSL_APACHE_HTTPD || WOLFSSL_HAPROXY || WOLFSSL_WPAS */ +#if !defined(NO_CERTS) && !defined(NO_ASN) && !defined(NO_PWDBASED) + +int wolfSSL_i2d_X509_PUBKEY(WOLFSSL_X509_PUBKEY* x509_PubKey, unsigned char** der) +{ + if (x509_PubKey == NULL) + return WOLFSSL_FATAL_ERROR; + return wolfSSL_i2d_PublicKey(x509_PubKey->pkey, der); +} + +#endif /* !NO_CERTS && !NO_ASN && !NO_PWDBASED */ + #endif /* OPENSSL_EXTRA */ #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL) diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index 265efb6800..693aaff60c 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -83,6 +83,21 @@ enum { ASN_AFTER = 1 }; +#ifndef NO_ASN_OLD_TYPE_NAMES + #ifndef ISSUER + #define ISSUER ASN_ISSUER + #endif + #ifndef SUBJECT + #define SUBJECT ASN_SUBJECT + #endif + #ifndef BEFORE + #define BEFORE ASN_BEFORE + #endif + #ifndef AFTER + #define AFTER ASN_AFTER + #endif +#endif + /* ASN Tags */ enum ASN_Tags { ASN_EOC = 0x00,