~ubuntu-branches/ubuntu/quantal/gnutls26/quantal-security

« back to all changes in this revision

Viewing changes to guile/tests/openpgp-keys.scm

  • Committer: Package Import Robot
  • Author(s): Andreas Metzler
  • Date: 2011-10-01 15:28:13 UTC
  • mfrom: (12.1.20 sid)
  • Revision ID: package-import@ubuntu.com-20111001152813-yygm1c4cxonfxhzy
Tags: 2.12.11-1
* New upstream version.
  + Allow CA importing of 0 certificates to succeed. Closes: #640639
* Add libp11-kit-dev to libgnutls-dev dependencies. (see #643811)
* [20_guiledocstring.diff] guile: Fix docstring extraction with CPP 4.5+.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;; GnuTLS-extra --- Guile bindings for GnuTLS-EXTRA.
2
 
;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc.
 
2
;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
3
3
;;;
4
4
;;; GnuTLS-extra is free software; you can redistribute it and/or modify
5
5
;;; it under the terms of the GNU General Public License as published by
25
25
 
26
26
(use-modules (gnutls)
27
27
             (gnutls extra)
 
28
             (gnutls build tests)
28
29
             (srfi srfi-1)
29
30
             (srfi srfi-4)
30
31
             (srfi srfi-11))
31
32
 
32
33
(define %certificate-file
33
 
  (search-path %load-path "openpgp-pub.asc"))
 
34
  (search-path %load-path "openpgp-elg-pub.asc"))
34
35
 
35
36
(define %private-key-file
36
 
  (search-path %load-path "openpgp-sec.asc"))
 
37
  (search-path %load-path "openpgp-elg-sec.asc"))
37
38
 
38
39
(define %key-id
39
40
  ;; Change me if you change the key files.
43
44
  (stat:size (stat file)))
44
45
 
45
46
 
46
 
(dynamic-wind
47
 
 
48
 
    (lambda ()
49
 
      #t)
50
 
 
 
47
(run-test
51
48
    (lambda ()
52
49
      (let ((raw-pubkey  (make-u8vector (file-size %certificate-file)))
53
50
            (raw-privkey (make-u8vector (file-size %private-key-file))))
60
57
              (sec (import-openpgp-private-key raw-privkey
61
58
                                           openpgp-certificate-format/base64)))
62
59
 
63
 
          (exit (and (openpgp-certificate? pub)
64
 
                     (openpgp-private-key? sec)
65
 
                     (equal? (openpgp-certificate-id pub) %key-id)
66
 
                     (u8vector? (openpgp-certificate-fingerprint pub))
67
 
                     (every string? (openpgp-certificate-names pub))
68
 
                     (member (openpgp-certificate-version pub) '(3 4))
69
 
                     (list? (openpgp-certificate-usage pub))
70
 
                     (let-values (((pk bits)
71
 
                                   (openpgp-certificate-algorithm pub)))
72
 
                       (and (string? (pk-algorithm->string pk))
73
 
                            (number? bits))))))))
74
 
 
75
 
    (lambda ()
76
 
      ;; failure
77
 
      (exit 1)))
 
60
          (and (openpgp-certificate? pub)
 
61
               (openpgp-private-key? sec)
 
62
               (equal? (openpgp-certificate-id pub) %key-id)
 
63
               (u8vector? (openpgp-certificate-fingerprint pub))
 
64
               (every string? (openpgp-certificate-names pub))
 
65
               (member (openpgp-certificate-version pub) '(3 4))
 
66
               (list? (openpgp-certificate-usage pub))
 
67
               (let-values (((pk bits)
 
68
                             (openpgp-certificate-algorithm pub)))
 
69
                 (and (string? (pk-algorithm->string pk))
 
70
                      (number? bits))))))))
78
71
 
79
72
;;; arch-tag: 2ee2a377-7f4d-4031-92a8-275090e4f83d