aboutsummaryrefslogtreecommitdiffstats
path: root/kbx/keybox-openpgp.c
diff options
context:
space:
mode:
Diffstat (limited to 'kbx/keybox-openpgp.c')
-rw-r--r--kbx/keybox-openpgp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kbx/keybox-openpgp.c b/kbx/keybox-openpgp.c
index e5f9f3352..ebeef517a 100644
--- a/kbx/keybox-openpgp.c
+++ b/kbx/keybox-openpgp.c
@@ -34,6 +34,7 @@
#include "keybox-defs.h"
#include <gcrypt.h>
+#include "../include/host2net.h"
enum packet_types
@@ -119,10 +120,8 @@ next_packet (unsigned char const **bufptr, size_t *buflen,
{
if (len <4 )
return gpg_error (GPG_ERR_INV_PACKET); /* No length bytes. */
- pktlen = (*buf++) << 24;
- pktlen |= (*buf++) << 16;
- pktlen |= (*buf++) << 8;
- pktlen |= (*buf++);
+ pktlen = buf32_to_ulong (buf);
+ buf += 4;
len -= 4;
}
else /* Partial length encoding is not allowed for key packets. */