KEYS: Allow authentication data to be stored in an asymmetric key
[cascardo/linux.git] / crypto / asymmetric_keys / signature.c
index 004d5fc..3beee39 100644 (file)
 #include <keys/asymmetric-subtype.h>
 #include <linux/export.h>
 #include <linux/err.h>
+#include <linux/slab.h>
 #include <crypto/public_key.h>
 #include "asymmetric_keys.h"
 
+/*
+ * Destroy a public key signature.
+ */
+void public_key_signature_free(struct public_key_signature *sig)
+{
+       if (sig) {
+               kfree(sig->s);
+               kfree(sig->digest);
+               kfree(sig);
+       }
+}
+EXPORT_SYMBOL_GPL(public_key_signature_free);
+
 /**
  * verify_signature - Initiate the use of an asymmetric key to verify a signature
  * @key: The asymmetric key to verify against