mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
Remove cruft.
Make --gen-revoke work
This commit is contained in:
parent
d6314594d2
commit
c212133918
@ -1,3 +1,10 @@
|
|||||||
|
2010-10-21 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* seckey-cert.c: Remove.
|
||||||
|
* Makefile.am (gpg2_SOURCES): Remove seckey-cert.c
|
||||||
|
|
||||||
|
* revoke.c (gen_revoke): Check that the secret key is available.
|
||||||
|
|
||||||
2010-10-20 Werner Koch <wk@g10code.com>
|
2010-10-20 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* verify.c (verify_signatures): Use gpg_strerror on open failure
|
* verify.c (verify_signatures): Use gpg_strerror on open failure
|
||||||
|
@ -81,7 +81,6 @@ gpg2_SOURCES = gpg.c \
|
|||||||
skclist.c \
|
skclist.c \
|
||||||
pubkey-enc.c \
|
pubkey-enc.c \
|
||||||
passphrase.c \
|
passphrase.c \
|
||||||
seckey-cert.c \
|
|
||||||
decrypt.c \
|
decrypt.c \
|
||||||
decrypt-data.c \
|
decrypt-data.c \
|
||||||
cipher.c \
|
cipher.c \
|
||||||
|
@ -132,7 +132,7 @@ decrypt_message_fd (ctrl_t ctrl, int input_fd, int output_fd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_W32CE_SYSTEM
|
#ifdef HAVE_W32CE_SYSTEM
|
||||||
#warning Need to fix this
|
#warning Need to fix this if we want to use g13
|
||||||
opt.outfp = NULL;
|
opt.outfp = NULL;
|
||||||
#else
|
#else
|
||||||
opt.outfp = fdopen (dup (output_fd), "wb");
|
opt.outfp = fdopen (dup (output_fd), "wb");
|
||||||
|
@ -481,8 +481,6 @@ int signature_check( PKT_signature *sig, gcry_md_hd_t digest );
|
|||||||
int signature_check2( PKT_signature *sig, gcry_md_hd_t digest, u32 *r_expiredate,
|
int signature_check2( PKT_signature *sig, gcry_md_hd_t digest, u32 *r_expiredate,
|
||||||
int *r_expired, int *r_revoked, PKT_public_key *ret_pk );
|
int *r_expired, int *r_revoked, PKT_public_key *ret_pk );
|
||||||
|
|
||||||
/*-- seckey-cert.c --*/
|
|
||||||
int is_secret_key_protected (PKT_public_key *pk);
|
|
||||||
|
|
||||||
/*-- pubkey-enc.c --*/
|
/*-- pubkey-enc.c --*/
|
||||||
gpg_error_t get_session_key (PKT_pubkey_enc *k, DEK *dek);
|
gpg_error_t get_session_key (PKT_pubkey_enc *k, DEK *dek);
|
||||||
|
24
g10/revoke.c
24
g10/revoke.c
@ -36,7 +36,7 @@
|
|||||||
#include "ttyio.h"
|
#include "ttyio.h"
|
||||||
#include "status.h"
|
#include "status.h"
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
#include "call-agent.h"
|
||||||
|
|
||||||
struct revocation_reason_info {
|
struct revocation_reason_info {
|
||||||
int code;
|
int code;
|
||||||
@ -462,7 +462,6 @@ gen_revoke (const char *uname)
|
|||||||
init_packet( &pkt );
|
init_packet( &pkt );
|
||||||
|
|
||||||
/* Search the userid; we don't want the whole getkey stuff here. */
|
/* Search the userid; we don't want the whole getkey stuff here. */
|
||||||
log_debug ("FIXME: This needs to be adjusted for public key based lookups\n");
|
|
||||||
kdbhd = keydb_new ();
|
kdbhd = keydb_new ();
|
||||||
rc = classify_user_id (uname, &desc);
|
rc = classify_user_id (uname, &desc);
|
||||||
if (!rc)
|
if (!rc)
|
||||||
@ -475,24 +474,29 @@ gen_revoke (const char *uname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = keydb_get_keyblock (kdbhd, &keyblock );
|
rc = keydb_get_keyblock (kdbhd, &keyblock );
|
||||||
if( rc ) {
|
if (rc)
|
||||||
log_error (_("error reading keyblock: %s\n"), g10_errstr(rc) );
|
{
|
||||||
goto leave;
|
log_error (_("error reading keyblock: %s\n"), g10_errstr(rc) );
|
||||||
}
|
goto leave;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the keyid from the keyblock. */
|
/* Get the keyid from the keyblock. */
|
||||||
node = find_kbnode (keyblock, PKT_PUBLIC_KEY);
|
node = find_kbnode (keyblock, PKT_PUBLIC_KEY);
|
||||||
if (!node)
|
if (!node)
|
||||||
BUG ();
|
BUG ();
|
||||||
|
|
||||||
/* fixme: should make a function out of this stuff,
|
|
||||||
* it's used all over the source */
|
|
||||||
psk = node->pkt->pkt.public_key;
|
psk = node->pkt->pkt.public_key;
|
||||||
|
rc = agent_probe_secret_key (NULL, psk);
|
||||||
|
if (rc)
|
||||||
|
{
|
||||||
|
log_error (_("secret key \"%s\" not found: %s\n"),
|
||||||
|
uname, gpg_strerror (rc));
|
||||||
|
goto leave;
|
||||||
|
}
|
||||||
|
|
||||||
keyid_from_pk (psk, keyid );
|
keyid_from_pk (psk, keyid );
|
||||||
print_seckey_info (psk);
|
print_seckey_info (psk);
|
||||||
|
|
||||||
#warning add code to check that the secret key is available
|
|
||||||
|
|
||||||
tty_printf("\n");
|
tty_printf("\n");
|
||||||
if (!cpr_get_answer_is_yes ("gen_revoke.okay",
|
if (!cpr_get_answer_is_yes ("gen_revoke.okay",
|
||||||
_("Create a revocation certificate for this key? (y/N) ")))
|
_("Create a revocation certificate for this key? (y/N) ")))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* seckey-cert.c - secret key certificate packet handling
|
/* seckey-cert.c - Not anymore used
|
||||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002,
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002,
|
||||||
* 2006, 2009 Free Software Foundation, Inc.
|
* 2006, 2009 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
@ -18,6 +18,8 @@
|
|||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#error Not anymore used - only kept for reference in the repository.
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -35,10 +37,9 @@
|
|||||||
#include "status.h"
|
#include "status.h"
|
||||||
#include "pkglue.h"
|
#include "pkglue.h"
|
||||||
|
|
||||||
#if 0 /* Not anymore used - kept for reference. */
|
|
||||||
static int
|
static int
|
||||||
do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
|
xxxx_do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
|
||||||
int *canceled )
|
int *canceled )
|
||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
byte *buffer;
|
byte *buffer;
|
||||||
@ -258,21 +259,6 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /*0*/
|
|
||||||
|
|
||||||
|
|
||||||
/****************
|
|
||||||
* check whether the secret key is protected.
|
|
||||||
* Returns: 0 not protected, -1 on error or the protection algorithm
|
|
||||||
* -2 indicates a card stub.
|
|
||||||
* -3 indicates a not-online stub.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
is_secret_key_protected (PKT_public_key *pk)
|
|
||||||
{
|
|
||||||
#warning do we need this
|
|
||||||
return 0; /* FIXME: use agent_get_keyinfo?*/
|
|
||||||
/* return sk->is_protected? */
|
|
||||||
/* sk->protect.s2k.mode == 1002? -2 : */
|
|
||||||
/* sk->protect.s2k.mode == 1001? -3 : sk->protect.algo : 0; */
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user