Decrypting EncryptedAssertion openSAML-C++
Cantor, Scott
cantor.2 at osu.edu
Tue Apr 22 11:46:09 EDT 2014
On 4/22/14, 8:20 AM, "Akshay Singh" <akshay_iiit at yahoo.com> wrote:
>I am confused about the right way to decrypt an encrypted response
>(precisely, a signed response with encrypted assertion in it). I am
>writing the pseudo-code which I have (mainly from the
>saml-2.5.3-src/samltest/encryption/EncryptedAssertionTest.h) :
The only sample I can point you to is the Shibboleth assertion consumer
service code for SAML 2.
http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/shibsp/handler/impl/SA
ML2Consumer.cpp
>Is it the right way to do it or this code is too convoluted for what it
>is supposed to do (extracting decrypted assertion from encrypted
>assertion, which is in a SAML response).
Well, it's all been lowercased which makes it blindingly hard for even me
to follow, but the main thing is that you don't need metadata necessarily
to decrypt anything, you need metadata if you're using that to obtain
signing keys.
> This code dumps core on the last decrypt step
>ea->decrypt(*c_resolver, sp.first->getentityid())
Then you'll have to debug it. Since you're not checking for nulls
anywhere, there are a dozen reasons it could be crashing, starting with
sp.first being null.
-- Scott
More information about the dev
mailing list