From nobody@FreeBSD.org  Sun Jan 23 03:31:36 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id F012F16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 23 Jan 2005 03:31:36 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B442F43D3F
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 23 Jan 2005 03:31:36 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0N3VaiW032693
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 23 Jan 2005 03:31:36 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j0N3VanF032692;
	Sun, 23 Jan 2005 03:31:36 GMT
	(envelope-from nobody)
Message-Id: <200501230331.j0N3VanF032692@www.freebsd.org>
Date: Sun, 23 Jan 2005 03:31:36 GMT
From: Daniel Molina Wegener <dmw@unete.cl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: OpenSSL fails on loading keyfiles from BIO resources
X-Send-Pr-Version: www-2.3

>Number:         76588
>Category:       bin
>Synopsis:       openssl(1) fails on loading keyfiles from BIO resources
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 23 03:40:24 GMT 2005
>Closed-Date:    Fri Apr 22 20:18:10 UTC 2011
>Last-Modified:  Fri Apr 22 20:18:10 UTC 2011
>Originator:     Daniel Molina Wegener
>Release:        FreeBSD 5.3-RELEASE i386
>Organization:
Daniel Molina Wegener
>Environment:
FreeBSD daemon.unete.cl 5.3-RELEASE FreeBSD 5.3-RELEASE #1: Mon Nov 22 14:52:01 CLST 2004 root@daemon.unete.cl:/usr/src/sys/i386/compile/
PHOBOS i386
>Description:
   OpenSSL has a "bus error" that causes a signal 10 termination.

   The function PEM_read_bio_PrivateKey() in OpenSSL fails on opening
keyfiles in PEM format from memory -- a BIO resource -- where goes
good until tries to use the HASH_UPDATE function (redefined as MD5_Update)
on /usr/src/crypto/openssl/crypto/md32_common.h at line 413.

   Here is the backtrace:

[SNIP]
Program terminated with signal 10, Bus error.
[SNIP]
#0  0x2852c9de in md5_block_host_order () from /lib/libcrypto.so.3
#0  0x2852c9de in md5_block_host_order () from /lib/libcrypto.so.3
#1  0x2852c695 in MD5_Update () from /lib/libcrypto.so.3
#2  0x285246be in EVP_sha1 () from /lib/libcrypto.so.3
#3  0x285249df in EVP_DigestUpdate () from /lib/libcrypto.so.3
#4  0x28515455 in EVP_BytesToKey () from /lib/libcrypto.so.3
#5  0x28513a84 in PEM_do_header () from /lib/libcrypto.so.3
#6  0x285132f4 in PEM_bytes_read_bio () from /lib/libcrypto.so.3
#7  0x284c7330 in PEM_read_bio_PrivateKey () from /lib/libcrypto.so.3
#8  0x284359c8 in xmlSecOpenSSLAppKeyLoadBIO ()
   from /usr/local/lib/libxmlsec1-openssl.so
#9  0x2843563a in xmlSecOpenSSLAppKeyLoad ()
   from /usr/local/lib/libxmlsec1-openssl.so
#10 0x280977d7 in xmlSecCryptoAppKeyLoad () from /usr/local/lib/libxmlsec1.so.3
#11 0x0804e2bd in xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad ()
#12 0x0804bec2 in xmlSecAppLoadKeys ()
#13 0x0804a1da in main ()

>How-To-Repeat:
1. Install the XMLSec port ports/security/xmlsec1
2. Deinstall the port (only xmlsec1)
2. Download ftp://ftp.xmlsoft.org/xmlsec/releases/xmlsec1-1.2.6.tar.gz
3. Install the following packages (from the ports collection)
   - automake-1.5_2,1
   - automake-1.4.6_1
   - autoconf-2.53_3
4. Unpack the xmlsec-1.2.6 package
5. Run the commands to build the configure script
   $ aclocal15 -I /usr/local/share/aclocal
   $ automake14 --add-missing
   $ autoconf253
6. Configure the package:
   $ ./configure --without-gnutls --without-nss --without-nspr \
   --prefix=/usr/local --build=i386-testbld-freebsd5.3
7. Run gmake:
   $ gmake && gmake install
8. run the tests in the tests directory of the XMLSec 1.2.6
   distribution.

>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: jh 
State-Changed-When: Mon Mar 7 16:27:58 UTC 2011 
State-Changed-Why:  
Can you still reproduce this? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76588 
State-Changed-From-To: feedback->closed 
State-Changed-By: jh 
State-Changed-When: Fri Apr 22 20:18:09 UTC 2011 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76588 
>Unformatted:
