]> arthur.barton.de Git - netatalk.git/commitdiff
dhx2 logincont packet size, from Frank Lahm
authordidg <didg>
Thu, 15 Jan 2009 04:16:32 +0000 (04:16 +0000)
committerdidg <didg>
Thu, 15 Jan 2009 04:16:32 +0000 (04:16 +0000)
etc/uams/uams_dhx2_pam.c
etc/uams/uams_dhx2_passwd.c

index cea12ca0d8c2059e25fa6112bb09bce8cb5e92fa..57cc523b4108091a529c5e9da0822b5b30ee6322 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_dhx2_pam.c,v 1.5 2008-11-30 17:36:08 didg Exp $
+ * $Id: uams_dhx2_pam.c,v 1.6 2009-01-15 04:16:32 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
@@ -573,9 +573,9 @@ static int logincont2(void *obj, struct passwd **uam_pwd,
 
     *rbuflen = 0;
 
-    /* Packet size should be: Session ID + ServerNonce + Passwd buffer */
-    if (ibuflen != 2 + 16 + 256) {
-        LOG(log_error, logtype_uams, "DHX2: Paket length not correct");
+    /* Packet size should be: Session ID + ServerNonce + Passwd buffer (evantually +10 extra bytes, see Apples Docs) */
+    if ((ibuflen != 2 + 16 + 256) && (ibuflen != 2 + 16 + 256 + 10)) {
+        LOG(log_error, logtype_uams, "DHX2: Paket length not correct: %d. Should be 274 or 284.", ibuflen);
         ret = AFPERR_PARAM;
         goto error_noctx;
     }
index 05acaaeeb9ac66bea923cbf77db2c83e31f45ade..2f41a4299eec68ca03c57b3468bb6a84235ac0e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_dhx2_passwd.c,v 1.4 2008-11-30 17:36:08 didg Exp $
+ * $Id: uams_dhx2_passwd.c,v 1.5 2009-01-15 04:16:32 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
@@ -501,9 +501,9 @@ static int logincont2(void *obj _U_, struct passwd **uam_pwd,
     gcry_error_t ctxerror;
 
     *rbuflen = 0;
-    /* Packet size should be: Session ID + ServerNonce + Passwd buffer */
-    if (ibuflen != 2 + 16 + 256) {
-        LOG(log_error, logtype_uams, "DHX2: Paket length not correct");
+    /* Packet size should be: Session ID + ServerNonce + Passwd buffer (evantually +10 extra bytes, see Apples Docs)*/
+    if ((ibuflen != 2 + 16 + 256) && (ibuflen != 2 + 16 + 256 + 10)) {
+        LOG(log_error, logtype_uams, "DHX2: Paket length not correct: %d. Should be 274 or 284.", ibuflen);
         ret = AFPERR_PARAM;
         goto error_noctx;
     }