diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2024-07-18 02:45:32 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2024-07-18 02:45:32 +0000 |
commit | b4e9a4efb2771d46586e7f10f8fbb189d1a2ae51 (patch) | |
tree | 2fbaf1f01ce5581db2973caa632272ac225eb07c /libexec/login_radius | |
parent | b4485e158b5f8b0272187596797dc1744d4479f7 (diff) |
Since libcrypto is used to calc message authenticator, use libcrypto
md5 also in other places instead libc md5.
ok millert
Diffstat (limited to 'libexec/login_radius')
-rw-r--r-- | libexec/login_radius/raddauth.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libexec/login_radius/raddauth.c b/libexec/login_radius/raddauth.c index 7f55886251e..6625203dd19 100644 --- a/libexec/login_radius/raddauth.c +++ b/libexec/login_radius/raddauth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raddauth.c,v 1.32 2024/07/17 20:50:28 yasuoka Exp $ */ +/* $OpenBSD: raddauth.c,v 1.33 2024/07/18 02:45:31 yasuoka Exp $ */ /*- * Copyright (c) 1996, 1997 Berkeley Software Design, Inc. All rights reserved. @@ -84,9 +84,9 @@ #include <syslog.h> #include <time.h> #include <unistd.h> -#include <md5.h> #include <readpassphrase.h> #include <openssl/hmac.h> +#include <openssl/md5.h> #include "login_radius.h" @@ -403,9 +403,9 @@ rad_request(u_char id, char *name, char *password, int port, char *vector, /* XOR the password into the md5 digest */ pw = pass_buf; while (p-- > 0) { - MD5Init(&context); - MD5Update(&context, md5buf, secretlen + AUTH_VECTOR_LEN); - MD5Final(digest, &context); + MD5_Init(&context); + MD5_Update(&context, md5buf, secretlen + AUTH_VECTOR_LEN); + MD5_Final(digest, &context); for (i = 0; i < AUTH_VECTOR_LEN; ++i) { *ptr = digest[i] ^ *pw; md5buf[secretlen+i] = *ptr++; @@ -490,10 +490,10 @@ rad_recv(char *state, char *challenge, u_char *req_vector) /* verify server's shared secret */ memcpy(recv_vector, auth.vector, AUTH_VECTOR_LEN); memcpy(auth.vector, req_vector, AUTH_VECTOR_LEN); - MD5Init(&context); - MD5Update(&context, (u_char *)&auth, ntohs(auth.length)); - MD5Update(&context, auth_secret, strlen(auth_secret)); - MD5Final(test_vector, &context); + MD5_Init(&context); + MD5_Update(&context, (u_char *)&auth, ntohs(auth.length)); + MD5_Update(&context, auth_secret, strlen(auth_secret)); + MD5_Final(test_vector, &context); if (memcmp(recv_vector, test_vector, AUTH_VECTOR_LEN) != 0) errx(1, "shared secret incorrect"); |