The retrieved certificate purpose OID was compared against the expected
1.3.6.1.5.5.7.3.9 value without checking if the lengths were identical,
allowing a value that constitutes a prefix to match.
The check now compares the length as well.
Reported-by: Joshua Rogers of AISLE Research Team <joshua@joshua.hu>
Co-authored-by: Joshua Rogers of AISLE Research Team <joshua@joshua.hu>
Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
return gnutls_assert_val(rc);
}
- if (memcmp(oidtmp, GNUTLS_KP_OCSP_SIGNING, oidsize) != 0) {
+ if (oidsize != sizeof(GNUTLS_KP_OCSP_SIGNING) - 1 ||
+ memcmp(oidtmp, GNUTLS_KP_OCSP_SIGNING, oidsize) != 0) {
gnutls_assert();
continue;
}