Date: Sat, 4 Apr 2015 12:19:15 +0000 (UTC) From: Thomas Zander <riggs@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r383204 - in head/security/chntpw: . files Message-ID: <201504041219.t34CJFeS016303@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: riggs Date: Sat Apr 4 12:19:14 2015 New Revision: 383204 URL: https://svnweb.freebsd.org/changeset/ports/383204 Log: - Replace deprecated des_* methods with DES_* counterparts - Fix build with LibreSSL PR: 198346 Submitted by: spil.oss@gmail.com Approved by: buganini@gmail.com (maintainer) MFH: 2015Q2 Added: head/security/chntpw/files/ head/security/chntpw/files/patch-chntpw.c (contents, props changed) Modified: head/security/chntpw/Makefile Modified: head/security/chntpw/Makefile ============================================================================== --- head/security/chntpw/Makefile Sat Apr 4 12:16:53 2015 (r383203) +++ head/security/chntpw/Makefile Sat Apr 4 12:19:14 2015 (r383204) @@ -3,7 +3,7 @@ PORTNAME= chntpw PORTVERSION= 110511 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security sysutils MASTER_SITES= http://pogostick.net/~pnh/ntpasswd/ DISTNAME= ${PORTNAME}-source-${PORTVERSION} Added: head/security/chntpw/files/patch-chntpw.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/chntpw/files/patch-chntpw.c Sat Apr 4 12:19:14 2015 (r383204) @@ -0,0 +1,100 @@ +--- chntpw.c.orig 2011-05-11 19:33:56 UTC ++++ chntpw.c +@@ -142,7 +142,7 @@ void str_to_key(unsigned char *str,unsig + for (i=0;i<8;i++) { + key[i] = (key[i]<<1); + } +- DES_set_odd_parity((des_cblock *)key); ++ DES_set_odd_parity((DES_cblock *)key); + } + + /* +@@ -187,16 +187,16 @@ void sid_to_key2(uint32_t sid,unsigned c + + void E1(uchar *k, uchar *d, uchar *out) + { +- des_key_schedule ks; +- des_cblock deskey; ++ DES_key_schedule ks; ++ DES_cblock deskey; + + str_to_key(k,(uchar *)deskey); + #ifdef __FreeBSD__ +- des_set_key(&deskey,ks); ++ DES_set_key(&deskey,&ks); + #else /* __FreeBsd__ */ +- des_set_key((des_cblock *)deskey,ks); ++ DES_set_key((DES_cblock *)deskey,&ks); + #endif /* __FreeBsd__ */ +- des_ecb_encrypt((des_cblock *)d,(des_cblock *)out, ks, DES_ENCRYPT); ++ DES_ecb_encrypt((DES_cblock *)d,(DES_cblock *)out, &ks, DES_ENCRYPT); + } + + +@@ -504,8 +504,8 @@ char *change_pw(char *buf, int rid, int + int dontchange = 0; + struct user_V *v; + +- des_key_schedule ks1, ks2; +- des_cblock deskey1, deskey2; ++ DES_key_schedule ks1, ks2; ++ DES_cblock deskey1, deskey2; + + MD4_CTX context; + unsigned char digest[16]; +@@ -623,21 +623,21 @@ char *change_pw(char *buf, int rid, int + + /* Get the two decrpt keys. */ + sid_to_key1(rid,(unsigned char *)deskey1); +- des_set_key((des_cblock *)deskey1,ks1); ++ DES_set_key((DES_cblock *)deskey1,&ks1); + sid_to_key2(rid,(unsigned char *)deskey2); +- des_set_key((des_cblock *)deskey2,ks2); ++ DES_set_key((DES_cblock *)deskey2,&ks2); + + /* Decrypt the NT md4 password hash as two 8 byte blocks. */ +- des_ecb_encrypt((des_cblock *)(vp+ntpw_offs ), +- (des_cblock *)md4, ks1, DES_DECRYPT); +- des_ecb_encrypt((des_cblock *)(vp+ntpw_offs + 8), +- (des_cblock *)&md4[8], ks2, DES_DECRYPT); ++ DES_ecb_encrypt((DES_cblock *)(vp+ntpw_offs ), ++ (DES_cblock *)md4, &ks1, DES_DECRYPT); ++ DES_ecb_encrypt((DES_cblock *)(vp+ntpw_offs + 8), ++ (DES_cblock *)&md4[8], &ks2, DES_DECRYPT); + + /* Decrypt the lanman password hash as two 8 byte blocks. */ +- des_ecb_encrypt((des_cblock *)(vp+lmpw_offs), +- (des_cblock *)lanman, ks1, DES_DECRYPT); +- des_ecb_encrypt((des_cblock *)(vp+lmpw_offs + 8), +- (des_cblock *)&lanman[8], ks2, DES_DECRYPT); ++ DES_ecb_encrypt((DES_cblock *)(vp+lmpw_offs), ++ (DES_cblock *)lanman, &ks1, DES_DECRYPT); ++ DES_ecb_encrypt((DES_cblock *)(vp+lmpw_offs + 8), ++ (DES_cblock *)&lanman[8], &ks2, DES_DECRYPT); + + if (gverbose) { + hexprnt("MD4 hash : ",(unsigned char *)md4,16); +@@ -705,15 +705,15 @@ char *change_pw(char *buf, int rid, int + if (gverbose) hexprnt("NEW LANMAN hash : ",(unsigned char *)lanman,16); + + /* Encrypt the NT md4 password hash as two 8 byte blocks. */ +- des_ecb_encrypt((des_cblock *)digest, +- (des_cblock *)despw, ks1, DES_ENCRYPT); +- des_ecb_encrypt((des_cblock *)(digest+8), +- (des_cblock *)&despw[8], ks2, DES_ENCRYPT); ++ DES_ecb_encrypt((DES_cblock *)digest, ++ (DES_cblock *)despw, &ks1, DES_ENCRYPT); ++ DES_ecb_encrypt((DES_cblock *)digest, ++ (DES_cblock *)&despw[8], &ks2, DES_ENCRYPT); + +- des_ecb_encrypt((des_cblock *)lanman, +- (des_cblock *)newlandes, ks1, DES_ENCRYPT); +- des_ecb_encrypt((des_cblock *)(lanman+8), +- (des_cblock *)&newlandes[8], ks2, DES_ENCRYPT); ++ DES_ecb_encrypt((DES_cblock *)lanman, ++ (DES_cblock *)newlandes, &ks1, DES_ENCRYPT); ++ DES_ecb_encrypt((DES_cblock *)(lanman+8), ++ (DES_cblock *)&newlandes[8], &ks2, DES_ENCRYPT); + + if (gverbose) { + hexprnt("NEW DES crypt : ",(unsigned char *)despw,16);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504041219.t34CJFeS016303>