uuidPos = memmem(peerCert->subject_raw.p, peerCert->subject_raw.len,
UUID_PREFIX, sizeof(UUID_PREFIX) - 1);
+ if (NULL == uuidPos)
+ {
+ void * posLeftBrace = NULL;
+ void * posRightBrace = NULL;
+ posLeftBrace = memmem(peerCert->subject_raw.p, peerCert->subject_raw.len, "(", 1);
+ if (NULL != posLeftBrace)
+ {
+ posRightBrace = memmem(peerCert->subject_raw.p, peerCert->subject_raw.len, ")", 1);
+ if (NULL != posRightBrace && posRightBrace - posLeftBrace - 1 == UUID_LENGTH * 2 + 4)
+ {
+ uuidPos = posLeftBrace;
+ }
+ }
+ }
+
if (NULL != uuidPos)
{
memcpy(uuid, (char*) uuidPos + sizeof(UUID_PREFIX) - 1, UUID_LENGTH * 2 + 4);