]> git.sur5r.net Git - openldap/commitdiff
Use newer DES API so that smbk5pwd loads with newer OpenSSL
authorEmmanuel Dreyfus <manu@netbsd.org>
Sun, 30 Oct 2016 04:34:58 +0000 (05:34 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 29 Nov 2016 17:35:08 +0000 (09:35 -0800)
OpenSSL removed old DES API which used des_* functions.
https://github.com/openssl/openssl/commit/24956ca00f014a917fb181a8abc39b349f3f316f

In order to link with libcrypto from recent OpenSSL releases, we need
to replace the older API des_* functions by the newer API DES_* functions.

Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
contrib/slapd-modules/smbk5pwd/smbk5pwd.c

index bec5e1beeaec664f537bfb216b9394d9031dca6f..97e00553ee0843fce2cd6039c3e70203e3368c59 100644 (file)
@@ -154,7 +154,7 @@ static void lmPasswd_to_key(
        k[7] = ((lpw[6]&0x7F)<<1);
 
 #ifdef HAVE_OPENSSL
-       des_set_odd_parity( key );
+       DES_set_odd_parity( key );
 #endif
 }
 
@@ -210,12 +210,12 @@ static void lmhash(
        des_set_key( &ctx, key );
        des_encrypt( &ctx, sizeof(key), hbuf[1], StdText );
 #elif defined(HAVE_OPENSSL)
-       des_set_key_unchecked( &key, schedule );
-       des_ecb_encrypt( &StdText, &hbuf[0], schedule , DES_ENCRYPT );
+       DES_set_key_unchecked( &key, &schedule );
+       DES_ecb_encrypt( &StdText, &hbuf[0], &schedule , DES_ENCRYPT );
 
        lmPasswd_to_key( &UcasePassword[7], &key );
-       des_set_key_unchecked( &key, schedule );
-       des_ecb_encrypt( &StdText, &hbuf[1], schedule , DES_ENCRYPT );
+       DES_set_key_unchecked( &key, &schedule );
+       DES_ecb_encrypt( &StdText, &hbuf[1], &schedule , DES_ENCRYPT );
 #endif
 
        hexify( (char *)hbuf, hash );