pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files/lib Improve support for anc...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/19bff6011833
branches:  trunk
changeset: 554616:19bff6011833
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Feb 16 20:59:11 2009 +0000

description:
Improve support for ancient OpenSSL releases.

diffstat:

 pkgtools/pkg_install/files/lib/pkcs7.c |  17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (53 lines):

diff -r a26b60313bbf -r 19bff6011833 pkgtools/pkg_install/files/lib/pkcs7.c
--- a/pkgtools/pkg_install/files/lib/pkcs7.c    Mon Feb 16 20:56:07 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/pkcs7.c    Mon Feb 16 20:59:11 2009 +0000
@@ -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 @@
 #include <openssl/x509v3.h>
 #include <openssl/pem.h>
 #include <openssl/err.h>
-#include <openssl/ui.h>
 
 #include "lib.h"
 
@@ -56,6 +55,10 @@
 #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 @@
 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);
 }
 



Home | Main Index | Thread Index | Old Index