]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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, 8 Apr 2020 15:30:54 +0000 (17:30 +0200)
commitf6c5ad8a5f534d73cba9c6bd794a89e879c46ecc
treeb856256e87cd6c58dffc315ba6768b6acc54a9a1
parent47c7e623546a7a33bd6bbddfb899fa9c9a40f40a
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