]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
msg/async/crypto_onwire: fix endianness of nonce_t
authorIlya Dryomov <idryomov@gmail.com>
Fri, 6 Mar 2020 19:16:45 +0000 (20:16 +0100)
committerAbhishek Lekshmanan <abhishek@suse.com>
Wed, 6 May 2020 07:54:56 +0000 (09:54 +0200)
commit1a089879dc9f5aeb4e43f173595607a5cafcdcf4
tree75ba39e7573ab04d6062f6c089efbf51219f6330
parentbb61e6a5adc328ebdc78ae6c275a2f470778a3a8
msg/async/crypto_onwire: fix endianness of nonce_t

As a AES-GCM IV, nonce_t is implicitly shared between server and
client.  Currently, if their endianness doesn't match, they are unable
to communicate in secure mode because each gets its own idea of what
the next nonce should be after the counter is incremented.

Several RFCs state that the nonce counter should be BE, but since we
use LE for everything on-disk and on-wire, make it LE.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
src/msg/async/crypto_onwire.cc