mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Screen keyserver responses.
* g10/main.h (import_filter_t): New. * g10/import.c (import): Add filter callbacks to param list. (import_one): Ditto. (import_secret_one): Ditto. (import_keys_internal): Ditto. (import_keys_stream): Ditto. * g10/keyserver.c (keyserver_retrieval_filter): New. (keyserver_spawn): Pass filter to import_keys_stream() -- These changes introduces import functions that apply a constraining filter to imported keys. These filters can verify the fingerprints of the keys returned before importing them into the keyring, ensuring that the keys fetched from the keyserver are in fact those selected by the user beforehand. Signed-off-by: Stefan Tomanek <tomanek@internet-sicherheit.de> Re-indention and minor changes by wk. Resolved conflicts: g10/import.c g10/keyserver.c g10/main.h
This commit is contained in:
parent
e790671cb3
commit
5e933008be
3 changed files with 164 additions and 80 deletions
|
@ -260,11 +260,16 @@ gcry_mpi_t encode_md_value( PKT_public_key *pk, PKT_secret_key *sk,
|
|||
gcry_md_hd_t md, int hash_algo );
|
||||
|
||||
/*-- import.c --*/
|
||||
|
||||
typedef int (*import_filter_t)(PKT_public_key *pk, PKT_secret_key *sk,
|
||||
void *arg);
|
||||
|
||||
int parse_import_options(char *str,unsigned int *options,int noisy);
|
||||
void import_keys( char **fnames, int nnames,
|
||||
void *stats_hd, unsigned int options );
|
||||
int import_keys_stream( iobuf_t inp,void *stats_hd,unsigned char **fpr,
|
||||
size_t *fpr_len,unsigned int options );
|
||||
int import_keys_stream (iobuf_t inp, void *stats_hd, unsigned char **fpr,
|
||||
size_t *fpr_len, unsigned int options,
|
||||
import_filter_t filter, void *filter_arg);
|
||||
void *import_new_stats_handle (void);
|
||||
void import_release_stats_handle (void *p);
|
||||
void import_print_stats (void *hd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue