mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Fix DecodePrivateKey to return NOT_COMPILED_IN with PKCS#11
This commit is contained in:
@@ -17016,6 +17016,8 @@ int DecodePrivateKey(WOLFSSL *ssl, word16* length)
|
|||||||
/* Return the maximum signature length. */
|
/* Return the maximum signature length. */
|
||||||
*length = (word16)wc_ecc_sig_size_calc(ssl->buffers.keySz);
|
*length = (word16)wc_ecc_sig_size_calc(ssl->buffers.keySz);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
ret = NOT_COMPILED_IN;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (ssl->buffers.keyType == ecc_dsa_sa_algo) {
|
else if (ssl->buffers.keyType == ecc_dsa_sa_algo) {
|
||||||
@@ -17032,6 +17034,8 @@ int DecodePrivateKey(WOLFSSL *ssl, word16* length)
|
|||||||
/* Return the maximum signature length. */
|
/* Return the maximum signature length. */
|
||||||
*length = (word16)wc_ecc_sig_size_calc(ssl->buffers.keySz);
|
*length = (word16)wc_ecc_sig_size_calc(ssl->buffers.keySz);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
ret = NOT_COMPILED_IN;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
goto exit_dpk;
|
goto exit_dpk;
|
||||||
|
@@ -11168,7 +11168,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
|
|||||||
|
|
||||||
FreeDer(&ctx->privateKey);
|
FreeDer(&ctx->privateKey);
|
||||||
if (AllocDer(&ctx->privateKey, (word32)sz, PRIVATEKEY_TYPE,
|
if (AllocDer(&ctx->privateKey, (word32)sz, PRIVATEKEY_TYPE,
|
||||||
ctx->heap) == 0) {
|
ctx->heap) == 0) {
|
||||||
XMEMCPY(ctx->privateKey->buffer, id, sz);
|
XMEMCPY(ctx->privateKey->buffer, id, sz);
|
||||||
ctx->privateKeyId = 1;
|
ctx->privateKeyId = 1;
|
||||||
ctx->privateKeySz = (word32)keySz;
|
ctx->privateKeySz = (word32)keySz;
|
||||||
|
Reference in New Issue
Block a user