From 63e38fe9147070d99e2d3c841dddf2274daa85c2 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 11 Sep 2019 14:16:40 +0100 Subject: [PATCH] ASN.1: Add helper macro to compare ASN.1 buffer to OID string --- include/mbedtls/asn1.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/mbedtls/asn1.h b/include/mbedtls/asn1.h index 1cfd414e3..5f15ddbe8 100644 --- a/include/mbedtls/asn1.h +++ b/include/mbedtls/asn1.h @@ -132,6 +132,10 @@ ( ( MBEDTLS_OID_SIZE(oid_str) != (oid_buf)->len ) || \ memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) != 0 ) +#define MBEDTLS_OID_CMP_RAW(oid_str, oid_buf, oid_buf_len) \ + ( ( MBEDTLS_OID_SIZE(oid_str) != (oid_buf_len) ) || \ + memcmp( (oid_str), (oid_buf), (oid_buf_len) ) != 0 ) + #ifdef __cplusplus extern "C" { #endif