mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Replace MBEDTLS_ERR_OID_BUF_TOO_SMALL with PSA_ERROR_BUFFER_TOO_SMALL
Remove the definition of `MBEDTLS_ERR_OID_BUF_TOO_SMALL` in `x509_oid.h`, and use the corresponding PSA error instead. ``` git grep -l MBEDTLS_ERR_OID_BUF_TOO_SMALL | xargs perl -i -pe 's/\bMBEDTLS_ERR_OID_BUF_TOO_SMALL\b/PSA_ERROR_BUFFER_TOO_SMALL/p' edit library/x509_oid.h ``` Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@ -849,7 +849,7 @@ int mbedtls_oid_get_numeric_string(char *buf, size_t size,
|
||||
ret = mbedtls_snprintf(p, n, ".%u", value);
|
||||
}
|
||||
if (ret < 2 || (size_t) ret >= n) {
|
||||
return MBEDTLS_ERR_OID_BUF_TOO_SMALL;
|
||||
return PSA_ERROR_BUFFER_TOO_SMALL;
|
||||
}
|
||||
n -= (size_t) ret;
|
||||
p += ret;
|
||||
@ -912,7 +912,7 @@ int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn)
|
||||
p += ret;
|
||||
ret = mbedtls_snprintf(p, n, "=");
|
||||
print_hexstring = 1;
|
||||
} else if (ret == MBEDTLS_ERR_OID_BUF_TOO_SMALL) {
|
||||
} else if (ret == PSA_ERROR_BUFFER_TOO_SMALL) {
|
||||
return MBEDTLS_ERR_X509_BUFFER_TOO_SMALL;
|
||||
} else {
|
||||
ret = mbedtls_snprintf(p, n, "\?\?=");
|
||||
|
@ -314,7 +314,7 @@ static int oid_subidentifier_encode_into(unsigned char **p,
|
||||
size_t num_bytes = oid_subidentifier_num_bytes(value);
|
||||
|
||||
if ((size_t) (bound - *p) < num_bytes) {
|
||||
return MBEDTLS_ERR_OID_BUF_TOO_SMALL;
|
||||
return PSA_ERROR_BUFFER_TOO_SMALL;
|
||||
}
|
||||
(*p)[num_bytes - 1] = (unsigned char) (value & 0x7f);
|
||||
value >>= 7;
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
/** OID is not found. */
|
||||
#define MBEDTLS_ERR_OID_NOT_FOUND -0x002E
|
||||
/** output buffer is too small */
|
||||
#define MBEDTLS_ERR_OID_BUF_TOO_SMALL -0x000B
|
||||
|
||||
/*
|
||||
* Maximum number of OID components allowed
|
||||
|
Reference in New Issue
Block a user