]> granicus.if.org Git - sudo/commitdiff
skeychallenge() on NetBSD take a size parameter
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Mar 2003 02:47:55 +0000 (02:47 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Mar 2003 02:47:55 +0000 (02:47 +0000)
auth/rfc1938.c

index 02c571e85d63f0ad95d2aa66868e609f4c19da7f..18de4e037c37315e0d8277b50b9d28088c28fc8c 100644 (file)
 #include <pwd.h>
 
 #if defined(HAVE_SKEY)
-#include <skey.h>
-#define RFC1938                        skey
-#define rfc1938challenge       skeychallenge
-#define rfc1938verify          skeyverify
+# include <skey.h>
+# define RFC1938                               skey
+#  ifdef __NetBSD__
+#   define rfc1938challenge(a,b,c,d)   skeychallenge((a),(b),(c),(d))
+#  else
+#   define rfc1938challenge(a,b,c,d)   skeychallenge((a),(b),(c))
+#  endif
+# define rfc1938verify(a,b)            skeyverify((a),(b))
 #elif defined(HAVE_OPIE)
-#include <opie.h>
-#define RFC1938                        opie
-#define rfc1938challenge       opiechallenge
-#define rfc1938verify          opieverify
+# include <opie.h>
+# define RFC1938                       opie
+# define rfc1938challenge(a,b,c,d)     opiechallenge((a),(b),(c))
+# define rfc1938verify(a,b)            opieverify((a),(b))
 #endif
 
 #include "sudo.h"
@@ -115,7 +119,7 @@ rfc1938_setup(pw, promptp, auth)
      * If the user is not in the OTP db, only post a fatal error if
      * we are running alone (since they may just use a normal passwd).
      */
-    if (rfc1938challenge(&rfc1938, pw->pw_name, challenge) != 0) {
+    if (rfc1938challenge(&rfc1938, pw->pw_name, challenge, sizeof(challenge))) {
        if (IS_ONEANDONLY(auth)) {
            (void) fprintf(stderr,
                           "%s: You do not exist in the %s database.\n",