Skip to content

Commit

Permalink
Remove --disable-signers-uid and all support for signer's uid.
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdafu committed Jul 2, 2018
1 parent 1fe5046 commit b8ae7aa
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 59 deletions.
3 changes: 0 additions & 3 deletions legacy/gnupg/g10/free-packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ void free_seckey_enc(PKT_signature *sig) {
xfree(sig->hashed);
xfree(sig->unhashed);

xfree(sig->signers_uid);

xfree(sig);
}

Expand Down Expand Up @@ -170,7 +168,6 @@ PKT_signature *copy_signature(PKT_signature *d, PKT_signature *s) {
}
d->hashed = cp_subpktarea(s->hashed);
d->unhashed = cp_subpktarea(s->unhashed);
if (s->signers_uid) d->signers_uid = xstrdup(s->signers_uid);
if (s->numrevkeys) {
d->revkey = NULL;
d->numrevkeys = 0;
Expand Down
4 changes: 0 additions & 4 deletions legacy/gnupg/g10/gpg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1983,10 +1983,6 @@ int gpg_main(int argc, char **argv) {
opt.throw_keyids = false;
break;

case oDisableSignerUID:
opt.flags.disable_signer_uid = true;
break;

case oS2KMode:
opt.s2k_mode = pargs.r.ret_int;
break;
Expand Down
10 changes: 1 addition & 9 deletions legacy/gnupg/g10/mainproc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1421,11 +1421,7 @@ static int check_sig_and_print(CTX c, kbnode_t node) {
}
}

if (sig->signers_uid)
write_status_buffer(STATUS_NEWSIG, sig->signers_uid,
strlen(sig->signers_uid), 0);
else
write_status_text(STATUS_NEWSIG, NULL);
write_status_text(STATUS_NEWSIG, NULL);

astr = openpgp_pk_algo_name((pubkey_algo_t)(sig->pubkey_algo));
if ((issuer_fpr = issuer_fpr_string(sig))) {
Expand All @@ -1443,10 +1439,6 @@ static int check_sig_and_print(CTX c, kbnode_t node) {
asctimestamp(sig->timestamp), astr ? astr : "?",
keystr(sig->keyid));

/* In verbose mode print the signers UID. */
if (sig->signers_uid)
log_info(_(" issuer \"%s\"\n"), sig->signers_uid);

rc = do_check_sig(c, node, NULL, &is_expkey, &is_revkey, &pk);

/* If the above methods didn't work, our next try is to locate
Expand Down
1 change: 0 additions & 1 deletion legacy/gnupg/g10/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ struct options {
bool utf8_filename{false};
bool dsa2{false};
bool large_rsa{false};
bool disable_signer_uid{false};
/* Flag to enbale experimental features from RFC4880bis. */
bool rfc4880bis{false};
} flags;
Expand Down
3 changes: 0 additions & 3 deletions legacy/gnupg/g10/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ typedef struct {
const byte *trust_regexp;
struct revocation_key *revkey;
int numrevkeys;
char *signers_uid; /* Malloced value of the SIGNERS_UID
* subpacket or NULL. This string has
* already been sanitized. */
subpktarea_t *hashed; /* All subpackets with hashed data (v4 only). */
subpktarea_t *unhashed; /* Ditto for unhashed data. */
/* First 2 bytes of the digest. (Serialized. Note: this is not
Expand Down
12 changes: 0 additions & 12 deletions legacy/gnupg/g10/parse-packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,9 +1271,6 @@ static void dump_sig_subpkt(int hashed, int type, int critical,
for (i = 0; i < length; i++)
*listfp << ' ' << Botan::hex_encode(&buffer[i], 1);
break;
case SIGSUBPKT_SIGNERS_UID:
p = "signer's user ID";
break;
case SIGSUBPKT_REVOC_REASON:
if (length) {
*listfp << boost::format("revocation reason 0x%02x (") % *buffer;
Expand Down Expand Up @@ -1702,15 +1699,6 @@ int parse_signature(IOBUF inp, int pkttype, unsigned long pktlen,
p = parse_sig_subpkt(sig->hashed, SIGSUBPKT_POLICY, NULL);
if (p) sig->flags.policy_url = 1;

p = parse_sig_subpkt(sig->hashed, SIGSUBPKT_SIGNERS_UID, &len);
if (p && len) {
sig->signers_uid = try_make_printable_string(p, len, 0);
if (!sig->signers_uid) {
rc = gpg_error_from_syserror();
goto leave;
}
}

p = parse_sig_subpkt(sig->hashed, SIGSUBPKT_NOTATION, NULL);
if (p) sig->flags.notation = 1;

Expand Down
27 changes: 0 additions & 27 deletions legacy/gnupg/g10/sign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,33 +119,6 @@ static void mk_notation_policy_etc(PKT_signature *sig, PKT_public_key *pk,
xfree(p);
}
}

/* Set signer's user id. */
if (IS_SIG(sig) && !opt.flags.disable_signer_uid) {
char *mbox;

/* For now we use the uid which was used to locate the key. */
if (pksk->user_id && (mbox = mailbox_from_userid(pksk->user_id->name))) {
if (DBG_LOOKUP) log_debug("setting Signer's UID to '%s'\n", mbox);
build_sig_subpkt(sig, SIGSUBPKT_SIGNERS_UID, (const byte *)(mbox),
strlen(mbox));
xfree(mbox);
} else if (!opt.sender_list.empty()) {
/* If a list of --sender was given we scan that list and use
* the first one matching a user id of the current key. */

/* FIXME: We need to get the list of user ids for the PKSK
* packet. That requires either a function to look it up
* again or we need to extend the key packet struct to link
* to the primary key which in turn could link to the user
* ids. Too much of a change right now. Let's take just
* one from the supplied list and hope that the caller
* passed a matching one. */
const std::string &sender{opt.sender_list[0]};
build_sig_subpkt(sig, SIGSUBPKT_SIGNERS_UID, (const byte *)sender.c_str(),
sender.length());
}
}
}

/*
Expand Down

0 comments on commit b8ae7aa

Please sign in to comment.