X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=blobdiff_plain;f=xmltooling%2Fsecurity%2Fimpl%2FInlineKeyResolver.cpp;h=1fab3081c490db12ec7d4dd339d97ad200d70671;hp=6417090e9e4823bb89891b2523a0f531fd180dc8;hb=ab362f9c3195134452702c1ba7108258e81d8841;hpb=317f447213370116523cbcfdfafa4b06762d6ed6 diff --git a/xmltooling/security/impl/InlineKeyResolver.cpp b/xmltooling/security/impl/InlineKeyResolver.cpp index 6417090..1fab308 100644 --- a/xmltooling/security/impl/InlineKeyResolver.cpp +++ b/xmltooling/security/impl/InlineKeyResolver.cpp @@ -61,15 +61,10 @@ namespace xmltooling { class XMLTOOL_DLLLOCAL InlineCredential : public BasicX509Credential { public: - InlineCredential(const KeyInfo* keyInfo=nullptr) : BasicX509Credential(keyInfo!=nullptr), m_credctx(new KeyInfoCredentialContext(keyInfo)) { - } - InlineCredential(DSIGKeyInfoList* keyInfo) : BasicX509Credential(false), m_credctx(new KeyInfoCredentialContext(keyInfo)) { - } - InlineCredential(KeyInfoCredentialContext* context) : BasicX509Credential(context->getKeyInfo()!=nullptr), m_credctx(nullptr) { - } - virtual ~InlineCredential() { - delete m_credctx; - } + InlineCredential(const KeyInfo* keyInfo=nullptr) : BasicX509Credential(keyInfo!=nullptr), m_credctx(new KeyInfoCredentialContext(keyInfo)) {} + InlineCredential(DSIGKeyInfoList* keyInfo) : BasicX509Credential(false), m_credctx(new KeyInfoCredentialContext(keyInfo)) {} + InlineCredential(KeyInfoCredentialContext* context) : BasicX509Credential(context->getKeyInfo()!=nullptr) {} + virtual ~InlineCredential() {} XSECCryptoKey* getPrivateKey() const { return nullptr; @@ -108,11 +103,11 @@ namespace xmltooling { } const CredentialContext* getCredentalContext() const { - return m_credctx; + return m_credctx.get(); } void setCredentialContext(KeyInfoCredentialContext* context) { - m_credctx = context; + m_credctx.reset(context); } void resolve(const KeyInfo* keyInfo, int types=0, bool followRefs=false); @@ -123,7 +118,7 @@ namespace xmltooling { bool resolveKey(const KeyInfo* keyInfo, bool followRefs=false); bool resolveCRLs(const KeyInfo* keyInfo, bool followRefs=false); - KeyInfoCredentialContext* m_credctx; + auto_ptr m_credctx; }; static const XMLCh keyInfoReferences[] = UNICODE_LITERAL_17(k,e,y,I,n,f,o,R,e,f,e,r,e,n,c,e,s);