Replace MBEDTLS_ERR_OID_NOT_FOUND with MBEDTLS_ERR_X509_UNKNOWN_OID
Replace the non-X.509-named error code `MBEDTLS_ERR_OID_NOT_FOUND` with
`MBEDTLS_ERR_X509_UNKNOWN_OID`, which already exists and is currently not
used for anything.
Public functions in X.509 propagate this error code, so it needs to have a
public name.
Remove the definition of `MBEDTLS_ERR_OID_NOT_FOUND` in `x509_oid.h`, then
```
git grep -l MBEDTLS_ERR_OID_NOT_FOUND | xargs perl -i -pe 's/\bMBEDTLS_ERR_OID_NOT_FOUND\b/MBEDTLS_ERR_X509_UNKNOWN_OID/g'
```
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/tests/suites/test_suite_x509_oid.function b/tests/suites/test_suite_x509_oid.function
index 8273a71..f10c68d 100644
--- a/tests/suites/test_suite_x509_oid.function
+++ b/tests/suites/test_suite_x509_oid.function
@@ -23,7 +23,7 @@
ret = mbedtls_x509_oid_get_certificate_policies(&asn1_buf, &desc);
if (strlen(result_str) == 0) {
- TEST_ASSERT(ret == MBEDTLS_ERR_OID_NOT_FOUND);
+ TEST_ASSERT(ret == MBEDTLS_ERR_X509_UNKNOWN_OID);
} else {
TEST_ASSERT(ret == 0);
TEST_ASSERT(strcmp((char *) desc, result_str) == 0);
@@ -44,7 +44,7 @@
ret = mbedtls_x509_oid_get_extended_key_usage(&asn1_buf, &desc);
if (strlen(result_str) == 0) {
- TEST_ASSERT(ret == MBEDTLS_ERR_OID_NOT_FOUND);
+ TEST_ASSERT(ret == MBEDTLS_ERR_X509_UNKNOWN_OID);
} else {
TEST_ASSERT(ret == 0);
TEST_ASSERT(strcmp((char *) desc, result_str) == 0);
@@ -65,7 +65,7 @@
ret = mbedtls_x509_oid_get_x509_ext_type(&ext_oid, &ext_type);
if (exp_type == 0) {
- TEST_ASSERT(ret == MBEDTLS_ERR_OID_NOT_FOUND);
+ TEST_ASSERT(ret == MBEDTLS_ERR_X509_UNKNOWN_OID);
} else {
TEST_ASSERT(ret == 0);
TEST_ASSERT(ext_type == exp_type);
@@ -87,7 +87,7 @@
ret = mbedtls_x509_oid_get_md_alg(&md_oid, &md_id);
if (exp_md_id < 0) {
- TEST_ASSERT(ret == MBEDTLS_ERR_OID_NOT_FOUND);
+ TEST_ASSERT(ret == MBEDTLS_ERR_X509_UNKNOWN_OID);
TEST_ASSERT(md_id == 0);
} else {
TEST_ASSERT(ret == 0);