On svn-auth-x509 branch, don't use memcmp() without checking that the
buffer is long enough for the comparision.

This fixes the certificate that Ivan found in his auth store that caused an
error with the parser.  The parser was assuming (very wrongly) that the OID
for the signature algorithm was always 9 bytes.  This commit goes beyond just
fixing that cert and generally fixes all the usages of memcmp() to be safe.

* subversion/libsvn_subr/x509parse.c
  (equal, oids_equal, starts_with): Functions to wrap safely calling memcmp().
    Makes things easier to read.
  (x509_get_ext): Use equal() rather than memcmp().
  (x509parse_dn_gets): Use starts_with() rather than memcmp() and format per
    our style.
  (x509parse_get_hostnames): Use starts_with() rather than memcmp().
  (svn_x509_parse_cert): Use oids_equal() rather than memcmp().

* subversion/tests/libsvn_subr/x509-test.c
  (x509_test): Add a test for a certificate with a short signature algorithm
    OID.



git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/svn-auth-x509@1618575 13f79535-47bb-0310-9956-ffa450edef68