31 May, 2016

1 commit

  • Pull crypto fixes from Herbert Xu:
    "This fixes the following issues:

    - missing selection in public_key that may result in a build failure

    - Potential crash in error path in omap-sham

    - ccp AES XTS bug that affects requests larger than 4096"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: ccp - Fix AES XTS error for request sizes above 4096
    crypto: public_key: select CRYPTO_AKCIPHER
    crypto: omap-sham - potential Oops on error in probe

    Linus Torvalds
     

23 May, 2016

1 commit


20 May, 2016

1 commit

  • Pull security subsystem updates from James Morris:
    "Highlights:

    - A new LSM, "LoadPin", from Kees Cook is added, which allows forcing
    of modules and firmware to be loaded from a specific device (this
    is from ChromeOS, where the device as a whole is verified
    cryptographically via dm-verity).

    This is disabled by default but can be configured to be enabled by
    default (don't do this if you don't know what you're doing).

    - Keys: allow authentication data to be stored in an asymmetric key.
    Lots of general fixes and updates.

    - SELinux: add restrictions for loading of kernel modules via
    finit_module(). Distinguish non-init user namespace capability
    checks. Apply execstack check on thread stacks"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (48 commits)
    LSM: LoadPin: provide enablement CONFIG
    Yama: use atomic allocations when reporting
    seccomp: Fix comment typo
    ima: add support for creating files using the mknodat syscall
    ima: fix ima_inode_post_setattr
    vfs: forbid write access when reading a file into memory
    fs: fix over-zealous use of "const"
    selinux: apply execstack check on thread stacks
    selinux: distinguish non-init user namespace capability checks
    LSM: LoadPin for kernel file loading restrictions
    fs: define a string representation of the kernel_read_file_id enumeration
    Yama: consolidate error reporting
    string_helpers: add kstrdup_quotable_file
    string_helpers: add kstrdup_quotable_cmdline
    string_helpers: add kstrdup_quotable
    selinux: check ss_initialized before revalidating an inode label
    selinux: delay inode label lookup as long as possible
    selinux: don't revalidate an inode's label when explicitly setting it
    selinux: Change bool variable name to index.
    KEYS: Add KEYCTL_DH_COMPUTE command
    ...

    Linus Torvalds
     

19 May, 2016

1 commit

  • In some rare randconfig builds, we can end up with
    ASYMMETRIC_PUBLIC_KEY_SUBTYPE enabled but CRYPTO_AKCIPHER disabled,
    which fails to link because of the reference to crypto_alloc_akcipher:

    crypto/built-in.o: In function `public_key_verify_signature':
    :(.text+0x110e4): undefined reference to `crypto_alloc_akcipher'

    This adds a Kconfig 'select' statement to ensure the dependency
    is always there.

    Cc:
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Herbert Xu

    Arnd Bergmann
     

18 May, 2016

1 commit

  • Pull crypto update from Herbert Xu:
    "API:

    - Crypto self tests can now be disabled at boot/run time.
    - Add async support to algif_aead.

    Algorithms:

    - A large number of fixes to MPI from Nicolai Stange.
    - Performance improvement for HMAC DRBG.

    Drivers:

    - Use generic crypto engine in omap-des.
    - Merge ppc4xx-rng and crypto4xx drivers.
    - Fix lockups in sun4i-ss driver by disabling IRQs.
    - Add DMA engine support to ccp.
    - Reenable talitos hash algorithms.
    - Add support for Hisilicon SoC RNG.
    - Add basic crypto driver for the MXC SCC.

    Others:

    - Do not allocate crypto hash tfm in NORECLAIM context in ecryptfs"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (77 commits)
    crypto: qat - change the adf_ctl_stop_devices to void
    crypto: caam - fix caam_jr_alloc() ret code
    crypto: vmx - comply with ABIs that specify vrsave as reserved.
    crypto: testmgr - Add a flag allowing the self-tests to be disabled at runtime.
    crypto: ccp - constify ccp_actions structure
    crypto: marvell/cesa - Use dma_pool_zalloc
    crypto: qat - make adf_vf_isr.c dependant on IOV config
    crypto: qat - Fix typo in comments
    lib: asn1_decoder - add MODULE_LICENSE("GPL")
    crypto: omap-sham - Use dma_request_chan() for requesting DMA channel
    crypto: omap-des - Use dma_request_chan() for requesting DMA channel
    crypto: omap-aes - Use dma_request_chan() for requesting DMA channel
    crypto: omap-des - Integrate with the crypto engine framework
    crypto: s5p-sss - fix incorrect usage of scatterlists api
    crypto: s5p-sss - Fix missed interrupts when working with 8 kB blocks
    crypto: s5p-sss - Use common BIT macro
    crypto: mxc-scc - fix unwinding in mxc_scc_crypto_register()
    crypto: mxc-scc - signedness bugs in mxc_scc_ablkcipher_req_init()
    crypto: talitos - fix ahash algorithms registration
    crypto: ccp - Ensure all dependencies are specified
    ...

    Linus Torvalds
     

11 May, 2016

1 commit


09 May, 2016

1 commit

  • As akcipher uses an SG interface, you must not use vmalloc memory
    as input for it. This patch fixes testmgr to copy the vmalloc
    test vectors to kmalloc memory before running the test.

    This patch also removes a superfluous sg_virt call in do_test_rsa.

    Cc:
    Reported-by: Anatoly Pugachev
    Signed-off-by: Herbert Xu

    Herbert Xu
     

05 May, 2016

3 commits


28 Apr, 2016

1 commit


15 Apr, 2016

2 commits

  • __GFP_REPEAT has a rather weak semantic but since it has been introduced
    around 2.6.12 it has been ignored for low order allocations.

    lzo_init uses __GFP_REPEAT to allocate LZO1X_MEM_COMPRESS 16K. This is
    order 3 allocation request and __GFP_REPEAT is ignored for this size
    as well as all
    Cc: "David S. Miller"
    Cc: linux-crypto@vger.kernel.org
    Signed-off-by: Michal Hocko
    Signed-off-by: Herbert Xu

    Michal Hocko
     
  • The output buffer length has to be at least as big as the key_size.
    It is then updated to the actual output size by the implementation.

    Cc:
    Signed-off-by: Tadeusz Struk
    Signed-off-by: Herbert Xu

    Tadeusz Struk
     

12 Apr, 2016

6 commits

  • Move the point at which a key is determined to be trustworthy to
    __key_link() so that we use the contents of the keyring being linked in to
    to determine whether the key being linked in is trusted or not.

    What is 'trusted' then becomes a matter of what's in the keyring.

    Currently, the test is done when the key is parsed, but given that at that
    point we can only sensibly refer to the contents of the system trusted
    keyring, we can only use that as the basis for working out the
    trustworthiness of a new key.

    With this change, a trusted keyring is a set of keys that once the
    trusted-only flag is set cannot be added to except by verification through
    one of the contained keys.

    Further, adding a key into a trusted keyring, whilst it might grant
    trustworthiness in the context of that keyring, does not automatically
    grant trustworthiness in the context of a second keyring to which it could
    be secondarily linked.

    To accomplish this, the authentication data associated with the key source
    must now be retained. For an X.509 cert, this means the contents of the
    AuthorityKeyIdentifier and the signature data.

    If system keyrings are disabled then restrict_link_by_builtin_trusted()
    resolves to restrict_link_reject(). The integrity digital signature code
    still works correctly with this as it was previously using
    KEY_FLAG_TRUSTED_ONLY, which doesn't permit anything to be added if there
    is no system keyring against which trust can be determined.

    Signed-off-by: David Howells

    David Howells
     
  • Make the system trusted keyring depend on the asymmetric key type as
    there's not a lot of point having it if you can't then load asymmetric keys
    onto it.

    This requires the ASYMMETRIC_KEY_TYPE to be made a bool, not a tristate, as
    the Kconfig language doesn't then correctly force ASYMMETRIC_KEY_TYPE to
    'y' rather than 'm' if SYSTEM_TRUSTED_KEYRING is 'y'.

    Making SYSTEM_TRUSTED_KEYRING *select* ASYMMETRIC_KEY_TYPE instead doesn't
    work as the Kconfig interpreter then wrongly complains about dependency
    loops.

    Signed-off-by: David Howells

    David Howells
     
  • Move the X.509 trust validation code out to its own file so that it can be
    generalised.

    Signed-off-by: David Howells

    David Howells
     
  • We should call verify_signature() rather than directly calling
    public_key_verify_signature() if we have a struct key to use as we
    shouldn't be poking around in the private data of the key struct as that's
    subtype dependent.

    Signed-off-by: David Howells

    David Howells
     
  • Generalise x509_request_asymmetric_key(). It doesn't really have any
    dependencies on X.509 features as it uses generalised IDs and the
    public_key structs that contain data extracted from X.509.

    Signed-off-by: David Howells

    David Howells
     
  • Move x509_request_asymmetric_key() to asymmetric_type.c so that it can be
    generalised.

    Signed-off-by: David Howells

    David Howells
     

06 Apr, 2016

9 commits

  • Make the determination of the trustworthiness of a key dependent on whether
    a key that can verify it is present in the supplied ring of trusted keys
    rather than whether or not the verifying key has KEY_FLAG_TRUSTED set.

    verify_pkcs7_signature() will return -ENOKEY if the PKCS#7 message trust
    chain cannot be verified.

    Signed-off-by: David Howells

    David Howells
     
  • Generalise system_verify_data() to provide access to internal content
    through a callback. This allows all the PKCS#7 stuff to be hidden inside
    this function and removed from the PE file parser and the PKCS#7 test key.

    If external content is not required, NULL should be passed as data to the
    function. If the callback is not required, that can be set to NULL.

    The function is now called verify_pkcs7_signature() to contrast with
    verify_pefile_signature() and the definitions of both have been moved into
    linux/verification.h along with the key_being_used_for enum.

    Signed-off-by: David Howells

    David Howells
     
  • There's a bug in the code determining whether a certificate is self-signed
    or not: if they have neither AKID nor SKID then we just assume that the
    cert is self-signed, which may not be true.

    Fix this by checking that the raw subject name matches the raw issuer name
    and that the public key algorithm for the key and signature are both the
    same in addition to requiring that the AKID bits match.

    Signed-off-by: David Howells

    David Howells
     
  • Extract the signature digest for an X.509 certificate earlier, at the end
    of x509_cert_parse() rather than leaving it to the callers thereof since it
    has to be called anyway.

    Further, immediately after that, check the signature on self-signed
    certificates, also rather in the callers of x509_cert_parse().

    We note in the x509_certificate struct the following bits of information:

    (1) Whether the signature is self-signed (even if we can't check the
    signature due to missing crypto).

    (2) Whether the key held in the certificate needs unsupported crypto to be
    used. We may get a PKCS#7 message with X.509 certs that we can't make
    use of - we just ignore them and give ENOPKG at the end it we couldn't
    verify anything if at least one of these unusable certs are in the
    chain of trust.

    (3) Whether the signature held in the certificate needs unsupported crypto
    to be checked. We can still use the key held in this certificate,
    even if we can't check the signature on it - if it is held in the
    system trusted keyring, for instance. We just can't add it to a ring
    of trusted keys or follow it further up the chain of trust.

    Making these checks earlier allows x509_check_signature() to be removed and
    replaced with direct calls to public_key_verify_signature().

    Signed-off-by: David Howells

    David Howells
     
  • Point to the public_key_signature struct from the pkcs7_signed_info struct
    rather than embedding it. This makes the code consistent with the X.509
    signature handling and makes it possible to have a common cleanup function.

    We also save a copy of the digest in the signature without sharing the
    memory with the crypto layer metadata.

    Signed-off-by: David Howells

    David Howells
     
  • Retain the key verification data (ie. the struct public_key_signature)
    including the digest and the key identifiers.

    Note that this means that we need to take a separate copy of the digest in
    x509_get_sig_params() rather than lumping it in with the crypto layer data.

    Signed-off-by: David Howells

    David Howells
     
  • Add key identifier pointers to public_key_signature struct so that they can
    be used to retain the identifier of the key to be used to verify the
    signature in both PKCS#7 and X.509.

    Signed-off-by: David Howells

    David Howells
     
  • Allow authentication data to be stored in an asymmetric key in the 4th
    element of the key payload and provide a way for it to be destroyed.

    For the public key subtype, this will be a public_key_signature struct.

    Signed-off-by: David Howells

    David Howells
     
  • Clean up some whitespace.

    Signed-off-by: David Howells

    David Howells
     

05 Apr, 2016

3 commits

  • The HMAC implementation allows setting the HMAC key independently from
    the hashing operation. Therefore, the key only needs to be set when a
    new key is generated.

    This patch increases the speed of the HMAC DRBG by at least 35% depending
    on the use case.

    The patch is fully CAVS tested.

    Signed-off-by: Stephan Mueller
    Signed-off-by: Herbert Xu

    Stephan Mueller
     
  • The OID_sha224 case is missing a break and it falls through
    to the -ENOPKG error default. Since HASH_ALGO_SHA224 seems
    to be supported, this looks like an unintentional missing break.

    Fixes: 07f081fb5057 ("PKCS#7: Add OIDs for sha224, sha284 and sha512 hash algos and use them")
    Cc: # 4.2+
    Signed-off-by: Colin Ian King
    Signed-off-by: Herbert Xu

    Colin Ian King
     
  • Following the async change for algif_skcipher
    this patch adds similar async read to algif_aead.

    changes in v3:
    - add call to aead_reset_ctx directly from aead_put_sgl instead of calling
    them separatelly one after the other
    - remove wait from aead_sock_destruct function as it is not needed
    when sock_hold is used

    changes in v2:
    - change internal data structures from fixed size arrays, limited to
    RSGL_MAX_ENTRIES, to linked list model with no artificial limitation.
    - use sock_kmalloc instead of kmalloc for memory allocation
    - use sock_hold instead of separate atomic ctr to wait for outstanding
    request

    Signed-off-by: Tadeusz Struk
    Signed-off-by: Herbert Xu

    Tadeusz Struk
     

31 Mar, 2016

1 commit


23 Mar, 2016

1 commit

  • Despite what the DocBook comment to pkcs7_validate_trust() says, the
    *_trusted argument is never set to false.

    pkcs7_validate_trust() only positively sets *_trusted upon encountering
    a trusted PKCS#7 SignedInfo block.

    This is quite unfortunate since its callers, system_verify_data() for
    example, depend on pkcs7_validate_trust() clearing *_trusted on non-trust.

    Indeed, UBSAN splats when attempting to load the uninitialized local
    variable 'trusted' from system_verify_data() in pkcs7_validate_trust():

    UBSAN: Undefined behaviour in crypto/asymmetric_keys/pkcs7_trust.c:194:14
    load of value 82 is not a valid value for type '_Bool'
    [...]
    Call Trace:
    [] dump_stack+0xbc/0x117
    [] ? _atomic_dec_and_lock+0x169/0x169
    [] ubsan_epilogue+0xd/0x4e
    [] __ubsan_handle_load_invalid_value+0x111/0x158
    [] ? val_to_string.constprop.12+0xcf/0xcf
    [] ? x509_request_asymmetric_key+0x114/0x370
    [] ? kfree+0x220/0x370
    [] ? public_key_verify_signature_2+0x32/0x50
    [] pkcs7_validate_trust+0x524/0x5f0
    [] system_verify_data+0xca/0x170
    [] ? top_trace_array+0x9b/0x9b
    [] ? __vfs_read+0x279/0x3d0
    [] mod_verify_sig+0x1ff/0x290
    [...]

    The implication is that pkcs7_validate_trust() effectively grants trust
    when it really shouldn't have.

    Fix this by explicitly setting *_trusted to false at the very beginning
    of pkcs7_validate_trust().

    Cc:
    Signed-off-by: Nicolai Stange
    Signed-off-by: Herbert Xu

    Nicolai Stange
     

19 Mar, 2016

1 commit

  • Merge second patch-bomb from Andrew Morton:

    - a couple of hotfixes

    - the rest of MM

    - a new timer slack control in procfs

    - a couple of procfs fixes

    - a few misc things

    - some printk tweaks

    - lib/ updates, notably to radix-tree.

    - add my and Nick Piggin's old userspace radix-tree test harness to
    tools/testing/radix-tree/. Matthew said it was a godsend during the
    radix-tree work he did.

    - a few code-size improvements, switching to __always_inline where gcc
    screwed up.

    - partially implement character sets in sscanf

    * emailed patches from Andrew Morton : (118 commits)
    sscanf: implement basic character sets
    lib/bug.c: use common WARN helper
    param: convert some "on"/"off" users to strtobool
    lib: add "on"/"off" support to kstrtobool
    lib: update single-char callers of strtobool()
    lib: move strtobool() to kstrtobool()
    include/linux/unaligned: force inlining of byteswap operations
    include/uapi/linux/byteorder, swab: force inlining of some byteswap operations
    include/asm-generic/atomic-long.h: force inlining of some atomic_long operations
    usb: common: convert to use match_string() helper
    ide: hpt366: convert to use match_string() helper
    ata: hpt366: convert to use match_string() helper
    power: ab8500: convert to use match_string() helper
    power: charger_manager: convert to use match_string() helper
    drm/edid: convert to use match_string() helper
    pinctrl: convert to use match_string() helper
    device property: convert to use match_string() helper
    lib/string: introduce match_string() helper
    radix-tree tests: add test for radix_tree_iter_next
    radix-tree tests: add regression3 test
    ...

    Linus Torvalds
     

18 Mar, 2016

3 commits

  • CMA allocation should be guaranteed to succeed by definition, but,
    unfortunately, it would be failed sometimes. It is hard to track down
    the problem, because it is related to page reference manipulation and we
    don't have any facility to analyze it.

    This patch adds tracepoints to track down page reference manipulation.
    With it, we can find exact reason of failure and can fix the problem.
    Following is an example of tracepoint output. (note: this example is
    stale version that printing flags as the number. Recent version will
    print it as human readable string.)

    -9018 [004] 92.678375: page_ref_set: pfn=0x17ac9 flags=0x0 count=1 mapcount=0 mapping=(nil) mt=4 val=1
    -9018 [004] 92.678378: kernel_stack:
    => get_page_from_freelist (ffffffff81176659)
    => __alloc_pages_nodemask (ffffffff81176d22)
    => alloc_pages_vma (ffffffff811bf675)
    => handle_mm_fault (ffffffff8119e693)
    => __do_page_fault (ffffffff810631ea)
    => trace_do_page_fault (ffffffff81063543)
    => do_async_page_fault (ffffffff8105c40a)
    => async_page_fault (ffffffff817581d8)
    [snip]
    -9018 [004] 92.678379: page_ref_mod: pfn=0x17ac9 flags=0x40048 count=2 mapcount=1 mapping=0xffff880015a78dc1 mt=4 val=1
    [snip]
    ...
    ...
    -9131 [001] 93.174468: test_pages_isolated: start_pfn=0x17800 end_pfn=0x17c00 fin_pfn=0x17ac9 ret=fail
    [snip]
    -9018 [004] 93.174843: page_ref_mod_and_test: pfn=0x17ac9 flags=0x40068 count=0 mapcount=0 mapping=0xffff880015a78dc1 mt=4 val=-1 ret=1
    => release_pages (ffffffff8117c9e4)
    => free_pages_and_swap_cache (ffffffff811b0697)
    => tlb_flush_mmu_free (ffffffff81199616)
    => tlb_finish_mmu (ffffffff8119a62c)
    => exit_mmap (ffffffff811a53f7)
    => mmput (ffffffff81073f47)
    => do_exit (ffffffff810794e9)
    => do_group_exit (ffffffff81079def)
    => SyS_exit_group (ffffffff81079e74)
    => entry_SYSCALL_64_fastpath (ffffffff817560b6)

    This output shows that problem comes from exit path. In exit path, to
    improve performance, pages are not freed immediately. They are gathered
    and processed by batch. During this process, migration cannot be
    possible and CMA allocation is failed. This problem is hard to find
    without this page reference tracepoint facility.

    Enabling this feature bloat kernel text 30 KB in my configuration.

    text data bss dec hex filename
    12127327 2243616 1507328 15878271 f2487f vmlinux_disabled
    12157208 2258880 1507328 15923416 f2f8d8 vmlinux_enabled

    Note that, due to header file dependency problem between mm.h and
    tracepoint.h, this feature has to open code the static key functions for
    tracepoints. Proposed by Steven Rostedt in following link.

    https://lkml.org/lkml/2015/12/9/699

    [arnd@arndb.de: crypto/async_pq: use __free_page() instead of put_page()]
    [iamjoonsoo.kim@lge.com: fix build failure for xtensa]
    [akpm@linux-foundation.org: tweak Kconfig text, per Vlastimil]
    Signed-off-by: Joonsoo Kim
    Acked-by: Michal Nazarewicz
    Acked-by: Vlastimil Babka
    Cc: Minchan Kim
    Cc: Mel Gorman
    Cc: "Kirill A. Shutemov"
    Cc: Sergey Senozhatsky
    Acked-by: Steven Rostedt
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joonsoo Kim
     
  • Pull security layer updates from James Morris:
    "There are a bunch of fixes to the TPM, IMA, and Keys code, with minor
    fixes scattered across the subsystem.

    IMA now requires signed policy, and that policy is also now measured
    and appraised"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (67 commits)
    X.509: Make algo identifiers text instead of enum
    akcipher: Move the RSA DER encoding check to the crypto layer
    crypto: Add hash param to pkcs1pad
    sign-file: fix build with CMS support disabled
    MAINTAINERS: update tpmdd urls
    MODSIGN: linux/string.h should be #included to get memcpy()
    certs: Fix misaligned data in extra certificate list
    X.509: Handle midnight alternative notation in GeneralizedTime
    X.509: Support leap seconds
    Handle ISO 8601 leap seconds and encodings of midnight in mktime64()
    X.509: Fix leap year handling again
    PKCS#7: fix unitialized boolean 'want'
    firmware: change kernel read fail to dev_dbg()
    KEYS: Use the symbol value for list size, updated by scripts/insert-sys-cert
    KEYS: Reserve an extra certificate symbol for inserting without recompiling
    modsign: hide openssl output in silent builds
    tpm_tis: fix build warning with tpm_tis_resume
    ima: require signed IMA policy
    ima: measure and appraise the IMA policy itself
    ima: load policy using path
    ...

    Linus Torvalds
     
  • Pull crypto update from Herbert Xu:
    "Here is the crypto update for 4.6:

    API:
    - Convert remaining crypto_hash users to shash or ahash, also convert
    blkcipher/ablkcipher users to skcipher.
    - Remove crypto_hash interface.
    - Remove crypto_pcomp interface.
    - Add crypto engine for async cipher drivers.
    - Add akcipher documentation.
    - Add skcipher documentation.

    Algorithms:
    - Rename crypto/crc32 to avoid name clash with lib/crc32.
    - Fix bug in keywrap where we zero the wrong pointer.

    Drivers:
    - Support T5/M5, T7/M7 SPARC CPUs in n2 hwrng driver.
    - Add PIC32 hwrng driver.
    - Support BCM6368 in bcm63xx hwrng driver.
    - Pack structs for 32-bit compat users in qat.
    - Use crypto engine in omap-aes.
    - Add support for sama5d2x SoCs in atmel-sha.
    - Make atmel-sha available again.
    - Make sahara hashing available again.
    - Make ccp hashing available again.
    - Make sha1-mb available again.
    - Add support for multiple devices in ccp.
    - Improve DMA performance in caam.
    - Add hashing support to rockchip"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (116 commits)
    crypto: qat - remove redundant arbiter configuration
    crypto: ux500 - fix checks of error code returned by devm_ioremap_resource()
    crypto: atmel - fix checks of error code returned by devm_ioremap_resource()
    crypto: qat - Change the definition of icp_qat_uof_regtype
    hwrng: exynos - use __maybe_unused to hide pm functions
    crypto: ccp - Add abstraction for device-specific calls
    crypto: ccp - CCP versioning support
    crypto: ccp - Support for multiple CCPs
    crypto: ccp - Remove check for x86 family and model
    crypto: ccp - memset request context to zero during import
    lib/mpi: use "static inline" instead of "extern inline"
    lib/mpi: avoid assembler warning
    hwrng: bcm63xx - fix non device tree compatibility
    crypto: testmgr - allow rfc3686 aes-ctr variants in fips mode.
    crypto: qat - The AE id should be less than the maximal AE number
    lib/mpi: Endianness fix
    crypto: rockchip - add hash support for crypto engine in rk3288
    crypto: xts - fix compile errors
    crypto: doc - add skcipher API documentation
    crypto: doc - update AEAD AD handling
    ...

    Linus Torvalds
     

04 Mar, 2016

3 commits

  • Make the identifier public key and digest algorithm fields text instead of
    enum.

    Signed-off-by: David Howells
    Acked-by: Herbert Xu

    David Howells
     
  • Move the RSA EMSA-PKCS1-v1_5 encoding from the asymmetric-key public_key
    subtype to the rsa crypto module's pkcs1pad template. This means that the
    public_key subtype no longer has any dependencies on public key type.

    To make this work, the following changes have been made:

    (1) The rsa pkcs1pad template is now used for RSA keys. This strips off the
    padding and returns just the message hash.

    (2) In a previous patch, the pkcs1pad template gained an optional second
    parameter that, if given, specifies the hash used. We now give this,
    and pkcs1pad checks the encoded message E(M) for the EMSA-PKCS1-v1_5
    encoding and verifies that the correct digest OID is present.

    (3) The crypto driver in crypto/asymmetric_keys/rsa.c is now reduced to
    something that doesn't care about what the encryption actually does
    and and has been merged into public_key.c.

    (4) CONFIG_PUBLIC_KEY_ALGO_RSA is gone. Module signing must set
    CONFIG_CRYPTO_RSA=y instead.

    Thoughts:

    (*) Should the encoding style (eg. raw, EMSA-PKCS1-v1_5) also be passed to
    the padding template? Should there be multiple padding templates
    registered that share most of the code?

    Signed-off-by: David Howells
    Signed-off-by: Tadeusz Struk
    Acked-by: Herbert Xu

    David Howells
     
  • This adds hash param to pkcs1pad.
    The pkcs1pad template can work with or without the hash.
    When hash param is provided then the verify operation will
    also verify the output against the known digest.

    Signed-off-by: Tadeusz Struk
    Signed-off-by: David Howells
    Acked-by: Herbert Xu

    Tadeusz Struk