[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

decrypting kek messages



Well,
I've managed to get from creating KEK messages to decrypting them, so
progressing along  !

I've spent around an hour trying to figure this out. I'm implementing AES
content encryption, using dummy keys and iv's. The EnvelopedData is created
fine, all the correct calls in the CTIL appear to be made.	(SMTI_Encrypt(),
then SMTI_GenerateKeyWrap(), which currently just sets the encrypted data to
the plaintext data. When I get content encryption working, I can sort out
the encryption of the content key via IBE)

In decryption, everything appears to be working perfectly, until in the
method CSM_DataToDecrypt::TryThisInstance(), the code below is what I
believe is causing me trouble.

 pKeyAgreeAlg = new CSM_Alg(*pRI->AccesskeyEncryptionAlgorithm());
        // IN, specified encryption of key,
        //   used here in key generation, but alg not implemented.
  if (pKeyAgreeAlg->parameters)
  {
      m_pKeyWrapOID=new AsnOid (pKeyAgreeAlg->algorithm);
      pInst->SetPreferredCSInstAlgs(NULL, NULL, NULL, m_pKeyWrapOID);
      SME(pInst->AccessTokenInterface()->SMTI_ExtractKeyWrap(pMEK,
         &pRI->m_bufEMEK, NULL/*pRI->m_pbufParams*/,
         &pRI->m_pKEKDetails->m_UserEncryptionData,
         NULL));
  }     // END if pKeyAgreeAlg->parameters

Everything I want done is inside that if statement, however I can't figure
out how to set the pKeyAgreeAlg->parameters to actually trigger the if
statement ?

Thanks,
Gav