fixed encoding of AIK certificates and public keys
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 5 Sep 2011 10:43:18 +0000 (12:43 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 8 Sep 2011 10:08:16 +0000 (12:08 +0200)
src/libimcv/tcg/tcg_pts_attr_aik.c

index c442f31..ffef15f 100644 (file)
@@ -109,13 +109,15 @@ METHOD(pa_tnc_attr_t, build, void,
 {
        bio_writer_t *writer;
        u_int8_t flags = PTS_AIK_FLAGS_NONE;
+       cred_encoding_type_t encoding_type = CERT_ASN1_DER;
        chunk_t aik_blob;
 
        if (this->aik->get_type(this->aik) == CERT_TRUSTED_PUBKEY)
        {
                flags |= PTS_AIK_FLAGS_NAKED_KEY;
+               encoding_type = PUBKEY_SPKI_ASN1_DER;
        }
-       if (!this->aik->get_encoding(this->aik, CERT_ASN1_DER, &aik_blob))
+       if (!this->aik->get_encoding(this->aik, encoding_type, &aik_blob))
        {
                DBG1(DBG_TNC, "encoding of Attestation Identity Key failed");
                aik_blob = chunk_empty;