mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
See ChangeLog: Wed Dec 23 13:34:22 CET 1998 Werner Koch
This commit is contained in:
parent
b1e5c79926
commit
750d74333c
138 changed files with 2976 additions and 2432 deletions
|
@ -1,3 +1,15 @@
|
|||
Wed Dec 23 13:18:14 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* pkclist.c (add_ownertrust): Refresh validity values.
|
||||
|
||||
* trustdb.c (enum_cert_paths_print): New arg refresh.
|
||||
|
||||
* ringedit.c: Fixed problems fix keyrings
|
||||
* parse-packet.c (dbg_parse_packet): New debug functions.
|
||||
|
||||
* getkey.c (getkey_disable_caches): New.
|
||||
* import.c (import_keys): Disable caches.
|
||||
|
||||
Thu Dec 17 18:31:15 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* misc.c (trap_unaligned): Only for glibc 1
|
||||
|
|
|
@ -1179,7 +1179,7 @@ armor_filter( void *opaque, int control,
|
|||
iobuf_writestr(a, "-----\n");
|
||||
}
|
||||
else if( !afx->any_data && !afx->inp_bypass )
|
||||
log_error(_("no valid RFC1991 or OpenPGP data found.\n"));
|
||||
log_error(_("no valid OpenPGP data found.\n"));
|
||||
}
|
||||
else if( control == IOBUFCTRL_DESC )
|
||||
*(char**)buf = "armor_filter";
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* build-packet.c - assemble packets and write them
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* cipher.c - En-/De-ciphering filter
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* comment.c - write comment stuff
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* compress.c - compress filter
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* dearmor.c - Armor utility
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* verify.c - verify signed data
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* delkey.c - delete keys
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* encode.c - encode data
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* encr-data.c - process an encrypted data packet
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* export.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* filter.h
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* free-packet.c - cleanup stuff for packets
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* g10.c - The GnuPG utility (main for gpg)
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
42
g10/getkey.c
42
g10/getkey.c
|
@ -1,14 +1,14 @@
|
|||
/* getkey.c - Get a key from the database
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -160,7 +160,7 @@ cache_public_key( PKT_public_key *pk )
|
|||
if( pk_cache_entries >= MAX_PK_CACHE_ENTRIES ) {
|
||||
/* fixme: use another algorithm to free some cache slots */
|
||||
pk_cache_disabled=1;
|
||||
if( opt.verbose )
|
||||
if( opt.verbose > 1 )
|
||||
log_info(_("too many entries in pk cache - disabled\n"));
|
||||
return;
|
||||
}
|
||||
|
@ -208,6 +208,38 @@ cache_user_id( PKT_user_id *uid, u32 *keyid )
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
getkey_disable_caches()
|
||||
{
|
||||
#if MAX_UNK_CACHE_ENTRIES
|
||||
{
|
||||
keyid_list_t kl, kl2;
|
||||
for( kl = unknown_keyids; kl; kl = kl2 ) {
|
||||
kl2 = kl->next;
|
||||
m_free(kl);
|
||||
}
|
||||
unknown_keyids = NULL;
|
||||
unk_cache_disabled = 1;
|
||||
}
|
||||
#endif
|
||||
#if MAX_PK_CACHE_ENTRIES
|
||||
{
|
||||
pk_cache_entry_t ce, ce2;
|
||||
u32 keyid[2];
|
||||
|
||||
for( ce = pk_cache; ce; ce = ce2 ) {
|
||||
ce2 = ce->next;
|
||||
free_public_key( ce->pk );
|
||||
m_free( ce );
|
||||
}
|
||||
pk_cache_disabled=1;
|
||||
pk_cache_entries = 0;
|
||||
pk_cache = NULL;
|
||||
}
|
||||
#endif
|
||||
/* fixme: disable user id cache ? */
|
||||
}
|
||||
|
||||
|
||||
/****************
|
||||
* Get a public key and store it into the allocated pk
|
||||
|
@ -259,7 +291,7 @@ get_pubkey( PKT_public_key *pk, u32 *keyid )
|
|||
;
|
||||
else if( ++unk_cache_entries > MAX_UNK_CACHE_ENTRIES ) {
|
||||
unk_cache_disabled = 1;
|
||||
if( opt.verbose )
|
||||
if( opt.verbose > 1 )
|
||||
log_info(_("too many entries in unk cache - disabled\n"));
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* ggpd.c - The GNUPG daemon (keyserver)
|
||||
/* ggpd.c - The GnuPG daemon (keyserver)
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -130,6 +130,9 @@ import_keys( const char *fname, int fast )
|
|||
return G10ERR_OPEN_FILE;
|
||||
}
|
||||
|
||||
|
||||
getkey_disable_caches();
|
||||
|
||||
if( !opt.no_armor ) /* armored reading is not disabled */
|
||||
iobuf_push_filter( inp, armor_filter, &afx );
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* kbnode.c - keyblock node utility functions
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* keydb.h - Key database
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -77,6 +77,7 @@ struct keyblock_pos_struct {
|
|||
byte keybuf[21];
|
||||
#endif
|
||||
PACKET *pkt; /* ditto */
|
||||
int valid;
|
||||
};
|
||||
typedef struct keyblock_pos_struct KBPOS;
|
||||
|
||||
|
@ -130,6 +131,7 @@ char *get_last_passphrase(void);
|
|||
/*-- getkey.c --*/
|
||||
int classify_user_id( const char *name, u32 *keyid, byte *fprint,
|
||||
const char **retstr, size_t *retlen );
|
||||
void getkey_disable_caches(void);
|
||||
int get_pubkey( PKT_public_key *pk, u32 *keyid );
|
||||
int get_pubkey_byname( GETKEY_CTX *rx, PKT_public_key *pk,
|
||||
const char *name, KBNODE *ret_keyblock );
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* keyedit.c - keyedit stuff
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* keygen.c - generate a key pair
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* keyid.c - jeyid and fingerprint handling
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* keylist.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* ks-proto.c keyserver protocol handling
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* ks-proto.h
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* main.h
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* mainproc.c - handle packets
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* mdfilter.c - filter data and calculate a message digest
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* misc.c - miscellaneous functions
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* openfile.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* options.h
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -33,7 +33,7 @@ force-v3-sigs
|
|||
# cleartext signatures; all other PGP versions it this way too.
|
||||
# To enable full OpenPGP compliance you have to remove this option.
|
||||
|
||||
escape_from_lines
|
||||
escape-from-lines
|
||||
|
||||
# If you do not use the Latin-1 (ISO-8859-1) charset, you should
|
||||
# tell GnuPG which is the native character set. Please check
|
||||
|
|
23
g10/packet.h
23
g10/packet.h
|
@ -1,14 +1,14 @@
|
|||
/* packet.h - packet read/write stuff
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -27,6 +27,8 @@
|
|||
#include "cipher.h"
|
||||
#include "filter.h"
|
||||
|
||||
#define DEBUG_PARSE_PACKET 1
|
||||
|
||||
typedef enum {
|
||||
PKT_NONE =0,
|
||||
PKT_PUBKEY_ENC =1, /* public key encrypted packet */
|
||||
|
@ -236,11 +238,26 @@ int list_packets( IOBUF a );
|
|||
|
||||
/*-- parse-packet.c --*/
|
||||
int set_packet_list_mode( int mode );
|
||||
|
||||
#if DEBUG_PARSE_PACKET
|
||||
int dbg_search_packet( IOBUF inp, PACKET *pkt, int pkttype, ulong *retpos, const char* file, int lineno );
|
||||
int dbg_parse_packet( IOBUF inp, PACKET *ret_pkt, const char* file, int lineno );
|
||||
int dbg_copy_all_packets( IOBUF inp, IOBUF out, const char* file, int lineno );
|
||||
int dbg_copy_some_packets( IOBUF inp, IOBUF out, ulong stopoff, const char* file, int lineno );
|
||||
int dbg_skip_some_packets( IOBUF inp, unsigned n, const char* file, int lineno );
|
||||
#define search_packet( a,b,c,d ) dbg_search_packet( (a), (b), (c), (d), __FILE__, __LINE__ )
|
||||
#define parse_packet( a, b ) dbg_parse_packet( (a), (b), __FILE__, __LINE__ )
|
||||
#define copy_all_packets( a,b ) dbg_copy_all_packets((a),(b), __FILE__, __LINE__ )
|
||||
#define copy_some_packets( a,b,c ) dbg_copy_some_packets((a),(b),(c), __FILE__, __LINE__ )
|
||||
#define skip_some_packets( a,b ) dbg_skip_some_packets((a),(b), __FILE__, __LINE__ )
|
||||
#else
|
||||
int search_packet( IOBUF inp, PACKET *pkt, int pkttype, ulong *retpos );
|
||||
int parse_packet( IOBUF inp, PACKET *ret_pkt);
|
||||
int copy_all_packets( IOBUF inp, IOBUF out );
|
||||
int copy_some_packets( IOBUF inp, IOBUF out, ulong stopoff );
|
||||
int skip_some_packets( IOBUF inp, unsigned n );
|
||||
#endif
|
||||
|
||||
const byte *parse_sig_subpkt( const byte *buffer,
|
||||
sigsubpkttype_t reqtype, size_t *ret_n );
|
||||
const byte *parse_sig_subpkt2( PKT_signature *sig,
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* parse-packet.c - read packets
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -39,7 +39,11 @@ static int mpi_print_mode = 0;
|
|||
static int list_mode = 0;
|
||||
|
||||
static int parse( IOBUF inp, PACKET *pkt, int reqtype,
|
||||
ulong *retpos, int *skip, IOBUF out, int do_skip );
|
||||
ulong *retpos, int *skip, IOBUF out, int do_skip
|
||||
#ifdef DEBUG_PARSE_PACKET
|
||||
,const char *dbg_w, const char *dbg_f, int dbg_l
|
||||
#endif
|
||||
);
|
||||
static int copy_packet( IOBUF inp, IOBUF out, int pkttype,
|
||||
unsigned long pktlen );
|
||||
static void skip_packet( IOBUF inp, int pkttype, unsigned long pktlen );
|
||||
|
@ -119,6 +123,18 @@ unknown_pubkey_warning( int algo )
|
|||
* Note: The function may return an error and a partly valid packet;
|
||||
* caller must free this packet.
|
||||
*/
|
||||
#ifdef DEBUG_PARSE_PACKET
|
||||
int
|
||||
dbg_parse_packet( IOBUF inp, PACKET *pkt, const char *dbg_f, int dbg_l )
|
||||
{
|
||||
int skip, rc;
|
||||
|
||||
do {
|
||||
rc = parse( inp, pkt, 0, NULL, &skip, NULL, 0, "parse", dbg_f, dbg_l );
|
||||
} while( skip );
|
||||
return rc;
|
||||
}
|
||||
#else
|
||||
int
|
||||
parse_packet( IOBUF inp, PACKET *pkt )
|
||||
{
|
||||
|
@ -129,10 +145,24 @@ parse_packet( IOBUF inp, PACKET *pkt )
|
|||
} while( skip );
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************
|
||||
* Like parse packet, but only return packets of the given type.
|
||||
*/
|
||||
#ifdef DEBUG_PARSE_PACKET
|
||||
int
|
||||
dbg_search_packet( IOBUF inp, PACKET *pkt, int pkttype, ulong *retpos,
|
||||
const char *dbg_f, int dbg_l )
|
||||
{
|
||||
int skip, rc;
|
||||
|
||||
do {
|
||||
rc = parse( inp, pkt, pkttype, retpos, &skip, NULL, 0, "search", dbg_f, dbg_l );
|
||||
} while( skip );
|
||||
return rc;
|
||||
}
|
||||
#else
|
||||
int
|
||||
search_packet( IOBUF inp, PACKET *pkt, int pkttype, ulong *retpos )
|
||||
{
|
||||
|
@ -143,10 +173,24 @@ search_packet( IOBUF inp, PACKET *pkt, int pkttype, ulong *retpos )
|
|||
} while( skip );
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************
|
||||
* Copy all packets from INP to OUT, thereby removing unused spaces.
|
||||
*/
|
||||
#ifdef DEBUG_PARSE_PACKET
|
||||
int
|
||||
dbg_copy_all_packets( IOBUF inp, IOBUF out,
|
||||
const char *dbg_f, int dbg_l )
|
||||
{
|
||||
PACKET pkt;
|
||||
int skip, rc=0;
|
||||
do {
|
||||
init_packet(&pkt);
|
||||
} while( !(rc = parse( inp, &pkt, 0, NULL, &skip, out, 0, "copy", dbg_f, dbg_l )));
|
||||
return rc;
|
||||
}
|
||||
#else
|
||||
int
|
||||
copy_all_packets( IOBUF inp, IOBUF out )
|
||||
{
|
||||
|
@ -157,11 +201,28 @@ copy_all_packets( IOBUF inp, IOBUF out )
|
|||
} while( !(rc = parse( inp, &pkt, 0, NULL, &skip, out, 0 )));
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************
|
||||
* Copy some packets from INP to OUT, thereby removing unused spaces.
|
||||
* Stop at offset STOPoff (i.e. don't copy packets at this or later offsets)
|
||||
*/
|
||||
#ifdef DEBUG_PARSE_PACKET
|
||||
int
|
||||
dbg_copy_some_packets( IOBUF inp, IOBUF out, ulong stopoff,
|
||||
const char *dbg_f, int dbg_l )
|
||||
{
|
||||
PACKET pkt;
|
||||
int skip, rc=0;
|
||||
do {
|
||||
if( iobuf_tell(inp) >= stopoff )
|
||||
return 0;
|
||||
init_packet(&pkt);
|
||||
} while( !(rc = parse( inp, &pkt, 0, NULL, &skip, out, 0,
|
||||
"some", dbg_f, dbg_l )) );
|
||||
return rc;
|
||||
}
|
||||
#else
|
||||
int
|
||||
copy_some_packets( IOBUF inp, IOBUF out, ulong stopoff )
|
||||
{
|
||||
|
@ -174,10 +235,26 @@ copy_some_packets( IOBUF inp, IOBUF out, ulong stopoff )
|
|||
} while( !(rc = parse( inp, &pkt, 0, NULL, &skip, out, 0 )) );
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************
|
||||
* Skip over N packets
|
||||
*/
|
||||
#ifdef DEBUG_PARSE_PACKET
|
||||
int
|
||||
dbg_skip_some_packets( IOBUF inp, unsigned n,
|
||||
const char *dbg_f, int dbg_l )
|
||||
{
|
||||
int skip, rc=0;
|
||||
PACKET pkt;
|
||||
|
||||
for( ;n && !rc; n--) {
|
||||
init_packet(&pkt);
|
||||
rc = parse( inp, &pkt, 0, NULL, &skip, NULL, 1, "skip", dbg_f, dbg_l );
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
#else
|
||||
int
|
||||
skip_some_packets( IOBUF inp, unsigned n )
|
||||
{
|
||||
|
@ -190,7 +267,7 @@ skip_some_packets( IOBUF inp, unsigned n )
|
|||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/****************
|
||||
|
@ -202,7 +279,11 @@ skip_some_packets( IOBUF inp, unsigned n )
|
|||
*/
|
||||
static int
|
||||
parse( IOBUF inp, PACKET *pkt, int reqtype, ulong *retpos,
|
||||
int *skip, IOBUF out, int do_skip )
|
||||
int *skip, IOBUF out, int do_skip
|
||||
#ifdef DEBUG_PARSE_PACKET
|
||||
,const char *dbg_w, const char *dbg_f, int dbg_l
|
||||
#endif
|
||||
)
|
||||
{
|
||||
int rc=0, c, ctb, pkttype, lenbytes;
|
||||
unsigned long pktlen;
|
||||
|
@ -214,6 +295,7 @@ parse( IOBUF inp, PACKET *pkt, int reqtype, ulong *retpos,
|
|||
assert( !pkt->pkt.generic );
|
||||
if( retpos )
|
||||
*retpos = iobuf_tell(inp);
|
||||
|
||||
if( (ctb = iobuf_get(inp)) == -1 ) {
|
||||
rc = -1;
|
||||
goto leave;
|
||||
|
@ -221,7 +303,8 @@ parse( IOBUF inp, PACKET *pkt, int reqtype, ulong *retpos,
|
|||
hdrlen=0;
|
||||
hdr[hdrlen++] = ctb;
|
||||
if( !(ctb & 0x80) ) {
|
||||
log_error("%s: invalid packet (ctb=%02x)\n", iobuf_where(inp), ctb );
|
||||
log_error("%s: invalid packet (ctb=%02x) near %lu\n",
|
||||
iobuf_where(inp), ctb, iobuf_tell(inp) );
|
||||
rc = G10ERR_INVALID_PACKET;
|
||||
goto leave;
|
||||
}
|
||||
|
@ -294,9 +377,16 @@ parse( IOBUF inp, PACKET *pkt, int reqtype, ulong *retpos,
|
|||
goto leave;
|
||||
}
|
||||
|
||||
if( DBG_PACKET )
|
||||
if( DBG_PACKET ) {
|
||||
#ifdef DEBUG_PARSE_PACKET
|
||||
log_debug("parse_packet(iob=%d): type=%d length=%lu%s (%s.%s.%d)\n",
|
||||
iobuf_id(inp), pkttype, pktlen, new_ctb?" (new_ctb)":"",
|
||||
dbg_w, dbg_f, dbg_l );
|
||||
#else
|
||||
log_debug("parse_packet(iob=%d): type=%d length=%lu%s\n",
|
||||
iobuf_id(inp), pkttype, pktlen, new_ctb?" (new_ctb)":"" );
|
||||
#endif
|
||||
}
|
||||
pkt->pkttype = pkttype;
|
||||
rc = G10ERR_UNKNOWN_PACKET; /* default error */
|
||||
switch( pkttype ) {
|
||||
|
@ -384,6 +474,7 @@ copy_packet( IOBUF inp, IOBUF out, int pkttype, unsigned long pktlen )
|
|||
return G10ERR_WRITE_FILE; /* write error */
|
||||
}
|
||||
else if( !pktlen && pkttype == PKT_COMPRESSED ) {
|
||||
log_debug("copy_packet: compressed!\n");
|
||||
/* compressed packet, copy till EOF */
|
||||
while( (n = iobuf_read( inp, buf, 100 )) != -1 )
|
||||
if( iobuf_write(out, buf, n ) )
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* passphrase.c - Get a passphrase
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* pkclist.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -205,6 +205,8 @@ edit_ownertrust( ulong lid, int mode )
|
|||
|
||||
/****************
|
||||
* Try to add some more owner trusts (interactive)
|
||||
* This function presents all the signator in a certificate
|
||||
* chain who have no trust value assigned.
|
||||
* Returns: -1 if no ownertrust were added.
|
||||
*/
|
||||
static int
|
||||
|
@ -232,10 +234,18 @@ _("Could not find a valid trust path to the key. Let's see whether we\n"
|
|||
if( lid == pk->local_id )
|
||||
continue;
|
||||
any=1;
|
||||
if( otrust == TRUST_UNDEFINED || otrust == TRUST_EXPIRED ||
|
||||
otrust == TRUST_UNKNOWN ) {
|
||||
if( changed ) {
|
||||
/* because enum_cert_paths() makes a snapshop of the
|
||||
* trust paths, the otrust and validity are not anymore
|
||||
* valid after changing an entry - we have to reread
|
||||
* those values from then on
|
||||
*/
|
||||
otrust = get_ownertrust( lid );
|
||||
}
|
||||
if( otrust == TRUST_UNDEFINED ) {
|
||||
any_undefined=1;
|
||||
enum_cert_paths_print( &context, NULL, lid );
|
||||
enum_cert_paths_print( &context, NULL, changed, lid );
|
||||
tty_printf("\n");
|
||||
rc = edit_ownertrust( lid, 0 );
|
||||
if( rc == -1 ) {
|
||||
*quit = 1;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* plaintext.c - process an plaintext packet
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* pref.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* pref.h
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* pubkey-enc.c - public key encoded packet handling
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* revoke.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* ringedit.c - Function for key ring editing
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -298,7 +298,7 @@ add_keyblock_resource( const char *url, int force, int secret )
|
|||
else
|
||||
log_info(_("%s: keyring created\n"), filename );
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#if __MINGW32__ || 1
|
||||
/* must close it again */
|
||||
iobuf_close( iobuf );
|
||||
iobuf = NULL;
|
||||
|
@ -687,6 +687,7 @@ enum_keyblocks( int mode, KBPOS *kbpos, KBNODE *ret_root )
|
|||
kbpos->resno = i;
|
||||
rentry = check_pos( kbpos );
|
||||
kbpos->rt = resource_table[i].rt;
|
||||
kbpos->valid = 0;
|
||||
switch( kbpos->rt ) {
|
||||
case rt_RING:
|
||||
kbpos->fp = iobuf_open( rentry->fname );
|
||||
|
@ -860,7 +861,7 @@ update_keyblock( KBPOS *kbpos, KBNODE root )
|
|||
* A string "GnuPG user db", a \n.
|
||||
* user ids of one key, delimited by \t,
|
||||
* a # or ^ followed by a 20 byte fingerprint, followed by an \n
|
||||
* The literal characters =, \n, \t, #, ^ must be replaced by a equal sign
|
||||
* The literal characters %, \n, \t, #, ^ must be replaced by a percent sign
|
||||
* and their hex value.
|
||||
*
|
||||
* (We use Boyer/Moore pattern matching)
|
||||
|
@ -1019,8 +1020,9 @@ keyring_search( PACKET *req, KBPOS *kbpos, IOBUF iobuf, const char *fname )
|
|||
init_packet(&pkt);
|
||||
save_mode = set_packet_list_mode(0);
|
||||
kbpos->rt = rt_RING;
|
||||
kbpos->valid = 0;
|
||||
|
||||
#if __MINGW32__
|
||||
#if __MINGW32__ || 1
|
||||
assert(!iobuf);
|
||||
iobuf = iobuf_open( fname );
|
||||
if( !iobuf ) {
|
||||
|
@ -1057,13 +1059,15 @@ keyring_search( PACKET *req, KBPOS *kbpos, IOBUF iobuf, const char *fname )
|
|||
BUG();
|
||||
free_packet(&pkt);
|
||||
}
|
||||
if( !rc )
|
||||
if( !rc ) {
|
||||
kbpos->offset = offset;
|
||||
kbpos->valid = 1;
|
||||
}
|
||||
|
||||
leave:
|
||||
free_packet(&pkt);
|
||||
set_packet_list_mode(save_mode);
|
||||
#if __MINGW32__
|
||||
#if __MINGW32__ || 1
|
||||
iobuf_close(iobuf);
|
||||
#endif
|
||||
return rc;
|
||||
|
@ -1089,6 +1093,8 @@ keyring_read( KBPOS *kbpos, KBNODE *ret_root )
|
|||
return G10ERR_OPEN_FILE;
|
||||
}
|
||||
|
||||
if( !kbpos->valid )
|
||||
log_debug("kbpos not valid in keyring_read, want %d\n", (int)kbpos->offset );
|
||||
if( iobuf_seek( a, kbpos->offset ) ) {
|
||||
log_error("can't seek to %lu\n", kbpos->offset);
|
||||
iobuf_close(a);
|
||||
|
@ -1112,6 +1118,12 @@ keyring_read( KBPOS *kbpos, KBNODE *ret_root )
|
|||
}
|
||||
/* make a linked list of all packets */
|
||||
switch( pkt->pkttype ) {
|
||||
case PKT_COMPRESSED:
|
||||
log_error("skipped compressed packet in keyring\n" );
|
||||
free_packet(pkt);
|
||||
init_packet(pkt);
|
||||
break;
|
||||
|
||||
case PKT_PUBLIC_KEY:
|
||||
case PKT_SECRET_KEY:
|
||||
if( in_cert )
|
||||
|
@ -1129,6 +1141,7 @@ keyring_read( KBPOS *kbpos, KBNODE *ret_root )
|
|||
}
|
||||
}
|
||||
ready:
|
||||
kbpos->valid = 0;
|
||||
if( rc == -1 && root )
|
||||
rc = 0;
|
||||
|
||||
|
@ -1174,6 +1187,12 @@ keyring_enum( KBPOS *kbpos, KBNODE *ret_root, int skipsigs )
|
|||
}
|
||||
/* make a linked list of all packets */
|
||||
switch( pkt->pkttype ) {
|
||||
case PKT_COMPRESSED:
|
||||
log_error("skipped compressed packet in keyring\n" );
|
||||
free_packet(pkt);
|
||||
init_packet(pkt);
|
||||
break;
|
||||
|
||||
case PKT_PUBLIC_KEY:
|
||||
case PKT_SECRET_KEY:
|
||||
if( root ) { /* store this packet */
|
||||
|
@ -1387,6 +1406,7 @@ keyring_copy( KBPOS *kbpos, int mode, KBNODE root )
|
|||
goto leave;
|
||||
}
|
||||
}
|
||||
kbpos->valid = 0;
|
||||
}
|
||||
|
||||
if( mode == 2 || mode == 3 ) { /* delete or update */
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* seckey-cert.c - secret key certifucate packet handling
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* seskey.c - make sesssion keys etc.
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* sig-check.c - Check a signature
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* sign.c - sign data
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* signal.c - signal handling
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* skclist.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* status.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* status.h
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* tdbio.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* tdbio.h - Trust database I/O functions
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* textfilter.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* trustdb.c
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -1750,7 +1750,8 @@ enum_cert_paths( void **context, ulong *lid,
|
|||
* Print the current path
|
||||
*/
|
||||
int
|
||||
enum_cert_paths_print( void **context, FILE *fp, ulong selected_lid )
|
||||
enum_cert_paths_print( void **context, FILE *fp,
|
||||
int refresh, ulong selected_lid )
|
||||
{
|
||||
struct enum_cert_paths_ctx *ctx;
|
||||
TRUST_SEG_LIST tsl;
|
||||
|
@ -1760,11 +1761,32 @@ enum_cert_paths_print( void **context, FILE *fp, ulong selected_lid )
|
|||
ctx = *context;
|
||||
if( !ctx->tsl )
|
||||
return;
|
||||
tsl = ctx->tsl;
|
||||
|
||||
if( !fp )
|
||||
fp = stderr;
|
||||
|
||||
print_path( ctx->tsl->pathlen, ctx->tsl->path, fp, selected_lid );
|
||||
if( refresh ) { /* update the ownertrust and if possible the validity */
|
||||
int i;
|
||||
int match = tdbio_db_matches_options();
|
||||
|
||||
for( i = 0; i < tsl->pathlen; i++ ) {
|
||||
TRUSTREC rec;
|
||||
|
||||
read_record( tsl->path[i].lid, &rec, RECTYPE_DIR );
|
||||
tsl->path[i].otrust = rec.r.dir.ownertrust;
|
||||
/* update validity only if we have it in the cache
|
||||
* calculation is too time consuming */
|
||||
if( match && (rec.r.dir.dirflags & DIRF_VALVALID)
|
||||
&& rec.r.dir.validity ) {
|
||||
tsl->path[i].trust = rec.r.dir.validity;
|
||||
if( rec.r.dir.dirflags & DIRF_REVOKED )
|
||||
tsl->path[i].trust = TRUST_FLAG_REVOKED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print_path( tsl->pathlen, tsl->path, fp, selected_lid );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* trustdb.h - Trust database
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -53,7 +53,8 @@ int check_trust( PKT_public_key *pk, unsigned *r_trustlevel );
|
|||
int query_trust_info( PKT_public_key *pk );
|
||||
int enum_cert_paths( void **context, ulong *lid,
|
||||
unsigned *ownertrust, unsigned *validity );
|
||||
int enum_cert_paths_print( void **context, FILE *fp, ulong selected_lid );
|
||||
int enum_cert_paths_print( void **context, FILE *fp,
|
||||
int refresh, ulong selected_lid );
|
||||
unsigned get_ownertrust( ulong lid );
|
||||
int get_ownertrust_info( ulong lid );
|
||||
byte *get_pref_data( ulong lid, const byte *namehash, size_t *ret_n );
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* verify.c - verify signed data
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNUPG.
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
* GNUPG is free software; you can redistribute it and/or modify
|
||||
* GnuPG is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNUPG is distributed in the hope that it will be useful,
|
||||
* GnuPG is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue