mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
Improve pkparse test dependencies and changelog
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
parent
556a0790f6
commit
38202a2b18
@ -6,6 +6,4 @@ New deprecations
|
|||||||
of the output.
|
of the output.
|
||||||
|
|
||||||
Bugfix
|
Bugfix
|
||||||
* Pass real length of key to pk_parse_key_pkcs8_unencrypted_der()
|
* mbedtls_pk_parse_key() now rejects trailing garbage in encrypted keys.
|
||||||
after decrypting the key to avoid trailing padding data which are not
|
|
||||||
part of the original key before encrypting.
|
|
||||||
|
@ -5,6 +5,11 @@
|
|||||||
#include "mbedtls/ecp.h"
|
#include "mbedtls/ecp.h"
|
||||||
#include "mbedtls/psa_util.h"
|
#include "mbedtls/psa_util.h"
|
||||||
#include "pk_internal.h"
|
#include "pk_internal.h"
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_PKCS12_C) || defined(MBEDTLS_PKCS5_C)
|
||||||
|
#define HAVE_mbedtls_pk_parse_key_pkcs8_encrypted_der
|
||||||
|
#endif
|
||||||
|
|
||||||
/* END_HEADER */
|
/* END_HEADER */
|
||||||
|
|
||||||
/* BEGIN_DEPENDENCIES
|
/* BEGIN_DEPENDENCIES
|
||||||
@ -150,25 +155,19 @@ exit:
|
|||||||
}
|
}
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
/* BEGIN_CASE depends_on:MBEDTLS_TEST_HOOKS */
|
/* BEGIN_CASE depends_on:MBEDTLS_TEST_HOOKS:HAVE_mbedtls_pk_parse_key_pkcs8_encrypted_der */
|
||||||
void pk_parse_key_encrypted(data_t *buf, data_t *pass, int result)
|
void pk_parse_key_encrypted(data_t *buf, data_t *pass, int result)
|
||||||
{
|
{
|
||||||
mbedtls_pk_context pk;
|
mbedtls_pk_context pk;
|
||||||
|
|
||||||
mbedtls_pk_init(&pk);
|
mbedtls_pk_init(&pk);
|
||||||
USE_PSA_INIT();
|
USE_PSA_INIT();
|
||||||
#if defined(MBEDTLS_PKCS12_C) || defined(MBEDTLS_PKCS5_C)
|
|
||||||
TEST_EQUAL(mbedtls_pk_parse_key_pkcs8_encrypted_der(&pk, buf->x, buf->len,
|
TEST_EQUAL(mbedtls_pk_parse_key_pkcs8_encrypted_der(&pk, buf->x, buf->len,
|
||||||
pass->x, pass->len,
|
pass->x, pass->len,
|
||||||
mbedtls_test_rnd_std_rand,
|
mbedtls_test_rnd_std_rand,
|
||||||
NULL), result);
|
NULL), result);
|
||||||
exit:
|
exit:
|
||||||
#else
|
|
||||||
(void) buf;
|
|
||||||
(void) pass;
|
|
||||||
(void) result;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mbedtls_pk_free(&pk);
|
mbedtls_pk_free(&pk);
|
||||||
USE_PSA_DONE();
|
USE_PSA_DONE();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user