1. 23 10月, 2015 3 次提交
    • D
      crypto: add sanity checking of plaintext/ciphertext length · 3a661f1e
      Daniel P. Berrange 提交于
      When encrypting/decrypting data, the plaintext/ciphertext
      buffers are required to be a multiple of the cipher block
      size. If this is not done, nettle will abort and gcrypt
      will report an error. To get consistent behaviour add
      explicit checks upfront for the buffer sizes.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3a661f1e
    • D
      crypto: don't let builtin aes crash if no IV is provided · eb2a770b
      Daniel P. Berrange 提交于
      If no IV is provided, then use a default IV of all-zeros
      instead of crashing. This gives parity with gcrypt and
      nettle backends.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      eb2a770b
    • D
      crypto: allow use of nettle/gcrypt to be selected explicitly · 91bfcdb0
      Daniel P. Berrange 提交于
      Currently the choice of whether to use nettle or gcrypt is
      made based on what gnutls is linked to. There are times
      when it is desirable to be able to force build against a
      specific library. For example, if testing changes to QEMU's
      crypto code all 3 possible backends need to be checked
      regardless of what the local gnutls uses.
      
      It is also desirable to be able to enable nettle/gcrypt
      for cipher/hash algorithms, without enabling gnutls
      for TLS support.
      
      This gives two new configure flags, which allow the
      following possibilities
      
      Automatically determine nettle vs gcrypt from what
      gnutls links to (recommended to minimize number of
      crypto libraries linked to)
      
       ./configure
      
      Automatically determine nettle vs gcrypt based on
      which is installed
      
       ./configure --disable-gnutls
      
      Force use of nettle
      
       ./configure --enable-nettle
      
      Force use of gcrypt
      
       ./configure --enable-gcrypt
      
      Force use of built-in AES & crippled-DES
      
       ./configure --disable-nettle --disable-gcrypt
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      91bfcdb0
  2. 22 10月, 2015 37 次提交