Return-Path: Delivered-To: apmail-xml-security-dev-archive@www.apache.org Received: (qmail 65654 invoked from network); 14 Oct 2005 15:49:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Oct 2005 15:49:13 -0000 Received: (qmail 95626 invoked by uid 500); 14 Oct 2005 15:48:57 -0000 Delivered-To: apmail-xml-security-dev-archive@xml.apache.org Received: (qmail 95388 invoked by uid 500); 14 Oct 2005 15:48:56 -0000 Mailing-List: contact security-dev-help@xml.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: security-dev@xml.apache.org List-Id: Delivered-To: mailing list security-dev@xml.apache.org Received: (qmail 95298 invoked by uid 99); 14 Oct 2005 15:48:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2005 08:48:53 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [194.128.225.190] (HELO spmler1.mail.eds.com) (194.128.225.190) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2005 08:47:25 -0700 Received: from spmlir2.mail.eds.com (spmlir2.mail.eds.com [205.191.69.42] (may be forged)) by spmler1.mail.eds.com (8.13.2/8.12.10) with ESMTP id j9EFl0cu009788 for ; Fri, 14 Oct 2005 16:47:00 +0100 Received: from spmlir2.mail.eds.com (localhost.localdomain [127.0.0.1]) by spmlir2.mail.eds.com (8.13.4/8.12.10) with ESMTP id j9EFkPvm026323 for ; Fri, 14 Oct 2005 16:46:25 +0100 Received: from ukspm010.emea.corp.eds.com ([204.230.90.155]) by spmlir2.mail.eds.com (8.13.4/8.12.10) with ESMTP id j9EFkPNa026318 for ; Fri, 14 Oct 2005 16:46:25 +0100 Received: from ukspm204.emea.corp.eds.com ([204.230.90.193]) by ukspm010.emea.corp.eds.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 14 Oct 2005 16:46:44 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [C++] Memory Leak In DSIGSignature::verify() using RSA Signatures with WINCAPI Date: Fri, 14 Oct 2005 16:46:21 +0100 Message-ID: <4F014656062C1140880B2247EDAFD3B101068365@ukspm204.emea.corp.eds.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [C++] Memory Leak In DSIGSignature::verify() using RSA Signatures with WINCAPI Thread-Index: AcXPMuSRzY/2sH68R4C3Z1UQsAr/AgBb8lpAAAdmyTAABSSJEA== From: "Cullum, Steve" To: X-OriginalArrivalTime: 14 Oct 2005 15:46:44.0966 (UTC) FILETIME=[7AACF060:01C5D0D6] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I am having real trouble tracking down a memory leak when using RSA certificates via the MSCrypto interface. I have already fixed one error in the WinCAPICryptoKeyRSA() destructor.. (see previous thread). But memory is still being leaked when DSIGSignature::verify() gets called. Steps used .. To reproduce behaviour are simple=20 A) I Load a document digitally signed by RSA private key B) Install the certificate into the Windows key store C) Use the WINCAPI interface to load the certificate The leak happens when DSIGSignature::verify() is called. It does not matter verification is successful or not. I can provide a test driver and source to reproduce the behaviour. Has anybody got any ideas ... ? Where to look next. I am using the very latest version of XSEC (dloaded from CVS on the 14th Oct 05) // change ~WinCAPICryptoKeyRSA and comment out the sig->verify() and no leaks occur // uncomment out sig->verify() and memory is leaked XercesDOMParser parser; parser.setDoNamespaces(true); parser.setCreateEntityReferenceNodes(true); parser.setDoSchema(true); =20 MemBufInputSource *memIS =3D new MemBufInputSource((const XMLByte *)buffer, bufferLen, "XSECMem", false); parser.parse(*memIS); delete memIS; // destroy as soon as possible if(parser.getErrorCount() > 0)=20 exit(1); =20 // Now create a signature object to validate the document XSECProvider prov; DSIGSignature *sig =3D = prov.newSignatureFromDOM(parser.getDocument()); sig->registerIdAttributeName(config.idAttributeName); sig->registerIdAttributeNameNS(config.idAttributeNS, config.idAttributeName); sig->load(); =20 XSECCryptoKey *clone =3D X509->clonePublicKey();=20 sig->setSigningKey(clone); =20 sig->verify(); // leak here.. With the WinCAPICryptoKeyRSA::~WinCAPICryptoKeyRSA() fix in place=20 // commenting out sig->verify() stops leaks.=20 =20 prov.releaseSignature(sig);