crypto: replace 'des-rfb' cipher with 'des'
commit83bee4b51fad383c1ee9b9f58fefb90fddae1c00
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 29 Jun 2021 13:25:32 +0000 (29 14:25 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 14 Jul 2021 13:15:52 +0000 (14 14:15 +0100)
tree3418b2fffe3aa484830c0397619f4cedbc291a73
parent6801404429d51b260e08c6ad54dbf3ac430016db
crypto: replace 'des-rfb' cipher with 'des'

Currently the crypto layer exposes support for a 'des-rfb'
algorithm which is just normal single-DES, with the bits
in each key byte reversed. This special key munging is
required by the RFB protocol password authentication
mechanism.

Since the crypto layer is generic shared code, it makes
more sense to do the key byte munging in the VNC server
code, and expose normal single-DES support.

Replacing cipher 'des-rfb' by 'des' looks like an incompatible
interface change, but it doesn't matter.  While the QMP schema
allows any QCryptoCipherAlgorithm for the 'cipher-alg' field
in QCryptoBlockCreateOptionsLUKS, the code restricts what can
be used at runtime. Thus the only effect is a change in error
message.

Original behaviour:

 $ qemu-img create -f luks --object secret,id=sec0,data=123 -o cipher-alg=des-rfb,key-secret=sec0 demo.luks 1G
 Formatting 'demo.luks', fmt=luks size=1073741824 key-secret=sec0 cipher-alg=des-rfb
 qemu-img: demo.luks: Algorithm 'des-rfb' not supported

New behaviour:

 $ qemu-img create -f luks --object secret,id=sec0,data=123 -o cipher-alg=des-rfb,key-secret=sec0 demo.luks 1G
 Formatting 'demo.luks', fmt=luks size=1073741824 key-secret=sec0 cipher-alg=des-fish
 qemu-img: demo.luks: Invalid parameter 'des-rfb'

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
crypto/cipher-gcrypt.c.inc
crypto/cipher-nettle.c.inc
crypto/cipher.c
qapi/crypto.json
tests/unit/test-crypto-cipher.c
ui/vnc.c