02 Sep, 2009

1 commit


14 Jul, 2009

1 commit


19 Jun, 2009

2 commits


02 Jun, 2009

5 commits

  • At present, the tcrypt module always exits with an -EAGAIN upon
    successfully completing all the tests its been asked to run. In fips
    mode, integrity checking is done by running all self-tests from the
    initrd, and its much simpler to check the ret from modprobe for
    success than to scrape dmesg and/or /proc/crypto. Simply stay
    loaded, giving modprobe a retval of 0, if self-tests all pass and
    we're in fips mode.

    A side-effect of tracking success/failure for fips mode is that in
    non-fips mode, self-test failures will return the actual failure
    return codes, rather than always returning -EAGAIN, which seems more
    correct anyway.

    The tcrypt_test() portion of the patch is dependent on my earlier
    pair of patches that skip non-fips algs in fips mode, at least to
    achieve the fully intended behavior.

    Nb: testing this patch against the cryptodev tree revealed a test
    failure for sha384, which I have yet to look into...

    Signed-off-by: Jarod Wilson
    Acked-by: Neil Horman
    Signed-off-by: Herbert Xu

    Jarod Wilson
     
  • Now with multi-block test vectors, all from SP800-38A, Appendix F.5.
    Also added ctr(aes) to case 10 in tcrypt.

    Signed-off-by: Jarod Wilson
    Signed-off-by: Herbert Xu

    Jarod Wilson
     
  • Add ANSI X9.31 Continuous Pseudo-Random Number Generator (AES mode),
    aka 'ansi_cprng' test vectors, taken from Appendix B.2.9 and B.2.10
    of the NIST RNGVS document, found here:
    http://csrc.nist.gov/groups/STM/cavp/documents/rng/RNGVS.pdf

    Successfully tested against both the cryptodev-2.6 tree and a Red
    Hat Enterprise Linux 5.4 kernel, via 'modprobe tcrypt mode=150'.

    The selection of 150 was semi-arbitrary, didn't seem like it should
    go any place in particular, so I started a new range for rng tests.

    Signed-off-by: Jarod Wilson
    Acked-by: Neil Horman
    Signed-off-by: Herbert Xu

    Jarod Wilson
     
  • Add an array of encryption and decryption + verification self-tests
    for rfc4309(ccm(aes)).

    Test vectors all come from sample FIPS CAVS files provided to
    Red Hat by a testing lab. Unfortunately, all the published sample
    vectors in RFC 3610 and NIST Special Publication 800-38C contain nonce
    lengths that the kernel's rfc4309 implementation doesn't support, so
    while using some public domain vectors would have been preferred, its
    not possible at this time.

    Signed-off-by: Jarod Wilson
    Signed-off-by: Herbert Xu

    Jarod Wilson
     
  • Applying kernel janitors todos (printk calls need KERN_*
    constants on linebeginnings, reduce stack footprint where
    possible) to tcrypts test_hash_speed (where stacks
    memory footprint was very high (on i386 1184 bytes to
    160 now).

    Signed-off-by: Frank Seidel
    Acked-by: Neil Horman
    Signed-off-by: Herbert Xu

    Frank Seidel
     

04 Mar, 2009

1 commit


29 Aug, 2008

4 commits

  • This patch moves the newly created alg_test infrastructure into
    cryptomgr. This shall allow us to use it for testing at algorithm
    registrations.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch creates a new interface algorithm testing. A test can
    be requested for a particular implementation of an algorithm. This
    is achieved by taking both the name of the algorithm and that of
    the implementation.

    The all-inclusive test has also been rewritten to no longer require
    a duplicate listing of all algorithms with tests. In that process
    a number of missing tests have also been discovered and rectified.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • The info printed is a complete waste of space when there is no error
    since it doesn't tell us anything that we don't already know. If there
    is an error, we can also be more verbose.

    In case that there is an error, this patch also aborts the test and
    returns the error to the caller. In future this will be used to
    algorithms at registration time.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • If tcrypt is to be used as a run-time integrity test, it needs to be
    more resilient in a hostile environment. For a start allocating 32K
    of physically contiguous memory is definitely out.

    This patch teaches it to use separate pages instead.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

13 Aug, 2008

1 commit

  • My changeset 4b22f0ddb6564210c9ded7ba25b2a1007733e784

    crypto: tcrpyt - Remove unnecessary kmap/kunmap calls

    introduced a typo that broke AEAD chunk testing. In particular,
    axbuf should really be xbuf.

    There is also an issue with testing the last segment when encrypting.
    The additional part produced by AEAD wasn't tested. Similarly, on
    decryption the additional part of the AEAD input is mistaken for
    corruption.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

10 Jul, 2008

8 commits


08 Jul, 2008

1 commit

  • Coverity CID: 2306 & 2307 RESOURCE_LEAK

    In the second for loop in test_cipher(), data is allocated space with
    kzalloc() and is only ever freed in an error case.
    Looking at this loop, data is written to this memory but nothing seems
    to read from it.
    So here is a patch removing the allocation, I think this is the right
    fix.

    Only compile tested.

    Signed-off-by: Darren Jenkins
    Signed-off-by: Herbert Xu

    Darren Jenkins
     

21 Apr, 2008

5 commits

  • On Thu, Mar 27, 2008 at 03:40:36PM +0100, Bodo Eggert wrote:
    > Kamalesh Babulal wrote:
    >
    > > This patch cleanups the crypto code, replaces the init() and fini()
    > > with the _init/_fini
    >
    > This part ist OK.
    >
    > > or init/fini_ (if the
    > > _init/_fini exist)
    >
    > Having init_foo and foo_init won't be a good thing, will it? I'd start
    > confusing them.
    >
    > What about foo_modinit instead?

    Thanks for the suggestion, the init() is replaced with

    _mod_init ()

    and fini () is replaced with _mod_fini.

    Signed-off-by: Kamalesh Babulal
    Signed-off-by: Herbert Xu

    Kamalesh Babulal
     
  • Implement CTS wrapper for CBC mode required for support of AES
    encryption support for Kerberos (rfc3962).

    Signed-off-by: Kevin Coffman
    Signed-off-by: Herbert Xu

    Kevin Coffman
     
  • The test routines (test_{cipher,hash,aead}) are makeing a copy
    of the test template and are processing the encryption process
    in place. This patch changes the creation of the copy so it will
    work even if the source address of the input data isn't an array
    inside of the template but a pointer.

    Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • The speed templates as it look always the same. The key size
    is repeated for each block size and we test always the same
    block size. The addition of one inner loop makes it possible
    to get rid of the struct and it is possible to use a tiny
    u8 array :)

    Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • Some crypto ciphers which are impleneted support similar key sizes
    (16,24 & 32 byte). They can be grouped together and use a common
    templatte instead of their own which contains the same data.

    Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     

11 Jan, 2008

11 commits