summaryrefslogtreecommitdiff
path: root/lib/crypto/pkcs7_parser.c
diff options
context:
space:
mode:
authorRaymond Mao <raymond.mao@linaro.org>2024-10-03 14:50:27 -0700
committerTom Rini <trini@konsulko.com>2024-10-14 17:58:42 -0600
commitaed1c9a20e0d09f21ce36f8b704c77d7dfa1d26d (patch)
tree9a7abb2a8679f19a2529c3b306943628c43bfd20 /lib/crypto/pkcs7_parser.c
parentfa1289c5d086fadd3cd3a566bd6a1a038680d5cd (diff)
pkcs7: move common functions to PKCS7 helper
Move pkcs7_get_content_data as a helper function that can be shared by legacy crypto lib and MbedTLS implementation. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/crypto/pkcs7_parser.c')
-rw-r--r--lib/crypto/pkcs7_parser.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/crypto/pkcs7_parser.c b/lib/crypto/pkcs7_parser.c
index d5efa828d6a..c849dc0d92d 100644
--- a/lib/crypto/pkcs7_parser.c
+++ b/lib/crypto/pkcs7_parser.c
@@ -182,34 +182,6 @@ out_no_ctx:
}
EXPORT_SYMBOL_GPL(pkcs7_parse_message);
-/**
- * pkcs7_get_content_data - Get access to the PKCS#7 content
- * @pkcs7: The preparsed PKCS#7 message to access
- * @_data: Place to return a pointer to the data
- * @_data_len: Place to return the data length
- * @_headerlen: Size of ASN.1 header not included in _data
- *
- * Get access to the data content of the PKCS#7 message. The size of the
- * header of the ASN.1 object that contains it is also provided and can be used
- * to adjust *_data and *_data_len to get the entire object.
- *
- * Returns -ENODATA if the data object was missing from the message.
- */
-int pkcs7_get_content_data(const struct pkcs7_message *pkcs7,
- const void **_data, size_t *_data_len,
- size_t *_headerlen)
-{
- if (!pkcs7->data)
- return -ENODATA;
-
- *_data = pkcs7->data;
- *_data_len = pkcs7->data_len;
- if (_headerlen)
- *_headerlen = pkcs7->data_hdrlen;
- return 0;
-}
-EXPORT_SYMBOL_GPL(pkcs7_get_content_data);
-
/*
* Note an OID when we find one for later processing when we know how
* to interpret it.