Skip to content

Commit 6fc7de1

Browse files
committed
Merge branch 'hs/push-cert-check-cleanup'
Code clean-up. * hs/push-cert-check-cleanup: gpg-interface: make parse_gpg_output static and remove from interface header builtin/receive-pack: use check_signature from gpg-interface
2 parents d94cecf + fbd0f16 commit 6fc7de1

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

builtin/receive-pack.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,6 @@ static void prepare_push_cert_sha1(struct child_process *proc)
630630
return;
631631

632632
if (!already_done) {
633-
struct strbuf gpg_output = STRBUF_INIT;
634-
struct strbuf gpg_status = STRBUF_INIT;
635633
int bogs /* beginning_of_gpg_sig */;
636634

637635
already_done = 1;
@@ -640,22 +638,11 @@ static void prepare_push_cert_sha1(struct child_process *proc)
640638
oidclr(&push_cert_oid);
641639

642640
memset(&sigcheck, '\0', sizeof(sigcheck));
643-
sigcheck.result = 'N';
644641

645642
bogs = parse_signature(push_cert.buf, push_cert.len);
646-
if (verify_signed_buffer(push_cert.buf, bogs,
647-
push_cert.buf + bogs, push_cert.len - bogs,
648-
&gpg_output, &gpg_status) < 0) {
649-
; /* error running gpg */
650-
} else {
651-
sigcheck.payload = push_cert.buf;
652-
sigcheck.gpg_output = gpg_output.buf;
653-
sigcheck.gpg_status = gpg_status.buf;
654-
parse_gpg_output(&sigcheck);
655-
}
643+
check_signature(push_cert.buf, bogs, push_cert.buf + bogs,
644+
push_cert.len - bogs, &sigcheck);
656645

657-
strbuf_release(&gpg_output);
658-
strbuf_release(&gpg_status);
659646
nonce_status = check_nonce(push_cert.buf, bogs);
660647
}
661648
if (!is_null_oid(&push_cert_oid)) {

gpg-interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static struct {
3535
{ 'R', "\n[GNUPG:] REVKEYSIG "},
3636
};
3737

38-
void parse_gpg_output(struct signature_check *sigc)
38+
static void parse_gpg_output(struct signature_check *sigc)
3939
{
4040
const char *buf = sigc->gpg_status;
4141
int i;

gpg-interface.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ void signature_check_clear(struct signature_check *sigc);
3333
*/
3434
size_t parse_signature(const char *buf, size_t size);
3535

36-
void parse_gpg_output(struct signature_check *);
37-
3836
/*
3937
* Create a detached signature for the contents of "buffer" and append
4038
* it after "signature"; "buffer" and "signature" can be the same

0 commit comments

Comments
 (0)