]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/hmac.c
Fix header file includes.
[bacula/bacula] / bacula / src / lib / hmac.c
index 40432aa51e006e7dc8081f3e8d8f9691e783c0e9..7dade4c1367feeecefad52c8ce4769eadc913cca 100644 (file)
@@ -2,35 +2,35 @@
  *  Hashed Message Authentication Code using MD5 (HMAC-MD5)
  *
  * hmac_md5 was based on sample code in RFC2104 (thanks guys).
- * 
+ *
  * Adapted to Bacula by Kern E. Sibbald, February MMI.
  *
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
    MA 02111-1307, USA.
 
  */
 
 #include "bacula.h"
 
-#define PAD_LEN 64                   /* PAD length */
-#define SIG_LEN 16                   /* MD5 signature length */
+#define PAD_LEN 64           /* PAD length */
+#define SIG_LEN MD5HashSize  /* MD5 digest length */
 
 void
 hmac_md5(
@@ -73,7 +73,7 @@ hmac_md5(
    /* Zero pads and store key */
    memset(k_ipad, 0, PAD_LEN);
    memcpy(k_ipad, key, key_len);
-   memcpy(k_opad, k_ipad, PAD_LEN); 
+   memcpy(k_opad, k_ipad, PAD_LEN);
 
    /* XOR key with ipad and opad values */
    for (i=0; i<PAD_LEN; i++) {