pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/netatalk22



Module Name:    pkgsrc
Committed By:   rjs
Date:           Sun Jun  2 20:03:32 UTC 2019

Modified Files:
        pkgsrc/net/netatalk22: Makefile distinfo
Added Files:
        pkgsrc/net/netatalk22/patches: patch-etc_uams_uams__dhx__pam.c
            patch-etc_uams_uams__dhx__passwd.c patch-etc_uams_uams__randnum.c

Log Message:
Update for new openssl API.

Should fix PR pkg/53407.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 pkgsrc/net/netatalk22/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/net/netatalk22/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__dhx__pam.c \
    pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__dhx__passwd.c \
    pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__randnum.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/netatalk22/Makefile
diff -u pkgsrc/net/netatalk22/Makefile:1.19 pkgsrc/net/netatalk22/Makefile:1.20
--- pkgsrc/net/netatalk22/Makefile:1.19 Wed Nov 14 22:22:13 2018
+++ pkgsrc/net/netatalk22/Makefile      Sun Jun  2 20:03:32 2019
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.19 2018/11/14 22:22:13 kleink Exp $
+# $NetBSD: Makefile,v 1.20 2019/06/02 20:03:32 rjs Exp $
 
 DISTNAME=      netatalk-2.2.6
 PKGNAME=        ${DISTNAME:C/-/22-/}
-PKGREVISION=   9
+PKGREVISION=   10
 CATEGORIES=    net print
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=netatalk/}
 EXTRACT_SUFX=  .tar.bz2

Index: pkgsrc/net/netatalk22/distinfo
diff -u pkgsrc/net/netatalk22/distinfo:1.6 pkgsrc/net/netatalk22/distinfo:1.7
--- pkgsrc/net/netatalk22/distinfo:1.6  Wed Jul 12 13:56:00 2017
+++ pkgsrc/net/netatalk22/distinfo      Sun Jun  2 20:03:32 2019
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2017/07/12 13:56:00 hauke Exp $
+$NetBSD: distinfo,v 1.7 2019/06/02 20:03:32 rjs Exp $
 
 SHA1 (netatalk-2.2.6.tar.bz2) = 98a2d33f2e240e49caec32b83bca579723ce87f7
 RMD160 (netatalk-2.2.6.tar.bz2) = c7b051cf89d30c9bf1d491d9e04ceee2f39b897d
@@ -7,5 +7,8 @@ Size (netatalk-2.2.6.tar.bz2) = 1301887 
 SHA1 (patch-config_Makefile.in) = 6b9f545e5ddb178e9a310cec4de300c02557e685
 SHA1 (patch-configure) = 9919625c3cd54e34ab45c6606094e12215630d33
 SHA1 (patch-distrib_initscripts_Makefile.in) = 706890f9e0aacab4d523cc1900048b7fab96f5d4
+SHA1 (patch-etc_uams_uams__dhx__pam.c) = 9c75c8562271204c6be974af189e48a9a1b35e11
+SHA1 (patch-etc_uams_uams__dhx__passwd.c) = eb950f16b8d9c00ff45e40769f01850138e76176
+SHA1 (patch-etc_uams_uams__randnum.c) = ff9f698156e0954000e95ac0fbd9b9604d15b8d1
 SHA1 (patch-include_atalk_ldapconfig.h) = 05aa673fce4c670af252b298b1a9e820b1fc7adb
 SHA1 (patch-libatalk_bstring_bstrlib.c) = f43818328237b908166f956de464f532d578d2c4

Added files:

Index: pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__dhx__pam.c
diff -u /dev/null pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__dhx__pam.c:1.1
--- /dev/null   Sun Jun  2 20:03:32 2019
+++ pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__dhx__pam.c       Sun Jun  2 20:03:32 2019
@@ -0,0 +1,61 @@
+$NetBSD: patch-etc_uams_uams__dhx__pam.c,v 1.1 2019/06/02 20:03:32 rjs Exp $
+
+--- etc/uams/uams_dhx_pam.c.orig       2014-03-16 11:17:48.000000000 +0000
++++ etc/uams/uams_dhx_pam.c
+@@ -190,6 +190,7 @@ static int dhx_setup(void *obj, char *ib
+     u_int16_t sessid;
+     size_t i;
+     BIGNUM *bn, *gbn, *pbn;
++    const BIGNUM *pub_key;
+     DH *dh;
+ 
+     /* get the client's public key */
+@@ -233,9 +234,16 @@ static int dhx_setup(void *obj, char *ib
+       return AFPERR_PARAM;
+     }
+ 
++    if (!DH_set0_pqg(dh, pbn, NULL, gbn)) {
++      BN_free(pbn);
++      BN_free(gbn);
++    /* Log Entry */
++      LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM DH_set0_pqg() mysteriously failed  -- %s", strerror(errno));
++    /* Log Entry */
++      goto pam_fail;
++    }
++
+     /* generate key and make sure that we have enough space */
+-    dh->p = pbn;
+-    dh->g = gbn;
+     if (DH_generate_key(dh) == 0) {
+       unsigned long dherror;
+       char errbuf[256];
+@@ -249,16 +257,17 @@ static int dhx_setup(void *obj, char *ib
+       ERR_free_strings();
+       goto pam_fail;
+     }
+-    if (BN_num_bytes(dh->pub_key) > KEYSIZE) {
++    DH_get0_key(dh, &pub_key, NULL);
++    if (BN_num_bytes(pub_key) > KEYSIZE) {
+       LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Err Generating Key -- Not enough Space? -- %s", strerror(errno));
+       goto pam_fail;
+     }
+ 
+     /* figure out the key. store the key in rbuf for now. */
+-    i = DH_compute_key(rbuf, bn, dh);
++    i = DH_compute_key((unsigned char *)rbuf, bn, dh);
+     
+     /* set the key */
+-    CAST_set_key(&castkey, i, rbuf);
++    CAST_set_key(&castkey, i, (unsigned char *)rbuf);
+     
+     /* session id. it's just a hashed version of the object pointer. */
+     sessid = dhxhash(obj);
+@@ -267,7 +276,7 @@ static int dhx_setup(void *obj, char *ib
+     *rbuflen += sizeof(sessid);
+     
+     /* public key */
+-    BN_bn2bin(dh->pub_key, rbuf); 
++    BN_bn2bin(pub_key, (unsigned char *)rbuf); 
+     rbuf += KEYSIZE;
+     *rbuflen += KEYSIZE;
+ 
Index: pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__dhx__passwd.c
diff -u /dev/null pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__dhx__passwd.c:1.1
--- /dev/null   Sun Jun  2 20:03:32 2019
+++ pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__dhx__passwd.c    Sun Jun  2 20:03:32 2019
@@ -0,0 +1,43 @@
+$NetBSD: patch-etc_uams_uams__dhx__passwd.c,v 1.1 2019/06/02 20:03:32 rjs Exp $
+
+--- etc/uams/uams_dhx_passwd.c.orig    2014-03-16 11:17:48.000000000 +0000
++++ etc/uams/uams_dhx_passwd.c
+@@ -81,6 +81,7 @@ static int pwd_login(void *obj, char *us
+     struct spwd *sp;
+ #endif /* SHADOWPW */
+     BIGNUM *bn, *gbn, *pbn;
++    const BIGNUM *pub_key;
+     u_int16_t sessid;
+     size_t i;
+     DH *dh;
+@@ -144,10 +145,18 @@ static int pwd_login(void *obj, char *us
+       return AFPERR_PARAM;
+     }
+ 
++    if (!DH_set0_pqg(dh, pbn, NULL, gbn)) {
++      BN_free(pbn);
++      BN_free(gbn);
++      goto passwd_fail;
++    }
++
+     /* generate key and make sure we have enough space */
+-    dh->p = pbn;
+-    dh->g = gbn;
+-    if (!DH_generate_key(dh) || (BN_num_bytes(dh->pub_key) > KEYSIZE)) {
++    if (!DH_generate_key(dh)) {
++      goto passwd_fail;
++    }
++    DH_get0_key(dh, &pub_key, NULL);
++    if (BN_num_bytes(pub_key) > KEYSIZE) {
+       goto passwd_fail;
+     }
+ 
+@@ -164,7 +173,7 @@ static int pwd_login(void *obj, char *us
+     *rbuflen += sizeof(sessid);
+     
+     /* send our public key */
+-    BN_bn2bin(dh->pub_key, (unsigned char *)rbuf); 
++    BN_bn2bin(pub_key, (unsigned char *)rbuf); 
+     rbuf += KEYSIZE;
+     *rbuflen += KEYSIZE;
+ 
Index: pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__randnum.c
diff -u /dev/null pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__randnum.c:1.1
--- /dev/null   Sun Jun  2 20:03:32 2019
+++ pkgsrc/net/netatalk22/patches/patch-etc_uams_uams__randnum.c        Sun Jun  2 20:03:32 2019
@@ -0,0 +1,104 @@
+$NetBSD: patch-etc_uams_uams__randnum.c,v 1.1 2019/06/02 20:03:32 rjs Exp $
+
+--- etc/uams/uams_randnum.c.orig       2017-07-09 11:03:31.000000000 +0000
++++ etc/uams/uams_randnum.c
+@@ -55,8 +55,8 @@ char *strchr (), *strrchr ();
+ 
+ #define PASSWDLEN 8
+ 
+-static C_Block                seskey;
+-static Key_schedule   seskeysched;
++static DES_cblock     seskey;
++static DES_key_schedule       seskeysched;
+ static struct passwd  *randpwd;
+ static u_int8_t         randbuf[8];
+ 
+@@ -146,7 +146,7 @@ static int afppasswd(const struct passwd
+ {
+   u_int8_t key[DES_KEY_SZ*2];
+   char buf[MAXPATHLEN + 1], *p;
+-  Key_schedule        schedule;
++  DES_key_schedule    schedule;
+   FILE *fp;
+   unsigned int i, j;
+   int keyfd = -1, err = 0;
+@@ -203,17 +203,17 @@ afppasswd_found:
+       key[j] = (unhex(key[i]) << 4) | unhex(key[i + 1]);
+       if (j <= DES_KEY_SZ)
+       memset(key + j, 0, sizeof(key) - j);
+-      key_sched((C_Block *) key, schedule);
++      DES_key_sched((DES_cblock *) key, &schedule);
+       memset(key, 0, sizeof(key));
+ 
+       if (set) {
+       /* NOTE: this takes advantage of the fact that passwd doesn't
+        *       get used after this call if it's being set. */
+-      ecb_encrypt((C_Block *) passwd, (C_Block *) passwd, schedule,
++      DES_ecb_encrypt((DES_cblock *) passwd, (DES_cblock *) passwd, &schedule,
+                   DES_ENCRYPT);
+       } else {
+       /* decrypt the password */
+-      ecb_encrypt((C_Block *) p, (C_Block *) p, schedule, DES_DECRYPT);
++      DES_ecb_encrypt((DES_cblock *) p, (DES_cblock *) p, &schedule, DES_DECRYPT);
+       }
+       memset(&schedule, 0, sizeof(schedule));
+   }
+@@ -362,10 +362,10 @@ static int randnum_logincont(void *obj, 
+ 
+   /* encrypt. this saves a little space by using the fact that
+    * des can encrypt in-place without side-effects. */
+-  key_sched((C_Block *) seskey, seskeysched);
++  DES_key_sched((DES_cblock *) seskey, &seskeysched);
+   memset(seskey, 0, sizeof(seskey));
+-  ecb_encrypt((C_Block *) randbuf, (C_Block *) randbuf,
+-             seskeysched, DES_ENCRYPT);
++  DES_ecb_encrypt((DES_cblock *) randbuf, (DES_cblock *) randbuf,
++             &seskeysched, DES_ENCRYPT);
+   memset(&seskeysched, 0, sizeof(seskeysched));
+ 
+   /* test against what the client sent */
+@@ -406,10 +406,10 @@ static int rand2num_logincont(void *obj,
+     seskey[i] <<= 1;
+ 
+   /* encrypt randbuf */
+-  key_sched((C_Block *) seskey, seskeysched);
++  DES_key_sched((DES_cblock *) seskey, &seskeysched);
+   memset(seskey, 0, sizeof(seskey));
+-  ecb_encrypt( (C_Block *) randbuf, (C_Block *) randbuf,
+-             seskeysched, DES_ENCRYPT);
++  DES_ecb_encrypt((DES_cblock *) randbuf, (DES_cblock *) randbuf,
++             &seskeysched, DES_ENCRYPT);
+ 
+   /* test against client's reply */
+   if (memcmp(randbuf, ibuf, sizeof(randbuf))) { /* != */
+@@ -421,8 +421,8 @@ static int rand2num_logincont(void *obj,
+   memset(randbuf, 0, sizeof(randbuf));
+ 
+   /* encrypt client's challenge and send back */
+-  ecb_encrypt( (C_Block *) ibuf, (C_Block *) rbuf,
+-             seskeysched, DES_ENCRYPT);
++  DES_ecb_encrypt((DES_cblock *) ibuf, (DES_cblock *) rbuf,
++             &seskeysched, DES_ENCRYPT);
+   memset(&seskeysched, 0, sizeof(seskeysched));
+   *rbuflen = sizeof(randbuf);
+   
+@@ -457,15 +457,15 @@ static int randnum_changepw(void *obj, c
+       return err;
+ 
+     /* use old passwd to decrypt new passwd */
+-    key_sched((C_Block *) seskey, seskeysched);
++    DES_key_sched((DES_cblock *) seskey, &seskeysched);
+     ibuf += PASSWDLEN; /* new passwd */
+     ibuf[PASSWDLEN] = '\0';
+-    ecb_encrypt( (C_Block *) ibuf, (C_Block *) ibuf, seskeysched, DES_DECRYPT);
++    DES_ecb_encrypt((DES_cblock *) ibuf, (DES_cblock *) ibuf, &seskeysched, DES_DECRYPT);
+ 
+     /* now use new passwd to decrypt old passwd */
+-    key_sched((C_Block *) ibuf, seskeysched);
++    DES_key_sched((DES_cblock *) ibuf, &seskeysched);
+     ibuf -= PASSWDLEN; /* old passwd */
+-    ecb_encrypt((C_Block *) ibuf, (C_Block *) ibuf, seskeysched, DES_DECRYPT);
++    DES_ecb_encrypt((DES_cblock *) ibuf, (DES_cblock *) ibuf, &seskeysched, DES_DECRYPT);
+     if (memcmp(seskey, ibuf, sizeof(seskey))) 
+       err = AFPERR_NOTAUTH;
+     else if (memcmp(seskey, ibuf + PASSWDLEN, sizeof(seskey)) == 0)



Home | Main Index | Thread Index | Old Index