From b4e9a4efb2771d46586e7f10f8fbb189d1a2ae51 Mon Sep 17 00:00:00 2001 From: YASUOKA Masahiko Date: Thu, 18 Jul 2024 02:45:32 +0000 Subject: Since libcrypto is used to calc message authenticator, use libcrypto md5 also in other places instead libc md5. ok millert --- libexec/login_radius/raddauth.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'libexec') 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 #include #include -#include #include #include +#include #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"); -- cgit v1.2.3