1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00

net/gq: Replace deprecated des_ methods and structs

- Patch des_ methods and structs with DES_ equivalents
  - Move from USE_OPENSSL to USES=ssl

PR:		198340
This commit is contained in:
Bernard Spil 2016-07-02 11:35:15 +00:00
parent ba2c37cdc1
commit fb932dee7c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=417927
2 changed files with 61 additions and 2 deletions

View File

@ -19,9 +19,8 @@ DND_DESC= Enable Drag and drop support in browse mode
CACHE_DESC= Support the OpenLDAP experimental client cache
USE_GNOME= intltool libglade2 gnomedocutils
USE_OPENSSL= yes
USE_OPENLDAP= yes
USES= gettext gmake pkgconfig shared-mime-info desktop-file-utils
USES= desktop-file-utils gettext pkgconfig gmake shared-mime-info ssl
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-ldap-prefix=${LOCALBASE} --disable-update-mimedb
DND_CONFIGURE_ENABLE= browser-dns

View File

@ -0,0 +1,60 @@
--- src/gq-hash-openssl.c.orig 2008-01-09 14:55:46 UTC
+++ src/gq-hash-openssl.c
@@ -60,7 +60,7 @@ gq_hash_crypt(gchar const *data, gsize l
salt->str[2] = 0;
g_byte_array_append(gb, (guchar*)"{CRYPT}", 7);
- des_fcrypt((gchar*)password, salt->str, (gchar*)cryptbuf);
+ DES_fcrypt((gchar*)password, salt->str, (gchar*)cryptbuf);
g_byte_array_append(gb, cryptbuf, strlen((gchar*)cryptbuf));
@@ -242,7 +242,7 @@ static const char *lmhash_key = "KGS!@#$
/* FIXME: silently assumes US-ASCII (or a single-byte encoding to be
handled by toupper) */
-static void lm_make_key(const char *pw, des_cblock *key)
+static void lm_make_key(const char *pw, DES_cblock *key)
{
int i;
char *k = (char *) key;
@@ -253,7 +253,7 @@ static void lm_make_key(const char *pw,
k[i+1] = (pw[i] << (7 - i)) & 0xff;
}
- des_set_odd_parity(key);
+ DES_set_odd_parity(key);
}
GByteArray*
@@ -262,10 +262,10 @@ gq_hash_lmhash(gchar const* data, gsize
unsigned int i;
char hex[2];
char plain[15];
- des_key_schedule schedule;
+ DES_key_schedule schedule;
GByteArray *gb = NULL;
- des_cblock ckey1, ckey2;
- des_cblock bin1, bin2;
+ DES_cblock ckey1, ckey2;
+ DES_cblock bin1, bin2;
memset(plain, 0, sizeof(plain));
@@ -274,12 +274,12 @@ gq_hash_lmhash(gchar const* data, gsize
}
lm_make_key(plain, &ckey1);
- des_set_key_unchecked(&ckey1, schedule);
- des_ecb_encrypt((des_cblock*)lmhash_key, &bin1, schedule, DES_ENCRYPT);
+ DES_set_key_unchecked(&ckey1, &schedule);
+ DES_ecb_encrypt((DES_cblock*)lmhash_key, &bin1, &schedule, DES_ENCRYPT);
lm_make_key(plain + 7, &ckey2);
- des_set_key_unchecked(&ckey2, schedule);
- des_ecb_encrypt((des_cblock*)lmhash_key, &bin2, schedule, DES_ENCRYPT);
+ DES_set_key_unchecked(&ckey2, &schedule);
+ DES_ecb_encrypt((DES_cblock*)lmhash_key, &bin2, &schedule, DES_ENCRYPT);
gb = g_byte_array_new();