trim out more strings and fix DN tag

This commit is contained in:
Jacob Barthelmeh
2018-03-06 10:25:09 -07:00
parent a4000ba196
commit a9c6385fd1
4 changed files with 77 additions and 31 deletions

View File

@@ -4782,7 +4782,7 @@ int PemToDer(const unsigned char* buff, long longSz, int type,
word32 lineSz;
char* finish;
word32 finishSz;
char* start;
char* start = NULL;
word32 startSz;
char* newline;
@@ -4791,11 +4791,15 @@ int PemToDer(const unsigned char* buff, long longSz, int type,
}
lineSz = (word32)(bufferEnd - line);
#ifndef NO_DES3
start = XSTRNSTR(line, "DES", min(lineSz, PEM_LINE_LEN));
#endif
#ifndef NO_AES
if (start == NULL) {
start = XSTRNSTR(line, "AES", min(lineSz, PEM_LINE_LEN));
}
#endif
if (start == NULL) return WOLFSSL_BAD_FILE;
if (info == NULL) return WOLFSSL_BAD_FILE;
@@ -16097,20 +16101,29 @@ const char* wolfSSL_get_version(WOLFSSL* ssl)
WOLFSSL_ENTER("SSL_get_version");
if (ssl->version.major == SSLv3_MAJOR) {
switch (ssl->version.minor) {
#ifndef NO_OLD_TLS
#ifdef WOLFSSL_ALLOW_SSLV3
case SSLv3_MINOR :
return "SSLv3";
#endif
#ifdef WOLFSSL_ALLOW_TLSV10
case TLSv1_MINOR :
return "TLSv1";
#endif
case TLSv1_1_MINOR :
return "TLSv1.1";
#endif
case TLSv1_2_MINOR :
return "TLSv1.2";
#ifdef WOLFSSL_TLS13
case TLSv1_3_MINOR :
return "TLSv1.3";
#endif
default:
return "unknown";
}
}
#ifdef WOLFSSL_DTLS
else if (ssl->version.major == DTLS_MAJOR) {
switch (ssl->version.minor) {
case DTLS_MINOR :
@@ -16121,6 +16134,7 @@ const char* wolfSSL_get_version(WOLFSSL* ssl)
return "unknown";
}
}
#endif /* WOLFSSL_DTLS */
return "unknown";
}
@@ -29433,6 +29447,7 @@ void* wolfSSL_GetDhAgreeCtx(WOLFSSL* ssl)
type = oidBlkType;
break;
#ifndef NO_DES3
case NID_des:
id = DESb;
sName = "DES-CBC";
@@ -29444,6 +29459,7 @@ void* wolfSSL_GetDhAgreeCtx(WOLFSSL* ssl)
sName = "DES3-CBC";
type = oidBlkType;
break;
#endif /* !NO_DES3 */
#ifdef HAVE_OCSP
case NID_id_pkix_OCSP_basic: