@@ -8346,8 +8346,12 @@ int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
83468346 #endif /* HAVE_PQC */
83478347
83488348 default:
8349+ /* In this case, there was an OID that we didn't recognize.
8350+ * This is an error. Use not compiled in because likely the
8351+ * given algorithm was not enabled. */
8352+ ret = NOT_COMPILED_IN;
83498353 WOLFSSL_MSG("No alt key size check done on certificate");
8350- break; /* do no check if not a case for the key */
8354+ break;
83518355 }
83528356
83538357 if (ssl != NULL) {
@@ -16686,6 +16690,10 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
1668616690 {
1668716691 int ret = WOLFSSL_FAILURE;
1668816692
16693+ if (ctx == NULL || id == NULL) {
16694+ return ret;
16695+ }
16696+
1668916697 FreeDer(&ctx->altPrivateKey);
1669016698 if (AllocDer(&ctx->altPrivateKey, (word32)sz, ALT_PRIVATEKEY_TYPE,
1669116699 ctx->heap) == 0) {
@@ -16706,8 +16714,13 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
1670616714 int devId)
1670716715 {
1670816716 int ret = WOLFSSL_FAILURE;
16709- word32 sz = (word32)XSTRLEN(label) + 1 ;
16717+ word32 sz;
1671016718
16719+ if (ctx == NULL || label == NULL) {
16720+ return ret;
16721+ }
16722+
16723+ sz = (word32)XSTRLEN(label) + 1;
1671116724 FreeDer(&ctx->altPrivateKey);
1671216725 if (AllocDer(&ctx->altPrivateKey, (word32)sz, ALT_PRIVATEKEY_TYPE,
1671316726 ctx->heap) == 0) {
@@ -17000,6 +17013,10 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
1700017013 {
1700117014 int ret = WOLFSSL_FAILURE;
1700217015
17016+ if (ssl == NULL || id == NULL) {
17017+ return ret;
17018+ }
17019+
1700317020 if (ssl->buffers.weOwnAltKey)
1700417021 FreeDer(&ssl->buffers.altKey);
1700517022 if (AllocDer(&ssl->buffers.altKey, (word32)sz, ALT_PRIVATEKEY_TYPE,
@@ -17022,8 +17039,13 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
1702217039 int devId)
1702317040 {
1702417041 int ret = WOLFSSL_FAILURE;
17025- word32 sz = (word32)XSTRLEN(label) + 1;
17042+ word32 sz;
17043+
17044+ if (ssl == NULL || label == NULL) {
17045+ return ret;
17046+ }
1702617047
17048+ sz = (word32)XSTRLEN(label) + 1;
1702717049 if (ssl->buffers.weOwnAltKey)
1702817050 FreeDer(&ssl->buffers.altKey);
1702917051 if (AllocDer(&ssl->buffers.altKey, (word32)sz, ALT_PRIVATEKEY_TYPE,
0 commit comments