Rebuild PKCS#9 encoding after adding new attributes
authorMartin Willi <martin@revosec.ch>
Fri, 23 Nov 2012 15:38:25 +0000 (16:38 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 19 Dec 2012 09:32:07 +0000 (10:32 +0100)
src/libstrongswan/crypto/pkcs9.c

index 6456797..b6bc7eb 100644 (file)
@@ -167,6 +167,9 @@ METHOD(pkcs9_t, add_attribute, void,
        this->attributes->insert_last(this->attributes,
                                                                  attribute_create(oid, value));
        chunk_free(&value);
+
+       /* rebuild encoding when adding attributes */
+       chunk_free(&this->encoding);
 }
 
 METHOD(pkcs9_t, destroy, void,