]> granicus.if.org Git - pdns/commitdiff
fix up endianness issue in our crypto hopefully
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Mar 2015 11:54:57 +0000 (12:54 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Mar 2015 11:54:57 +0000 (12:54 +0100)
pdns/sodcrypto.hh

index dd906903a59e3481b918e5cfe08cc4895ee5e008..8514dd722ac5cbd38cd7e1db7cf9d9a57384c06b 100644 (file)
@@ -23,8 +23,9 @@ struct SodiumNonce
   
   void increment()
   {
-    uint64_t* p = (uint64_t*)value;
-    (*p)++;
+    uint32_t* p = (uint32_t*)value;
+    uint32_t count=htonl(*p);
+    *p=ntohl(++count);
   }
 
   string toString() const