[xmlsec] Using X509Data as key format

Dmitry Belyavsky beldmit at cryptocom.ru
Fri Dec 9 09:17:16 PST 2005


Greetings!

On Fri, 9 Dec 2005, Aleksey Sanin wrote:

> > Is it true that xmlSecMSCryptoKeyDataX509Klass.objSize is
> > xmlSecMSCryptoX509DataSize? It seems to cause the problem I get.
> >
> > It's less then xmlSecMSCryptoKeyDataSize...
> >
> Yes, xmlSecMSCryptoX509DataSize.objSize defines the size of
> xmlSecMSCryptoX509Data structures. The xmlSecMSCryptoX509DataSize
> is "derived" from xmlSecKeyData thus it should have at least
> the same size.

Sorry, I don't understand this letter... xmlSecMSCryptoX509DataSize is
larger than sizeof(xmlSecKeyData) but lesser then
xmlSecMSCryptoKeyDataSize so assertion fails at
src\mscrypto\certkeys.c:411.

======= src\mscrypto\certkeys.c
static int
xmlSecMSCryptoKeyDataAdoptCert(xmlSecKeyDataPtr data, PCCERT_CONTEXT pCert, xmlSecKeyDataType type) {
    xmlSecMSCryptoKeyDataCtxPtr ctx;
    HCRYPTKEY hKey = 0;

    xmlSecAssert2(xmlSecKeyDataIsValid(data), -1);
    xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecMSCryptoKeyDataSize), -1);
=======
The last line I've quoted causes an assertion fail.


I tried to specify xmlSecMSCryptoKeyDataX509Klass as Klass for algorithm
I support.

I create data for my algorithm using:
  data = xmlSecKeyDataCreate(xmlSecMSCryptoKeyDataX509Id);

What's my fault?

Thank you!

-- 
SY, Dmitry Belyavsky (ICQ UIN 11116575)



More information about the xmlsec mailing list