]> andersk Git - openssh.git/blobdiff - mac.c
- (dtucker) [session.c openbsd-compat/bsd-cygwin_util.h] Move Cygwin
[openssh.git] / mac.c
diff --git a/mac.c b/mac.c
index 3ff107c8a6400277981836f9794065a871877c94..ab9a03d84e867379aa8386d9b1b4a137c9f14293 100644 (file)
--- a/mac.c
+++ b/mac.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: mac.c,v 1.1 2001/02/11 12:59:24 markus Exp $");
+RCSID("$OpenBSD: mac.c,v 1.5 2002/05/16 22:02:50 markus Exp $");
 
 #include <openssl/hmac.h>
 
@@ -36,7 +36,7 @@ RCSID("$OpenBSD: mac.c,v 1.1 2001/02/11 12:59:24 markus Exp $");
 
 struct {
        char            *name;
-       EVP_MD *        (*mdfunc)(void);
+       const EVP_MD *  (*mdfunc)(void);
        int             truncatebits;   /* truncate digest if != 0 */
 } macs[] = {
        { "hmac-sha1",                  EVP_sha1, 0, },
@@ -45,7 +45,7 @@ struct {
        { "hmac-md5-96",                EVP_md5, 96 },
        { "hmac-ripemd160",             EVP_ripemd160, 0 },
        { "hmac-ripemd160@openssh.com", EVP_ripemd160, 0 },
-        { NULL,                                NULL, 0 }
+       { NULL,                         NULL, 0 }
 };
 
 int
@@ -56,7 +56,7 @@ mac_init(Mac *mac, char *name)
                if (strcmp(name, macs[i].name) == 0) {
                        if (mac != NULL) {
                                mac->md = (*macs[i].mdfunc)();
-                               mac->key_len = mac->mac_len = mac->md->md_size;
+                               mac->key_len = mac->mac_len = EVP_MD_size(mac->md);
                                if (macs[i].truncatebits != 0)
                                        mac->mac_len = macs[i].truncatebits/8;
                        }
@@ -99,7 +99,7 @@ mac_valid(const char *names)
                return (0);
        maclist = cp = xstrdup(names);
        for ((p = strsep(&cp, MAC_SEP)); p && *p != '\0';
-            (p = strsep(&cp, MAC_SEP))) {
+           (p = strsep(&cp, MAC_SEP))) {
                if (mac_init(NULL, p) < 0) {
                        debug("bad mac %s [%s]", p, names);
                        xfree(maclist);
This page took 0.495138 seconds and 4 git commands to generate.