Reverse meaning of OID_CMP

This commit is contained in:
Manuel Pégourié-Gonnard 2015-03-19 16:54:56 +00:00
parent 852a6d3d8f
commit 6e0643762d
5 changed files with 9 additions and 11 deletions

View file

@ -99,12 +99,10 @@
*
* Only works for 'defined' oid_str values (OID_HMAC_SHA1), you cannot use a
* 'unsigned char *oid' here!
*
* Warning: returns true when the OIDs are equal (unlike memcmp)!
*/
#define OID_CMP(oid_str, oid_buf) \
( ( OID_SIZE(oid_str) == (oid_buf)->len ) && \
memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) == 0 )
( ( OID_SIZE(oid_str) != (oid_buf)->len ) || \
memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) != 0 )
#ifdef __cplusplus
extern "C" {