1. 16 2月, 2010 1 次提交
  2. 31 8月, 2009 1 次提交
    • H
      crypto: api - Do not displace newly registered algorithms · 2bf29016
      Herbert Xu 提交于
      We have a mechanism where newly registered algorithms of a higher
      priority can displace existing instances that use a different
      implementation of the same algorithm with a lower priority.
      
      Unfortunately the same mechanism can cause a newly registered
      algorithm to displace itself if it depends on an existing version
      of the same algorithm.
      
      This patch fixes this by keeping all algorithms that the newly
      reigstered algorithm depends on, thus protecting them from being
      removed.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      2bf29016
  3. 29 8月, 2009 1 次提交
  4. 09 7月, 2009 1 次提交
  5. 08 7月, 2009 2 次提交
  6. 07 7月, 2009 1 次提交
  7. 28 1月, 2009 1 次提交
    • H
      crypto: api - Fix algorithm test race that broke aead initialisation · b8e15992
      Herbert Xu 提交于
      When we complete a test we'll notify everyone waiting on it, drop
      the mutex, and then remove the test larval (after reacquiring the
      mutex).  If one of the notified parties tries to register another
      algorithm with the same driver name prior to the removal of the
      test larval, they will fail with EEXIST as only one algorithm of
      a given name can be tested at any time.
      
      This broke the initialisation of aead and givcipher algorithms as
      they will register two algorithms with the same driver name, in
      sequence.
      
      This patch fixes the problem by marking the larval as dead before
      we drop the mutex, and also ignoring all dead or dying algorithms
      on the registration path.
      Tested-by: NAndreas Steffen <andreas.steffen@strongswan.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      b8e15992
  8. 29 8月, 2008 2 次提交
  9. 11 1月, 2008 2 次提交
    • H
      [CRYPTO] api: Add crypto_attr_alg_name · 68b6c7d6
      Herbert Xu 提交于
      This patch adds a new helper crypto_attr_alg_name which is basically the
      first half of crypto_attr_alg.  That is, it returns an algorithm name
      parameter as a string without looking it up.  The caller can then look it
      up immediately or defer it until later.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      68b6c7d6
    • H
      [CRYPTO] api: Add crypto_inc and crypto_xor · 7613636d
      Herbert Xu 提交于
      With the addition of more stream ciphers we need to curb the proliferation
      of ad-hoc xor functions.  This patch creates a generic pair of functions,
      crypto_inc and crypto_xor which does big-endian increment and exclusive or,
      respectively.
      
      For optimum performance, they both use u32 operations so alignment must be
      as that of u32 even though the arguments are of type u8 *.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      7613636d
  10. 23 11月, 2007 1 次提交
    • H
      [CRYPTO] api: Fix potential race in crypto_remove_spawn · 38cb2419
      Herbert Xu 提交于
      As it is crypto_remove_spawn may try to unregister an instance which is
      yet to be registered.  This patch fixes this by checking whether the
      instance has been registered before attempting to remove it.
      
      It also removes a bogus cra_destroy check in crypto_register_instance as
      1) it's outside the mutex;
      2) we have a check in __crypto_register_alg already.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      38cb2419
  11. 11 10月, 2007 4 次提交
    • H
      [CRYPTO] api: Explain the comparison on larval cra_name · d8058480
      Herbert Xu 提交于
      This patch adds a comment to explain why we compare the cra_driver_name of
      the algorithm being registered against the cra_name of a larval as opposed
      to the cra_driver_name of the larval.
      
      In fact larvals have only one name, cra_name which is the name that was
      requested by the user.  The test here is simply trying to find out whether
      the algorithm being registered can or can not satisfy the larval.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      d8058480
    • H
      [CRYPTO] blkcipher: Remove alignment restriction on block size · 70613783
      Herbert Xu 提交于
      Previously we assumed for convenience that the block size is a multiple of
      the algorithm's required alignment.  With the pending addition of CTR this
      will no longer be the case as the block size will be 1 due to it being a
      stream cipher.  However, the alignment requirement will be that of the
      underlying implementation which will most likely be greater than 1.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      70613783
    • H
      [CRYPTO] aead: Add authenc · 3c09f17c
      Herbert Xu 提交于
      This patch adds the authenc algorithm which constructs an AEAD algorithm
      from an asynchronous block cipher and a hash.  The construction is done
      by concatenating the encrypted result from the cipher with the output
      from the hash, as is used by the IPsec ESP protocol.
      
      The authenc algorithm exists as a template with four parameters:
      
      	authenc(auth, authsize, enc, enckeylen).
      
      The authentication algorithm, the authentication size (i.e., truncating
      the output of the authentication algorithm), the encryption algorithm,
      and the encryption key length.  Both the size field and the key length
      field are in bytes.  For example, AES-128 with SHA1-HMAC would be
      represented by
      
      	authenc(hmac(sha1), 12, cbc(aes), 16)
      
      The key for the authenc algorithm is the concatenation of the keys for
      the authentication algorithm with the encryption algorithm.  For the
      above example, if a key of length 36 bytes is given, then hmac(sha1)
      would receive the first 20 bytes while the last 16 would be given to
      cbc(aes).
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3c09f17c
    • H
      [CRYPTO] api: Add support for multiple template parameters · 39e1ee01
      Herbert Xu 提交于
      This patch adds support for having multiple parameters to
      a template, separated by a comma.  It also adds support
      for integer parameters in addition to the current algorithm
      parameter type.
      
      This will be used by the authenc template which will have
      four parameters: the authentication algorithm, the encryption
      algorithm, the authentication size and the encryption key
      length.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      39e1ee01
  12. 11 7月, 2007 1 次提交
  13. 02 5月, 2007 3 次提交
    • H
      [CRYPTO] api: Do not remove users unless new algorithm matches · a73e6996
      Herbert Xu 提交于
      As it is whenever a new algorithm with the same name is registered
      users of the old algorithm will be removed so that they can take
      advantage of the new algorithm.  This presents a problem when the
      new algorithm is not equivalent to the old algorithm.  In particular,
      the new algorithm might only function on top of the existing one.
      
      Hence we should not remove users unless they can make use of the
      new algorithm.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      a73e6996
    • H
      [CRYPTO] api: Add async blkcipher type · b5b7f088
      Herbert Xu 提交于
      This patch adds the mid-level interface for asynchronous block ciphers.
      It also includes a generic queueing mechanism that can be used by other
      asynchronous crypto operations in future.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      b5b7f088
    • H
      [CRYPTO] templates: Pass type/mask when creating instances · ebc610e5
      Herbert Xu 提交于
      This patch passes the type/mask along when constructing instances of
      templates.  This is in preparation for templates that may support
      multiple types of instances depending on what is requested.  For example,
      the planned software async crypto driver will use this construct.
      
      For the moment this allows us to check whether the instance constructed
      is of the correct type and avoid returning success if the type does not
      match.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      ebc610e5
  14. 07 2月, 2007 3 次提交
  15. 21 9月, 2006 6 次提交