masqmail

diff src/md5/hmac_md5.c @ 367:b27f66555ba8

Reformated multiline comments to have leading asterisks on each line Now we use: /* ** comment */ This makes the indent style simpler, too.
author markus schnalke <meillo@marmaro.de>
date Thu, 20 Oct 2011 10:20:59 +0200
parents 41958685480d
children
line diff
     1.1 --- a/src/md5/hmac_md5.c	Thu Sep 22 15:07:40 2011 +0200
     1.2 +++ b/src/md5/hmac_md5.c	Thu Oct 20 10:20:59 2011 +0200
     1.3 @@ -1,30 +1,30 @@
     1.4  /*
     1.5 -hmac_md5 -- implements RFC 2104
     1.6 -
     1.7 -Copyright 2010, markus schnalke <meillo@marmaro.de>
     1.8 -
     1.9 -Permission to use, copy, modify, and/or distribute this software for any
    1.10 -purpose with or without fee is hereby granted, provided that the above
    1.11 -copyright notice and this permission notice appear in all copies.
    1.12 -
    1.13 -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    1.14 -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    1.15 -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    1.16 -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    1.17 -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    1.18 -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    1.19 -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    1.20 -
    1.21 -
    1.22 -My motivation to write this code was the lack of a nicely licensed
    1.23 -hmac_md5 function in C. I programmed it following the RFC's text.
    1.24 -Obviously this code is highly similar to the sample code of the RFC.
    1.25 -The code is tested against the test vectors of the RFC. Wikipedia's
    1.26 -HMAC page helped me to understand the algorithm better.
    1.27 -
    1.28 -This hmac_md5 function requires an OpenSSL-compatible MD5
    1.29 -implementation. There are Public Domain MD5 implementations by Colin
    1.30 -Plumb and by Solar Designer. You probably want to use one of these.
    1.31 +**  hmac_md5 -- implements RFC 2104
    1.32 +**  
    1.33 +**  Copyright 2010, markus schnalke <meillo@marmaro.de>
    1.34 +**  
    1.35 +**  Permission to use, copy, modify, and/or distribute this software for any
    1.36 +**  purpose with or without fee is hereby granted, provided that the above
    1.37 +**  copyright notice and this permission notice appear in all copies.
    1.38 +**  
    1.39 +**  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    1.40 +**  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    1.41 +**  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    1.42 +**  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    1.43 +**  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    1.44 +**  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    1.45 +**  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    1.46 +**  
    1.47 +**  
    1.48 +**  My motivation to write this code was the lack of a nicely licensed
    1.49 +**  hmac_md5 function in C. I programmed it following the RFC's text.
    1.50 +**  Obviously this code is highly similar to the sample code of the RFC.
    1.51 +**  The code is tested against the test vectors of the RFC. Wikipedia's
    1.52 +**  HMAC page helped me to understand the algorithm better.
    1.53 +**  
    1.54 +**  This hmac_md5 function requires an OpenSSL-compatible MD5
    1.55 +**  implementation. There are Public Domain MD5 implementations by Colin
    1.56 +**  Plumb and by Solar Designer. You probably want to use one of these.
    1.57  */
    1.58  
    1.59  #include <string.h>
    1.60 @@ -36,11 +36,12 @@
    1.61  
    1.62  
    1.63  /*
    1.64 -The computed HMAC will be written to `digest'.
    1.65 -Ensure digest points to hashsize bytes of allocated memory.
    1.66 +**  The computed HMAC will be written to `digest'.
    1.67 +**  Ensure digest points to hashsize bytes of allocated memory.
    1.68  */
    1.69  void
    1.70 -hmac_md5(unsigned char *text, int textlen, unsigned char *key, int keylen, unsigned char *digest)
    1.71 +hmac_md5(unsigned char *text, int textlen, unsigned char *key, int keylen,
    1.72 +		unsigned char *digest)
    1.73  {
    1.74  	int i;
    1.75  	MD5_CTX context;