Re: [PATCH v4 1/2] git-imap-send: Add CRAM-MD5 authenticate method support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Friday, February 12, 2010 - 2:44 pm

Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> writes:


I actually meant that the comment regarding the history of patch
iterations should go after the three-dash.  Most notably, we want your
S-o-b in the commit log.  That is:

----------------------------------------------------------------
	Subject: well thought out summary of what the patch is about

	Problem description, and rationale to justify the particular
        solution you chose.

        Signed-off-by: Your Name <your@address.example.com>
	---

	 Comments that may help the reviewers while the patch is
         going through the review cycle, but would not be useful
         after this particular version is applied and the commit
         is shown in "git log" output

	 diffstat

         diff --git ... patch text ...
----------------------------------------------------------------


Just a style thing but

	/*
         * We prefer to write our multi-line
         * comments like this.
         */


Why not xmalloc()?  Does EVP_DecodeBlock() want a zero-filled buffer?


Does EVP_DecodeBlock diagnose an error in the input and return an error
code?  How are you supposed to protect yourself from the server giving you
a corrupt challenge that does not decode properly?

By the way, this is probably easier to the eye if you split it into two
lines:

	EVP_DecodeBlock((unsigned char *)challenge,
			(unsigned char *)challenge_64, strlen(challenge_64));


Is there any clean-up necessary after you are done with hmac?  EVP_md5()
returns a pointer to EVP_MD but how and when is that resource released?

By the way, HMAC_Init() seems to be deprecated and kept only for 0.9.6b
compatibility.

    http://www.openssl.org/docs/crypto/hmac.html


Why not xmalloc()?  Does EVP_EncodeBlock() want a zero-filled buffer?


I wouldn't worry too much about error response from this function as I
would for EVP_DecodeBlock() I mentioned earlier.

By the way, I made a couple of small fix-ups to your [2/2] (I think they
were just style and unnecessary use of xcalloc()) and queued.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
imap.preformattedHTML and imap.sslverify, Junio C Hamano, (Sat Feb 6, 12:26 pm)
Re: imap.preformattedHTML and imap.sslverify, Jeremy White, (Mon Feb 8, 3:31 pm)
Re: imap.preformattedHTML and imap.sslverify, Junio C Hamano, (Mon Feb 8, 4:05 pm)
[PATCH 0/4] Some improvements for git-imap-send, Hitoshi Mitake, (Tue Feb 9, 5:09 am)
[PATCH 1/4] Add base64 encoder and decoder, Hitoshi Mitake, (Tue Feb 9, 5:09 am)
[PATCH 2/4] Add stuffs for MD5 hash algorithm, Hitoshi Mitake, (Tue Feb 9, 5:09 am)
[PATCH 3/4] git-imap-send: Implement CRAM-MD5 auth method, Hitoshi Mitake, (Tue Feb 9, 5:09 am)
Re: [PATCH 1/4] Add base64 encoder and decoder, Erik Faye-Lund, (Tue Feb 9, 7:45 am)
Re: [PATCH 0/4] Some improvements for git-imap-send, Erik Faye-Lund, (Tue Feb 9, 8:13 am)
Re: [PATCH 0/4] Some improvements for git-imap-send, Erik Faye-Lund, (Tue Feb 9, 11:37 am)
Re: [PATCH 0/4] Some improvements for git-imap-send, Jeff King, (Tue Feb 9, 11:54 am)
Re: [PATCH 1/4] Add base64 encoder and decoder, Hitoshi Mitake, (Thu Feb 11, 7:37 am)
Re: [PATCH v4 1/2] git-imap-send: Add CRAM-MD5 authenticat ..., Junio C Hamano, (Fri Feb 12, 2:44 pm)