mirror of
https://github.com/espressif/mbedtls.git
synced 2025-05-09 11:21:21 +08:00
Use MD, not low-level SHA1, in X.509
X.509 already depends on MD_C || USE_PSA_CRYPTO, and this is for the !USE_PSA_CRYPTO branch, so we're free to use MD. This change supports our ability to use MBEDTLS_MD_CAN_xxx macros everywhere in the future, once they have been introduced. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
parent
0ac71c0d92
commit
2cd751465c
@ -32,7 +32,7 @@
|
|||||||
#include "mbedtls/error.h"
|
#include "mbedtls/error.h"
|
||||||
#include "mbedtls/oid.h"
|
#include "mbedtls/oid.h"
|
||||||
#include "mbedtls/platform_util.h"
|
#include "mbedtls/platform_util.h"
|
||||||
#include "mbedtls/sha1.h"
|
#include "mbedtls/md.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -229,7 +229,8 @@ static int mbedtls_x509write_crt_set_key_identifier(mbedtls_x509write_cert *ctx,
|
|||||||
return MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED;
|
return MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
ret = mbedtls_sha1(buf + sizeof(buf) - len, len,
|
ret = mbedtls_md(mbedtls_md_info_from_type(MBEDTLS_MD_SHA1),
|
||||||
|
buf + sizeof(buf) - len, len,
|
||||||
buf + sizeof(buf) - 20);
|
buf + sizeof(buf) - 20);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user