Subject: OPIE patch

From: 藤本 真吾 <[email-masked]>
Date: Tue, 09 Sep 1997 14:01:39 +0000

Hi.

I tried to configure wu-ftpd with OPIE(OTP) support, and I couldn't find
any patch for it.

This is quick hack, but it works fine.
You also need OPIE distribution (I tried with OPIE2.2).

If you can, please include next release.

Thank you.

=====================================================
               SHINGO FUJIMOTO
       FUJITSU LABORATORIES OF AMERICA Inc.
           E-mail: [email-masked]
*** wu-ftpd-2.4.2-beta-14/src/ftpd.c	Tue Aug 12 03:43:08 1997
--- wu-ftpd-2.4.2-opie/src/ftpd.c	Mon Sep  8 20:47:12 1997
***************
*** 343,348 ****
--- 343,354 ----
  int	pwok = 0;
  #endif
  
+ #ifdef OPIE
+ #include <opie.h>
+ int	pwok = 0;
+ struct opie opiestate;
+ #endif
+ 
  #ifdef KERBEROS
  void init_krb();
  void end_krb();
***************
*** 1266,1273 ****
--- 1272,1287 ----
      pwok = skeyaccess(name, NULL, remotehost, remoteaddr);
      reply(331, "%s", skey_challenge(name, pw, pwok));
  #else
+ #ifdef OPIE
+    {
+         char prompt[OPIE_CHALLENGE_MAX + 1];
+         opiechallenge(&opiestate, name, prompt);
+         reply(331, "%s", prompt);
+     }
+ #else
      reply(331, "Password required for %s.", name);
  #endif
+ #endif
      askpasswd = 1;
      /* Delay before reading passwd after first failed attempt to slow down
       * passwd-guessing programs. */
***************
*** 1411,1416 ****
--- 1425,1431 ----
  	if (pw == NULL) 
  	  salt = "xx";
  	else
+ #ifndef OPIE
  	  salt = pw->pw_passwd;
  #ifdef SECUREOSF
  	  xpasswd = bigcrypt(passwd, salt);
***************
*** 1426,1431 ****
--- 1441,1447 ----
  #endif
  #endif
  #endif
+ #endif /* !OPIE */
  #ifdef ULTRIX_AUTH
          if ((numfails = ultrix_check_pass(passwd, xpasswd)) >= 0) {
  #else
***************
*** 1434,1441 ****
--- 1450,1461 ----
  #ifdef HAS_PW_EXPIRE
  	  (pw->pw_expire && time(NULL) < pw->pw_expire) &&
  #endif
+ #ifdef OPIE
+           opieverify(&opiestate, passwd) == 0) {
+ #else
            strcmp(xpasswd, pw->pw_passwd) == 0) {
  #endif
+ #endif
  	    rval = 0;
             } 
          if(rval){
*** wu-ftpd-2.4.2-beta-14/config.h	Tue Aug 12 03:42:48 1997
--- wu-ftpd-2.4.2-opie/config.h	Tue Sep  9 13:52:09 1997
***************
*** 74,76 ****
--- 74,83 ----
  
  #undef SKEY
  
+ /*
+  * OPIE
+  * Add OPIE(OTP) support -- REQUIRES OPIE libraries
+  */
+ 
+ #undef OPIE
+

---

From: [email-masked] (KOJIMA Hajime)
Date: Wed, 10 Sep 1997 10:12:01 +0900

In <[email-masked]>, Fujimoto wrote:
| I tried to configure wu-ftpd with OPIE(OTP) support, and I couldn't find
| any patch for it.
 
  I wrote opie-support patch for wu-ftpd 2.4.2-beta13, but I don't write 
  for beta14 yet.
 
| This is quick hack, but it works fine.
| You also need OPIE distribution (I tried with OPIE2.2).
 
  Don't use opie 2.3 or before.  It has SERIOUS lock bug.
  Latest and most safe version is opie 2.31.
 
| + #ifdef OPIE
| +           opieverify(&opiestate, passwd) == 0) {
| + #else
|             strcmp(xpasswd, pw->pw_passwd) == 0) {
|   #endif
| + #endif

  If you use opie 2.22 or before, you may check opiestate.keyfile.
  For example,

      if (
  # ifdef BEFORE_OPIE_2_3
          opiestate.keyfile &&
  # endif
          opieverify(&opiestate, passwd) == 0) {

----
KOJIMA Hajime - Ryukoku Univ., Seta, Ohtu, Shiga, Japan
[Office] [email-masked]
         Phone: +81-775-43-7414  Fax: +81-775-43-0706
[Home]   [email-masked]
         [email-masked]