summaryrefslogtreecommitdiffstats
path: root/g10/packet.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2017-03-31 20:03:52 +0200
committerWerner Koch <wk@gnupg.org>2017-03-31 20:07:20 +0200
commit8f2671d2cc022af2f564e296bdeb3bb2d2734ef4 (patch)
tree0a5dfac0bb36cf364e313b000967863e42783793 /g10/packet.h
parentgpg: Consistent use of preprocessor conditionals. (diff)
downloadgnupg2-8f2671d2cc022af2f564e296bdeb3bb2d2734ef4.tar.xz
gnupg2-8f2671d2cc022af2f564e296bdeb3bb2d2734ef4.zip
gpg: Pass CTRL to many more functions.
-- For proper operations as a server we need to avoid global variables. Thus we need to pass the session state CTRL to most functions. Quite a lot of changes but fortunately straightforward to do. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/packet.h')
-rw-r--r--g10/packet.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/g10/packet.h b/g10/packet.h
index f5f22b695..3cb1e3b48 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -428,7 +428,7 @@ typedef struct
there is no disable value cached, fill one in. */
#define pk_is_disabled(a) \
(((a)->flags.disabled_valid)? \
- ((a)->flags.disabled):(cache_disabled_value((a))))
+ ((a)->flags.disabled):(cache_disabled_value(ctrl,(a))))
typedef struct {
@@ -853,14 +853,15 @@ int cmp_user_ids( PKT_user_id *a, PKT_user_id *b );
/*-- sig-check.c --*/
/* Check a signature. This is shorthand for check_signature2 with
the unnamed arguments passed as NULL. */
-int check_signature (PKT_signature *sig, gcry_md_hd_t digest);
+int check_signature (ctrl_t ctrl, PKT_signature *sig, gcry_md_hd_t digest);
/* Check a signature. Looks up the public key from the key db. (If
* R_PK is not NULL, it is stored at RET_PK.) DIGEST contains a
* valid hash context that already includes the signed data. This
* function adds the relevant meta-data to the hash before finalizing
* it and verifying the signature. */
-gpg_error_t check_signature2 (PKT_signature *sig, gcry_md_hd_t digest,
+gpg_error_t check_signature2 (ctrl_t ctrl,
+ PKT_signature *sig, gcry_md_hd_t digest,
u32 *r_expiredate, int *r_expired, int *r_revoked,
PKT_public_key **r_pk);
@@ -885,14 +886,16 @@ int ask_for_detached_datafile( gcry_md_hd_t md, gcry_md_hd_t md2,
const char *inname, int textmode );
/*-- sign.c --*/
-int make_keysig_packet( PKT_signature **ret_sig, PKT_public_key *pk,
+int make_keysig_packet (ctrl_t ctrl,
+ PKT_signature **ret_sig, PKT_public_key *pk,
PKT_user_id *uid, PKT_public_key *subpk,
PKT_public_key *pksk, int sigclass, int digest_algo,
u32 timestamp, u32 duration,
int (*mksubpkt)(PKT_signature *, void *),
void *opaque,
const char *cache_nonce);
-gpg_error_t update_keysig_packet (PKT_signature **ret_sig,
+gpg_error_t update_keysig_packet (ctrl_t ctrl,
+ PKT_signature **ret_sig,
PKT_signature *orig_sig,
PKT_public_key *pk,
PKT_user_id *uid,