Remove a code excerpt which is not ready for primetime just yet

This commit is contained in:
agc 2009-12-22 06:55:03 +00:00
parent 5836ded60b
commit 46c46156b2

View File

@ -34,7 +34,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
__RCSID("$NetBSD: netpgp.c,v 1.35 2009/12/22 06:53:26 agc Exp $");
__RCSID("$NetBSD: netpgp.c,v 1.36 2009/12/22 06:55:03 agc Exp $");
#endif
#include <sys/types.h>
@ -1103,57 +1103,3 @@ netpgp_set_homedir(netpgp_t *netpgp, char *home, const char *subdir, const int q
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