void-packages/srcpkgs/libsasl/patches/libressl.patch

62 lines
2.0 KiB
Diff

Source: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/security/cyrus-sasl2/patches/patch-saslauthd_lak_c
Upstream: No
Reason: LibreSSL compatibility
$OpenBSD: patch-saslauthd_lak_c,v 1.1 2018/11/19 08:24:23 ajacoutot Exp $
64-bit time_t
Fix for LibreSSL
Index: saslauthd/lak.c
--- a/saslauthd/lak.c.orig
+++ b/saslauthd/lak.c
@@ -841,12 +841,12 @@ static int lak_connect(
rc = ldap_set_option(lak->ld, LDAP_OPT_NETWORK_TIMEOUT, &(lak->conf->timeout));
if (rc != LDAP_OPT_SUCCESS) {
- syslog(LOG_WARNING|LOG_AUTH, "Unable to set LDAP_OPT_NETWORK_TIMEOUT %ld.%ld.", lak->conf->timeout.tv_sec, lak->conf->timeout.tv_usec);
+ syslog(LOG_WARNING|LOG_AUTH, "Unable to set LDAP_OPT_NETWORK_TIMEOUT %lld.%ld.", lak->conf->timeout.tv_sec, lak->conf->timeout.tv_usec);
}
rc = ldap_set_option(lak->ld, LDAP_OPT_TIMEOUT, &(lak->conf->timeout));
if (rc != LDAP_OPT_SUCCESS) {
- syslog(LOG_WARNING|LOG_AUTH, "Unable to set LDAP_OPT_TIMEOUT %ld.%ld.", lak->conf->timeout.tv_sec, lak->conf->timeout.tv_usec);
+ syslog(LOG_WARNING|LOG_AUTH, "Unable to set LDAP_OPT_TIMEOUT %lld.%ld.", lak->conf->timeout.tv_sec, lak->conf->timeout.tv_usec);
}
rc = ldap_set_option(lak->ld, LDAP_OPT_TIMELIMIT, &(lak->conf->time_limit));
@@ -1749,28 +1749,28 @@ static int lak_base64_decode(
int rc, i, tlen = 0;
char *text;
- EVP_ENCODE_CTX *enc_ctx = EVP_ENCODE_CTX_new();
+ EVP_ENCODE_CTX *enc_ctx = calloc(1, sizeof(EVP_ENCODE_CTX));
if (enc_ctx == NULL)
return LAK_NOMEM;
text = (char *)malloc(((strlen(src)+3)/4 * 3) + 1);
if (text == NULL) {
- EVP_ENCODE_CTX_free(enc_ctx);
+ free(enc_ctx);
return LAK_NOMEM;
}
EVP_DecodeInit(enc_ctx);
rc = EVP_DecodeUpdate(enc_ctx, (unsigned char *) text, &i, (const unsigned char *)src, strlen(src));
if (rc < 0) {
- EVP_ENCODE_CTX_free(enc_ctx);
+ free(enc_ctx);
free(text);
return LAK_FAIL;
}
tlen += i;
EVP_DecodeFinal(enc_ctx, (unsigned char *) text, &i);
- EVP_ENCODE_CTX_free(enc_ctx);
+ free(enc_ctx);
*ret = text;
if (rlen != NULL)