security/heimdal: Fix build when EGD is not available (e.g. LibreSSL)

Approved by:	SSL blanket
This commit is contained in:
John Marino
2016-09-12 15:14:14 +00:00
parent 7b80b7b343
commit 6dd507bfc1
3 changed files with 30 additions and 2 deletions

View File

@@ -20,9 +20,8 @@ CONFLICTS= krb4-[0-9]* krb5-[0-9]* krb5-maint-[0-9]* srp-[0-9]* \
wu-ftpd-[0-9]* wu-ftpd+ipv6-[0-9]*
USES= gettext gssapi:bootstrap,heimdal libtool pathfix pkgconfig \
readline makeinfo
readline makeinfo ssl
USE_LDCONFIG= ${GSSAPILIBDIR}
USE_OPENSSL= yes
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
CONFIGURE_ENV= ac_cv_header_fnmatch_h=yes \

View File

@@ -0,0 +1,16 @@
--- lib/hcrypto/rand-egd.c.orig 2012-12-09 22:06:44 UTC
+++ lib/hcrypto/rand-egd.c
@@ -54,6 +54,7 @@ static const char *egd_path = "/var/run/
#define MAX_EGD_DATA 255
+#ifndef OPENSSL_NO_EGD
static int
connect_egd(const char *path)
{
@@ -258,3 +259,5 @@ RAND_egd_bytes(const char *filename, int
return 1;
}
+
+#endif

View File

@@ -0,0 +1,13 @@
--- lib/krb5/crypto-rand.c.orig 2012-12-09 22:06:44 UTC
+++ lib/krb5/crypto-rand.c
@@ -70,8 +70,10 @@ seed_something(void)
if (!krb5_init_context(&context)) {
p = krb5_config_get_string(context, NULL, "libdefaults",
"egd_socket", NULL);
+# ifndef OPENSSL_NO_EGD
if (p != NULL)
RAND_egd_bytes(p, ENTROPY_NEEDED);
+# endif
krb5_free_context(context);
}
#else