1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

104 Commits

Author SHA1 Message Date
fa64817e61
crypto/helper: Add secure wipe function
Adds a cryptographically secure wipe function to wipe structs with
sensitive data. Works by first casting the pointer to a `volatile`
pointer to ensure that the compiler doesn't optimize the "memset" away.
2018-11-07 09:38:08 +01:00
ed23bdf25a
crypto/helper: Change equals arguments to const 2018-10-21 20:27:33 +02:00
7d013eb2b6 sys: fix doxygen grouping 2018-06-11 19:12:02 +02:00
Gaëtan Harter
fa33eacd1f
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.
2018-05-07 15:08:00 +02:00
Gaëtan Harter
ee311a331b
crypto/ccm: refactor input_len check in a function
Refactorg checking that length can be stored in a number of bytes to a
subfunction.
2018-05-07 15:08:00 +02:00
Wentao Shang
89023b3499
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.
2018-05-07 15:08:00 +02:00
61f1b941ce make: replace curly braces with parenthesis 2018-03-22 20:43:15 +01:00
4ec8f4c2fc sys: instead of cpp-style, use C-style comments 2018-02-06 16:59:58 +01:00
Vincent Dupont
4f6fadbdc7 crypto/cbc: constify input buffers 2017-06-27 18:58:33 +02:00
Emmanuel Baccelli
6589c01aa0 sys/crypto: remove 3DES 2017-04-25 18:34:18 +02:00
Martine Lenders
62ca7f9242 crypto: fix cppcheck warnings 2017-04-14 14:36:14 +02:00
Oleg Hahm
c2893d4a88 sys: crypto: remove twofish and rc5 2017-01-15 14:53:43 +01:00
Mathias Tausig
3a3b26e70a ciphers: Added defines for return values of cipher_init() and [specific cipher]_init() functions
New definitions: CIPHER_INIT_SUCCESS and CIPHER_ERR_BAD_CONTEXT_SIZE
2016-10-04 13:01:38 +02:00
Oleg Hahm
b428979a1d debug: add missing line breaks 2016-09-27 23:38:41 +02:00
Cenk Gündoğan
e70c5d416e Merge pull request #4787 from BytesGalore/doc_crypto_add_word_on_required_cflags
doc crypto: add word on using required `CFLAGS`
2016-03-03 13:36:27 +01:00
9082273746 core: header cleanup 2016-02-28 22:46:28 +01:00
BytesGalore
d09ae8f384 doc crypto: add word on using required CFLAGS 2016-02-12 08:41:53 +01:00
Oleg Hahm
825ba72751 doc crypto: fixed typo and improved example 2016-02-11 11:44:57 +01:00
Oleg Hahm
51db509f7c sha256: move from crypto to hashes 2016-02-04 14:58:34 +01:00
René Kijewski
cecb4c8c56 crypto: remove skipjack support
Unused, unmaintained, buggy code for an unknown algorithm.
2015-09-25 00:05:18 +02:00
Oleg Hahm
a0957b11d6 Merge pull request #3926 from OlegHahm/some-scan-build-warnings
clean up: Some scan build warnings
2015-09-22 11:43:20 +02:00
René Kijewski
d2afdf5079 crypto: memcpy() in overlapping data in ccm
`memcpy()` must not be used if the input and output ranges overlap,
because it is undefined if the data if copied from front to the end or
vice versa.

Found via valgrind.
2015-09-22 11:01:56 +02:00
Oleg Hahm
e15bdd257a debug: replace __FILE__ by RIOT_RELATIVE_FILE 2015-09-20 01:51:47 +02:00
Oleg Hahm
fac95806a8 sys: replace DEBUGF with corresponding DEBUG calls 2015-09-20 01:51:47 +02:00
Oleg Hahm
4a8e897c0e doc: minor fixing for crypto module
Moves the crypto module documentation to the right group and streamline the doxygen keywords.
2015-08-26 10:42:50 +02:00
Oleg Hahm
4f4b924e6f crypto: replaced printf with DEBUGF
also getting rid of non-ISO compliant __FUNCTION__ macros
2015-08-04 17:47:40 +02:00
Nico von Geyso
4a4235c622 Unified Cipher API and Block cipher operation modes 2015-07-22 19:18:34 +02:00
René Kijewski
2cf4253710 sys: add ChaCha stream cipher and PRNG
This implementation is optimized for a little code and data size, not
for speed. IMO the code is more readable than in the reference
implementation.

The biggest advantage of ChaCha over other stream ciphers is the very
little data usage with only 64 bytes of context, and its good encryption
speed.

Also part of this PR is pseudo-random number generator, that just
returns the keystream of a randomly initialized ChaCha context.
2015-06-28 18:32:04 +02:00
Joakim Gebart
13832d8e62 everything: Remove filename from @file Doxygen command 2015-05-22 07:34:41 +02:00
Hinnerk van Bruinehsen
ff6a7febc6 lint: fix uselessAssignmentPtrArg 2014-10-31 01:24:30 +01:00
Hinnerk van Bruinehsen
ec98c85a05 lint: fix unusedVariable warnings
SQUASH ME: into unusedVariable (annotated)

SQUASH ME: into unusedVariable (II)

SQUASH ME: into unreadVariable (II)
2014-10-31 01:24:29 +01:00
Oleg Hahm
6d8c0d74c3 doc: some doxygen cleanups
* removed RIOT unrelated cpu documentation
* introduced cpu_specific prefix to mark such documentation
* put oneway_malloc and crypto into sys group
2014-10-23 17:29:25 +02:00
Hinnerk van Bruinehsen
57b998e4a1 cpu/examples/sys/drivers: reduce scope of variables 2014-09-13 19:03:40 +02:00
Ludwig Ortmann
b7992922ce fix license headers in non-.c files 2014-08-23 16:16:26 +02:00
Oleg Hahm
feca0d73c8 crypto: get rid of compiler warnings 2014-08-01 00:04:55 +02:00
Ludwig Ortmann
5fdce06b3b doc: use lgplv2.1-short license header instead of lgplv2-short-v1 2014-07-31 22:57:20 +02:00
Ludwig Ortmann
b6846e31fc doc: fix most occurences of FU as an author
.. but only if there are other authors as well
2014-07-29 17:23:11 +02:00
René Kijewski
840c0f0a57 make: detect their module name automatically
For many modules the `Makefile` contains a line like
```
MODULE:=$(shell basename $(CURDIR))
```
This conclusively shows that we do not have to set the module name
manually.

This PR removes the need to set the module name manually, if it is the
same as the basename. E.g. for `…/sys/vtimer/Makefile` the variable
make `MODULE` will still be `vtimer`, because it is the basename of the
Makefile.
2014-06-17 15:49:32 +02:00
René Kijewski
e94912f7be sys/crypo: fix function declarations
In #1119 old-style function declarations are exterminated and forbidden.
I missed the functions in `sys/crypto` because they weren't used
throughout the tests/examples before #1124.
2014-05-14 14:35:35 +02:00
René Kijewski
96fba8a19b sys:crypto: put ciphers into one module 2014-05-12 21:57:44 +02:00
René Kijewski
de29e4184c Add include paths automatocally for USEMODULES
Application developers use `$(USEMODULES)` in their Makefiles to have
the relevant functionally automagically added to their apps. This even
does basic dependency tracking by means of `Makefile.dep`.

But an important thing is missing: the automatic adding of include
paths. This is inconvenient, error prone, and will hinder the RIOT core
developers in future to change folder structures.
2014-03-29 16:27:55 +01:00
Ludwig Ortmann
6089de5ef2 Remove useless assert comments
address: https://github.com/RIOT-OS/RIOT/pull/824#issuecomment-36426297
2014-03-01 16:27:18 +01:00
Christian Mehlis
38529e3296 replace all endless for loops by while 2014-02-14 17:47:33 +01:00
Ludwig Ortmann
2525920426 remove trailing whitespace and newlines 2014-02-11 18:45:06 +01:00
Oleg Hahm
9f10d7dffc check for __BIG_ENDIAN__ rather than for __BYTE_ORDER__ and include board.h 2013-12-20 16:43:53 +01:00
Hauke Petersen
e866640646 Removed some redundant \0 string terminators 2013-12-19 13:33:06 +01:00
Hauke Petersen
6140caf055 Removed deprecated asserts from 3des and aes 2013-12-19 13:33:06 +01:00
Hauke Petersen
05419a5547 Initial import of crypto libs from SecureMicroMesh
- Imported files from secure micro mesh library
- added Makefiles and included libs into sys/Makefile
2013-12-19 13:33:06 +01:00
Christian Mehlis
df1755b912 fix broken warning 2013-08-20 09:58:46 +02:00
Christian Mehlis
618cb30e30 add the default wrapper for sha256 2013-08-12 19:39:54 +02:00
Christian Mehlis
6b22f479b1 add a barrier for msba2 due to wrong results 2013-08-12 10:01:48 +02:00
René Kijewski
eda3be3316 Fix byteorder problems 2013-08-12 10:01:48 +02:00
René Kijewski
dc669fbbb3 Eliminate multiline macros, embrace C99 2013-08-12 10:01:48 +02:00
Christian Mehlis
7d84936fd7 add sha256 implementation 2013-08-12 10:01:48 +02:00