[pacman-dev] [PATCH 4/8] Make decode_signature available to the library
Allan McRae
allan at archlinux.org
Fri Nov 2 11:28:18 EDT 2012
Signed-off-by: Allan McRae <allan at archlinux.org>
---
lib/libalpm/signing.c | 4 ++--
lib/libalpm/signing.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 6b13522..703e3ea 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -418,7 +418,7 @@ int _alpm_key_import(alpm_handle_t *handle, const char *fpr) {
* @param data_len the length of the returned data
* @return 0 on success, -1 on failure to properly decode
*/
-static int decode_signature(const char *base64_data,
+int _alpm_decode_signature(const char *base64_data,
unsigned char **data, size_t *data_len) {
size_t len = strlen(base64_data);
unsigned char *usline = (unsigned char *)base64_data;
@@ -517,7 +517,7 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
if(base64_sig) {
/* memory-based, we loaded it from a sync DB */
size_t data_len;
- int decode_ret = decode_signature(base64_sig,
+ int decode_ret = _alpm_decode_signature(base64_sig,
&decoded_sigdata, &data_len);
if(decode_ret) {
handle->pm_errno = ALPM_ERR_SIG_INVALID;
diff --git a/lib/libalpm/signing.h b/lib/libalpm/signing.h
index 6537ee3..d4d7c78 100644
--- a/lib/libalpm/signing.h
+++ b/lib/libalpm/signing.h
@@ -34,6 +34,8 @@ int _alpm_process_siglist(alpm_handle_t *handle, const char *identifier,
int _alpm_key_in_keychain(alpm_handle_t *handle, const char *fpr);
int _alpm_key_import(alpm_handle_t *handle, const char *fpr);
+int _alpm_decode_signature(const char *base64_data,
+ unsigned char **data, size_t *data_len);
int _alpm_extract_keyid(const unsigned char *sig, size_t len, alpm_list_t **keys);
#endif /* _ALPM_SIGNING_H */
--
1.8.0
More information about the pacman-dev
mailing list