[riot-commits] [RIOT-OS/RIOT] 89023b: crypto/ccm: fix input_len check

Gaëtan Harter hartergaetan at gmail.com
Wed May 9 18:56:36 CEST 2018


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 89023b349928a65d72b562e84031af3ab1236b8c
      https://github.com/RIOT-OS/RIOT/commit/89023b349928a65d72b562e84031af3ab1236b8c
  Author: Wentao Shang <wentaoshang at gmail.com>
  Date:   2018-05-07 (Mon, 07 May 2018)

  Changed paths:
    M sys/crypto/modes/ccm.c

  Log Message:
  -----------
  crypto/ccm: fix input_len check

Maximum input_len depends only on length_encoding and not auth_data_len.
The current length_max value was also wrong.

RFC3610 page 2

   3. The message m, consisting of a string of l(m) octets where 0 <=
      l(m) < 2^(8L).  The length restriction ensures that l(m) can be
      encoded in a field of L octets.


  Commit: a47e5e427e7f4ab0ae72db64d40c2d8dec373bce
      https://github.com/RIOT-OS/RIOT/commit/a47e5e427e7f4ab0ae72db64d40c2d8dec373bce
  Author: Gaëtan Harter <gaetan.harter at fu-berlin.de>
  Date:   2018-05-07 (Mon, 07 May 2018)

  Changed paths:
    M tests/unittests/tests-crypto/tests-crypto-modes-ccm.c

  Log Message:
  -----------
  tests/ccm: add test for input_len check


  Commit: ee311a331b5b82c667a5f02e5308a10b83498d46
      https://github.com/RIOT-OS/RIOT/commit/ee311a331b5b82c667a5f02e5308a10b83498d46
  Author: Gaëtan Harter <gaetan.harter at fu-berlin.de>
  Date:   2018-05-07 (Mon, 07 May 2018)

  Changed paths:
    M sys/crypto/modes/ccm.c

  Log Message:
  -----------
  crypto/ccm: refactor input_len check in a function

Refactorg checking that length can be stored in a number of bytes to a
subfunction.


  Commit: fa33eacd1f259bb8a4a04aba5ba0f9b061e413af
      https://github.com/RIOT-OS/RIOT/commit/fa33eacd1f259bb8a4a04aba5ba0f9b061e413af
  Author: Gaëtan Harter <gaetan.harter at fu-berlin.de>
  Date:   2018-05-07 (Mon, 07 May 2018)

  Changed paths:
    M sys/crypto/modes/ccm.c
    M tests/unittests/tests-crypto/tests-crypto-modes-ccm.c

  Log Message:
  -----------
  crypto/ccm: fix _fits_in_nbytes function

Function is broken with num_bytes >= 4.

Could happen when storing input_len with len_encoding >= 4.
It can take values from 2 to 8, so make it work for cases it would overflow.


  Commit: d0f22b787c8bc69f06cb0953f4d71c702c58eaf8
      https://github.com/RIOT-OS/RIOT/commit/d0f22b787c8bc69f06cb0953f4d71c702c58eaf8
  Author: Gaëtan Harter <hartergaetan at gmail.com>
  Date:   2018-05-09 (Wed, 09 May 2018)

  Changed paths:
    M sys/crypto/modes/ccm.c
    M tests/unittests/tests-crypto/tests-crypto-modes-ccm.c

  Log Message:
  -----------
  Merge pull request #8112 from cladmi/pr/crypto/input_len

crypto/ccm: fix input_len checking with length_encoding


Compare: https://github.com/RIOT-OS/RIOT/compare/96812341fc5e...d0f22b787c8b
      **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the commits mailing list