From: Junio C Hamano <gitster@pobox•com>
To: Stefan Beller <stefanbeller@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH v2 19/19] signed push: fortify against replay attacks
Date: Tue, 02 Sep 2014 10:40:53 -0700 [thread overview]
Message-ID: <xmqq8um13opm.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <5401BCA5.70502@gmail.com> (Stefan Beller's message of "Sat, 30 Aug 2014 13:59:33 +0200")
Stefan Beller <stefanbeller@gmail•com> writes:
> On 22.08.2014 22:30, Junio C Hamano wrote:
>> @@ -1226,12 +1232,28 @@ static int delete_only(struct command *commands)
>> return 1;
>> }
>>
>> +static char *prepare_push_cert_nonce(const char *sitename, const char *dir)
>> +{
>> + struct strbuf buf = STRBUF_INIT;
>> + unsigned char sha1[20];
>> +
>> + if (!sitename) {
>> + static char buf[1024];
>> + gethostname(buf, sizeof(buf));
>> + sitename = buf;
>> + }
>> + strbuf_addf(&buf, "%s:%s:%lu", sitename, dir, time(NULL));
>> + hash_sha1_file(buf.buf, buf.len, "blob", sha1);
>> + return xstrdup(sha1_to_hex(sha1));
>> +}
>> +
>
> On every other use of gethostname within git.git we're
> checking the return code. And if gethostname fails, we're
> either copying in 'localhost' or 'unknown' instead.
>
> Does that make sense here as well?
It does, but I think this code will have to change quite a lot
before it gets ready even for 'next'.
Thanks.
prev parent reply other threads:[~2014-09-02 17:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 20:30 [PATCH v2 00/19] Signed push Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 01/19] receive-pack: do not overallocate command structure Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 02/19] receive-pack: parse feature request a bit earlier Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 03/19] receive-pack: do not reuse old_sha1[] for other things Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 04/19] receive-pack: factor out queueing of command Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 05/19] send-pack: move REF_STATUS_REJECT_NODELETE logic a bit higher Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 06/19] send-pack: refactor decision to send update per ref Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 07/19] send-pack: always send capabilities Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 08/19] send-pack: factor out capability string generation Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 09/19] send-pack: rename "new_refs" to "need_pack_data" Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 10/19] send-pack: refactor inspecting and resetting status and sending commands Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 11/19] send-pack: clarify that cmds_sent is a boolean Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 12/19] gpg-interface: move parse_gpg_output() to where it should be Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 13/19] gpg-interface: move parse_signature() " Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 14/19] pack-protocol doc: typofix for PKT-LINE Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 15/19] the beginning of the signed push Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 16/19] receive-pack: GPG-validate push certificates Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 17/19] send-pack: send feature request on push-cert packet Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 18/19] signed push: remove duplicated protocol info Junio C Hamano
2014-08-22 20:30 ` [PATCH v2 19/19] signed push: fortify against replay attacks Junio C Hamano
2014-08-24 3:29 ` Eric Sunshine
2014-08-30 11:59 ` Stefan Beller
2014-09-02 17:40 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq8um13opm.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=stefanbeller@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox