summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2009-02-16 20:59:11 +0000
committerjoerg <joerg@pkgsrc.org>2009-02-16 20:59:11 +0000
commitfa27df019aa6cfa8f081040450b196777245c001 (patch)
treeee166e74a7e91dda109fe483e360ffbef425dc75 /pkgtools
parentfcc741a2ebe3644e7f23c47ba7cc01bf100043c1 (diff)
downloadpkgsrc-fa27df019aa6cfa8f081040450b196777245c001.tar.gz
Improve support for ancient OpenSSL releases.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/lib/pkcs7.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/pkgtools/pkg_install/files/lib/pkcs7.c b/pkgtools/pkg_install/files/lib/pkcs7.c
index c5a1b7f7464..086dc8d463a 100644
--- a/pkgtools/pkg_install/files/lib/pkcs7.c
+++ b/pkgtools/pkg_install/files/lib/pkcs7.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pkcs7.c,v 1.2 2009/02/02 12:35:01 joerg Exp $ */
+/* $NetBSD: pkcs7.c,v 1.3 2009/02/16 20:59:11 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
#endif
@@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: pkcs7.c,v 1.2 2009/02/02 12:35:01 joerg Exp $");
+__RCSID("$NetBSD: pkcs7.c,v 1.3 2009/02/16 20:59:11 joerg Exp $");
/*-
* Copyright (c) 2004, 2008 The NetBSD Foundation, Inc.
@@ -48,7 +48,6 @@ __RCSID("$NetBSD: pkcs7.c,v 1.2 2009/02/02 12:35:01 joerg Exp $");
#include <openssl/x509v3.h>
#include <openssl/pem.h>
#include <openssl/err.h>
-#include <openssl/ui.h>
#include "lib.h"
@@ -56,6 +55,10 @@ __RCSID("$NetBSD: pkcs7.c,v 1.2 2009/02/02 12:35:01 joerg Exp $");
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
#endif
+#ifndef NS_ANY_CA
+#define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA)
+#endif
+
static const int pkg_key_usage = XKU_CODE_SIGN | XKU_SMIME;
static int
@@ -227,8 +230,14 @@ static int
ssl_pass_cb(char *buf, int size, int rwflag, void *u)
{
- if (UI_UTIL_read_pw_string(buf, size, "Passphrase: ", 0))
+ if (EVP_read_pw_string(buf, size, "Passphrase :", 0)) {
+#if OPENSSL_VERSION >= 0x0090608fL
+ OPENSSL_cleanse(buf, size);
+#else
+ memset(buf, 0, size);
+#endif
return 0;
+ }
return strlen(buf);
}