mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
PR7648 20240418-exosip-apis peer review:
* tweak typography; * move wolfSSL_i2d_X509_PUBKEY() from ssl.c to x509.c; * in asn.h, add !NO_ASN_OLD_TYPE_NAMES macros to remap old names (ISSUER, SUBJECT, BEFORE, AFTER) by default unless the macros are already defined.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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,
|
||||
|
@@ -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
|
||||
|
11
src/x509.c
11
src/x509.c
@@ -9592,6 +9592,17 @@ error:
|
||||
|
||||
#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)
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user