Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/netpgp/dist Modify regression test suite...



details:   https://anonhg.NetBSD.org/src/rev/54c3ccb74b23
branches:  trunk
changeset: 750245:54c3ccb74b23
user:      agc <agc%NetBSD.org@localhost>
date:      Tue Dec 22 06:53:26 2009 +0000

description:
Modify regression test suite behaviour - remove the (error) tests for
commands with no file arguments, as input will now be taken from stdin,
and output will go to stdout, if no file arguments are given on the
command line.

diffstat:

 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c |  56 +++++++++++++++++++++++-
 crypto/external/bsd/netpgp/dist/tst              |  10 +---
 2 files changed, 56 insertions(+), 10 deletions(-)

diffs (97 lines):

diff -r 5bd9d4a880c3 -r 54c3ccb74b23 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Tue Dec 22 06:51:31 2009 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Tue Dec 22 06:53:26 2009 +0000
@@ -34,7 +34,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.34 2009/12/22 06:03:24 agc Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.35 2009/12/22 06:53:26 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -1103,3 +1103,57 @@
        return 1;
 }
 
+#if 0
+#include "sshkey.h"
+
+int
+netpgp_pgpkey_to_sshkey(netpgp_t *netpgp, char *name, SSHKey *sshkey)
+{
+       const __ops_key_t       *pgpkey;
+       unsigned                 k;
+
+       k = 0;
+       pgpkey = __ops_getnextkeybyname(netpgp->io, netpgp->pubring, name, &k);
+       if (pgpkey == NULL) {
+               pgpkey = __ops_getkeybyname(io, netpgp->pubring, userid);
+       }
+       if (pgpkey == NULL) {
+               (void) fprintf(stderr, "No key matching '%s'\n", name);
+               return 0;
+       }
+       switch(pgpkey->key.pubkey.alg) {
+       case OPS_PKA_RSA:
+               sshkey->type = KEY_RSA;
+               sshkey->rsa = calloc(1, sizeof(*sshkey->rsa);
+               if (sshkey->rsa == NULL) {
+                       (void) fprintf(stderr, "RSA memory problems\n");
+                       return 0;
+               }
+               sshkey->rsa->n = pgpkey->key.pubkey.key.rsa.n;
+               sshkey->rsa->e = pgpkey->key.pubkey.key.rsa.e;
+               sshkey->rsa->d = pgpkey->key.seckey.key.rsa.d;
+               sshkey->rsa->p = pgpkey->key.seckey.key.rsa.p;
+               sshkey->rsa->q = pgpkey->key.seckey.key.rsa.q;
+               sshkey->rsa->iqmp = pgpkey->key.seckey.key.rsa.u;
+               break;
+       case OPS_PKA_DSA:
+               sshkey->type = KEY_DSA;
+               sshkey->dsa = calloc(1, sizeof(*sshkey->dsa);
+               if (sshkey->dsa == NULL) {
+                       (void) fprintf(stderr, "DSA memory problems\n");
+                       return 0;
+               }
+               sshkey->rsa->n = pgpkey->key.pubkey.key.rsa.n;
+               key->dsa->p = pgpkey->key.pubkey.key.dsa.p;
+               key->dsa->q = pgpkey->key.pubkey.key.dsa.q;
+               key->dsa->g = pgpkey->key.pubkey.key.dsa.g;
+               key->dsa->pub_key = pgpkey->key.pubkey.key.dsa.y;
+               key->dsa->priv_key = pgpkey->key.seckey.key.dsa.x;
+               break;
+       default:
+               (void) fprintf(stderr, "weird type\n");
+               return 0;
+       }
+       return 1;
+}
+#endif
diff -r 5bd9d4a880c3 -r 54c3ccb74b23 crypto/external/bsd/netpgp/dist/tst
--- a/crypto/external/bsd/netpgp/dist/tst       Tue Dec 22 06:51:31 2009 +0000
+++ b/crypto/external/bsd/netpgp/dist/tst       Tue Dec 22 06:53:26 2009 +0000
@@ -31,7 +31,7 @@
        su root -c "make install"'
 
 passed=0
-total=25
+total=21
 echo "======> sign/verify 180938 file"
 cp configure a
 /usr/bin/netpgp --sign a
@@ -82,14 +82,6 @@
 diff a a3 && passed=$(expr $passed + 1)
 echo "======> list keys"
 /usr/bin/netpgpkeys --list-keys && passed=$(expr $passed + 1)
-echo "======> null file to verify"
-/usr/bin/netpgp --verify || passed=$(expr $passed + 1)
-echo "======> null file to sign"
-/usr/bin/netpgp --sign || passed=$(expr $passed + 1)
-echo "======> null file to encrypt"
-/usr/bin/netpgp --encrypt || passed=$(expr $passed + 1)
-echo "======> null file to decrypt"
-/usr/bin/netpgp --decrypt || passed=$(expr $passed + 1)
 echo "======> version information"
 /usr/bin/netpgpverify --version
 echo "======> find specific key information"



Home | Main Index | Thread Index | Old Index