~ubuntu-branches/ubuntu/maverick/gnutls26/maverick-updates

« back to all changes in this revision

Viewing changes to tests/chainverify.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2009-11-13 19:53:04 UTC
  • mfrom: (1.2.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: james.westby@ubuntu.com-20091113195304-w4s5rblsd8427chw
Tags: upstream-2.8.5
ImportĀ upstreamĀ versionĀ 2.8.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <gnutls/gnutls.h>
33
33
#include <gnutls/x509.h>
34
34
 
 
35
/* GnuTLS internally calls time() to find out the current time when
 
36
   verifying certificates.  To avoid a time bomb, we hard code the
 
37
   current time.  This should work fine on systems where the library
 
38
   call to time is resolved at run-time.  */
 
39
time_t
 
40
time (time_t *t)
 
41
{
 
42
  time_t then = 1256803113;
 
43
 
 
44
  if (t)
 
45
    *t = then;
 
46
 
 
47
  return then;
 
48
}
 
49
 
35
50
/* *INDENT-OFF* */
36
51
 
37
52
/* Triggers incorrect verification success on older versions */
701
716
  { "rsa-md5 not ok", mayfirst_chain, &mayfirst_chain[1],
702
717
    GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2,
703
718
    GNUTLS_CERT_INSECURE_ALGORITHM | GNUTLS_CERT_INVALID },
 
719
  { "rsa-md5 not ok2", mayfirst_chain, &mayfirst_chain[1],
 
720
    GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5,
 
721
    GNUTLS_CERT_EXPIRED | GNUTLS_CERT_INVALID },
704
722
  { "rsa-md5 ok", mayfirst_chain, &mayfirst_chain[1],
705
 
    GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5, 0 },
 
723
    GNUTLS_VERIFY_DISABLE_TIME_CHECKS | GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5, 0 },
706
724
  { "v1ca fail", v1ca, &v1ca[2],
707
725
    0, GNUTLS_CERT_SIGNER_NOT_CA | GNUTLS_CERT_INVALID },
708
726
  { "v1ca expired", v1ca, &v1ca[2],