From 04b0b195a89a78b4dbaf58c6382e58def91954f2 Mon Sep 17 00:00:00 2001 From: Alex Hornung Date: Thu, 9 Aug 2012 20:55:55 +0100 Subject: [PATCH] hammer2 - make gcm IV counter endian-agnostic --- sbin/hammer2/crypto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/hammer2/crypto.c b/sbin/hammer2/crypto.c index 79463e8166..43be4aced9 100644 --- a/sbin/hammer2/crypto.c +++ b/sbin/hammer2/crypto.c @@ -35,6 +35,7 @@ */ #include "hammer2.h" +#include /* * Setup crypto for pthreads @@ -169,7 +170,7 @@ _gcm_iv_increment(char *iv) * XXX: this should ideally be an atomic update, but we don't have * an atomic_fetchadd_64 for i386 yet */ - *c = (*c)+1; + *c = htobe64(be64toh(*c)+1); /* * Detect wrap-around, which means it is time to renegotiate -- 2.15.1