1. 13 5月, 2015 4 次提交
  2. 01 5月, 2015 1 次提交
    • D
      crypto: pcomp - Constify (de)compression parameters · f94a3597
      David Howells 提交于
      In testmgr, struct pcomp_testvec takes a non-const 'params' field, which is
      pointed to a const deflate_comp_params or deflate_decomp_params object.  With
      gcc-5 this incurs the following warnings:
      
      In file included from ../crypto/testmgr.c:44:0:
      ../crypto/testmgr.h:28736:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_comp_params,
                   ^
      ../crypto/testmgr.h:28748:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_comp_params,
                   ^
      ../crypto/testmgr.h:28776:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_decomp_params,
                   ^
      ../crypto/testmgr.h:28800:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_decomp_params,
                   ^
      
      Fix this by making the parameters pointer const and constifying the things
      that use it.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f94a3597
  3. 22 4月, 2015 6 次提交
  4. 21 4月, 2015 3 次提交
    • H
      crypto: rng - Introduce crypto_rng_generate · ff030b09
      Herbert Xu 提交于
      This patch adds the new top-level function crypto_rng_generate
      which generates random numbers with additional input.  It also
      extends the mid-level rng_gen_random function to take additional
      data as input.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      ff030b09
    • H
      crypto: rng - Convert crypto_rng to new style crypto_type · d0e83059
      Herbert Xu 提交于
      This patch converts the top-level crypto_rng to the "new" style.
      It was the last algorithm type added before we switched over
      to the new way of doing things exemplified by shash.
      
      All users will automatically switch over to the new interface.
      
      Note that this patch does not touch the low-level interface to
      rng implementations.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      d0e83059
    • S
      crypto: drbg - replace spinlock with mutex · 76899a41
      Stephan Mueller 提交于
      The creation of a shadow copy is intended to only hold a short term
      lock. But the drawback is that parallel users have a very similar DRBG
      state which only differs by a high-resolution time stamp.
      
      The DRBG will now hold a long term lock. Therefore, the lock is changed
      to a mutex which implies that the DRBG can only be used in process
      context.
      
      The lock now guards the instantiation as well as the entire DRBG
      generation operation. Therefore, multiple callers are fully serialized
      when generating a random number.
      
      As the locking is changed to use a long-term lock to avoid such similar
      DRBG states, the entire creation and maintenance of a shadow copy can be
      removed.
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      76899a41
  5. 10 4月, 2015 6 次提交
  6. 03 4月, 2015 1 次提交
  7. 24 3月, 2015 1 次提交
  8. 09 3月, 2015 1 次提交
  9. 04 2月, 2015 1 次提交
    • A
      crypto: switch af_alg_make_sg() to iov_iter · 1d10eb2f
      Al Viro 提交于
      With that, all ->sendmsg() instances are converted to iov_iter primitives
      and are agnostic wrt the kind of iov_iter they are working with.
      So's the last remaining ->recvmsg() instance that wasn't kind-agnostic yet.
      All ->sendmsg() and ->recvmsg() advance ->msg_iter by the amount actually
      copied and none of them modifies the underlying iovec, etc.
      
      Cc: linux-crypto@vger.kernel.org
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1d10eb2f
  10. 26 1月, 2015 1 次提交
  11. 22 12月, 2014 1 次提交
  12. 05 12月, 2014 1 次提交
  13. 17 11月, 2014 1 次提交
  14. 13 11月, 2014 4 次提交
  15. 14 10月, 2014 1 次提交
    • B
      crypto: LLVMLinux: Add macro to remove use of VLAIS in crypto code · a0a77af1
      Behan Webster 提交于
      Add a macro which replaces the use of a Variable Length Array In Struct (VLAIS)
      with a C99 compliant equivalent. This macro instead allocates the appropriate
      amount of memory using an char array.
      
      The new code can be compiled with both gcc and clang.
      
      struct shash_desc contains a flexible array member member ctx declared with
      CRYPTO_MINALIGN_ATTR, so sizeof(struct shash_desc) aligns the beginning
      of the array declared after struct shash_desc with long long.
      
      No trailing padding is required because it is not a struct type that can
      be used in an array.
      
      The CRYPTO_MINALIGN_ATTR is required so that desc is aligned with long long
      as would be the case for a struct containing a member with
      CRYPTO_MINALIGN_ATTR.
      
      If you want to get to the ctx at the end of the shash_desc as before you can do
      so using shash_desc_ctx(shash)
      Signed-off-by: NBehan Webster <behanw@converseincode.com>
      Reviewed-by: NMark Charlebois <charlebm@gmail.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Cc: Michał Mirosław <mirqus@gmail.com>
      a0a77af1
  16. 06 10月, 2014 1 次提交
  17. 17 9月, 2014 1 次提交
    • D
      KEYS: Overhaul key identification when searching for asymmetric keys · 46963b77
      David Howells 提交于
      Make use of the new match string preparsing to overhaul key identification
      when searching for asymmetric keys.  The following changes are made:
      
       (1) Use the previously created asymmetric_key_id struct to hold the following
           key IDs derived from the X.509 certificate or PKCS#7 message:
      
      	id: serial number + issuer
      	skid: subjKeyId + subject
      	authority: authKeyId + issuer
      
       (2) Replace the hex fingerprint attached to key->type_data[1] with an
           asymmetric_key_ids struct containing the id and the skid (if present).
      
       (3) Make the asymmetric_type match data preparse select one of two searches:
      
           (a) An iterative search for the key ID given if prefixed with "id:".  The
           	 prefix is expected to be followed by a hex string giving the ID to
           	 search for.  The criterion key ID is checked against all key IDs
           	 recorded on the key.
      
           (b) A direct search if the key ID is not prefixed with "id:".  This will
           	 look for an exact match on the key description.
      
       (4) Make x509_request_asymmetric_key() take a key ID.  This is then converted
           into "id:<hex>" and passed into keyring_search() where match preparsing
           will turn it back into a binary ID.
      
       (5) X.509 certificate verification then takes the authority key ID and looks
           up a key that matches it to find the public key for the certificate
           signature.
      
       (6) PKCS#7 certificate verification then takes the id key ID and looks up a
           key that matches it to find the public key for the signed information
           block signature.
      
      Additional changes:
      
       (1) Multiple subjKeyId and authKeyId values on an X.509 certificate cause the
           cert to be rejected with -EBADMSG.
      
       (2) The 'fingerprint' ID is gone.  This was primarily intended to convey PGP
           public key fingerprints.  If PGP is supported in future, this should
           generate a key ID that carries the fingerprint.
      
       (3) Th ca_keyid= kernel command line option is now converted to a key ID and
           used to match the authority key ID.  Possibly this should only match the
           actual authKeyId part and not the issuer as well.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NVivek Goyal <vgoyal@redhat.com>
      46963b77
  18. 05 9月, 2014 1 次提交
  19. 26 8月, 2014 1 次提交
  20. 25 8月, 2014 2 次提交
  21. 01 8月, 2014 1 次提交