Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/signing.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-08-14 20:39:43 -0500
committerDan McGee <dan@archlinux.org>2011-08-15 06:24:49 -0500
commit83f076d3a81e5a625c07fdaf82a5e598a1c75c71 (patch)
tree26fbabfa4dc21d8c12e318a54826b8a98b12def6 /lib/libalpm/signing.c
parent835365b817285abf136fc8509ae9d1bf97f55dff (diff)
Update base64 PolarSSL code
Also adjust our code using it for the size_t adjustments made by upstream. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/signing.c')
-rw-r--r--lib/libalpm/signing.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 78e6264b..6ca32fd5 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -168,20 +168,21 @@ error:
* @return 0 on success, 1 on failure to properly decode
*/
static int decode_signature(const char *base64_data,
- unsigned char **data, int *data_len) {
+ unsigned char **data, size_t *data_len) {
unsigned char *usline;
- int len;
+ size_t len;
len = strlen(base64_data);
usline = (unsigned char *)base64_data;
- int ret, destlen = 0;
+ int ret;
+ size_t destlen = 0;
/* get the necessary size for the buffer by passing 0 */
ret = base64_decode(NULL, &destlen, usline, len);
if(ret != 0 && ret != POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL) {
goto error;
}
/* alloc our memory and repeat the call to decode */
- MALLOC(*data, (size_t)destlen, goto error);
+ MALLOC(*data, destlen, goto error);
ret = base64_decode(*data, &destlen, usline, len);
if(ret != 0) {
goto error;
@@ -270,7 +271,7 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
/* next create data object for the signature */
if(base64_sig) {
/* memory-based, we loaded it from a sync DB */
- int data_len;
+ size_t data_len;
int decode_ret = decode_signature(base64_sig,
&decoded_sigdata, &data_len);
if(decode_ret) {