]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Remove external build_encoding method in PKCS#9
authorMartin Willi <martin@revosec.ch>
Fri, 23 Nov 2012 14:48:30 +0000 (15:48 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 19 Dec 2012 09:32:07 +0000 (10:32 +0100)
src/libstrongswan/crypto/pkcs9.c
src/libstrongswan/crypto/pkcs9.h

index 73dfdc447ae00e65184b96ac00a47372f15890d1..15800d57d10758c86d4ccfd05b9eb5c029184787 100644 (file)
@@ -145,8 +145,10 @@ static attribute_t *attribute_create(int oid, chunk_t value)
        return this;
 }
 
-METHOD(pkcs9_t, build_encoding, void,
-       private_pkcs9_t *this)
+/**
+ * Build encoding of the attribute list
+ */
+static void build_encoding(private_pkcs9_t *this)
 {
        enumerator_t *enumerator;
        attribute_t *attribute;
@@ -188,7 +190,7 @@ METHOD(pkcs9_t, build_encoding, void,
 METHOD(pkcs9_t, get_encoding, chunk_t,
        private_pkcs9_t *this)
 {
-       if (this->encoding.ptr == NULL)
+       if (!this->encoding.len)
        {
                build_encoding(this);
        }
@@ -255,7 +257,6 @@ static private_pkcs9_t *pkcs9_create_empty(void)
 
        INIT(this,
                .public = {
-                       .build_encoding = _build_encoding,
                        .get_encoding = _get_encoding,
                        .get_attribute = _get_attribute,
                        .set_attribute = _set_attribute,
index c442d4441dafb45ba38aec789cd27619c68d6b63..2c60aaf5ffa14d64084d7e902e2ddb71388cf0ef 100644 (file)
@@ -31,11 +31,6 @@ typedef struct pkcs9_t pkcs9_t;
  */
 struct pkcs9_t {
 
-       /**
-        * Generate ASN.1 encoding of attribute list
-        */
-       void (*build_encoding) (pkcs9_t *this);
-
        /**
         * Gets ASN.1 encoding of PKCS#9 attribute list
         *