Commit Graph

30 Commits

Author SHA1 Message Date
Nathaniel Wesley Filardo b4f2686567 crypto: remove toHex and toBase64 (#3300)
We marked these for deprecation in favor of the functions of the same
name in encoder.  Let's actually make good on that.
2020-11-07 16:23:43 +01:00
Terry Ellison 1f2e5bba4a
Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
Terry Ellison bbeb09b695 Squashed updates do get Lua51 and Lua53 working (#3075)
-  Lots of minor but nasty bugfixes to get all tests to run clean
-  core lua and test suite fixes to allow luac -F to run cleanly against test suite
-  next tranch to get LFS working
-  luac.cross -a options plus fixes from feedback
-  UART fixes and lua.c merge
-  commit of wip prior to rebaselining against current dev
-  more tweaks
2020-06-09 22:26:52 +02:00
Nathaniel Wesley Filardo 282ebd100d Deprecate crypto.to{Hex,Base64} (#2929)
The internal implementation already preferentially forwards to the
encoder module, so we should just remove these functions as they confuse
people into thinking that we don't have their inverses (see the feature
request https://github.com/nodemcu/nodemcu-firmware/issues/2907).

Update the docs to refer to the encoder version and add deprecation
warnings to the runtime implementations.
2020-06-09 22:26:06 +02:00
Johny Mattsson f7a545b951
Evict c_types.h, tidy up a other c_prefixes. (#2841) 2019-07-23 14:22:38 +10:00
Johny Mattsson 526d21dab4 Major cleanup - c_whatever is finally history. (#2838)
The PR removed the bulk of non-newlib headers from the NodeMCU source base.  
app/libc has now been cut down to the bare minimum overrides to shadow the 
corresponding functions in the SDK's libc. The old c_xyz.h headerfiles have been 
nuked in favour of the standard <xyz.h> headers, with a few exceptions over in 
sdk-overrides. Again, shipping a libc.a without headers is a terrible thing to do. We're 
still living on a prayer that libc was configured the same was as a default-configured
xtensa gcc toolchain assumes it is. That part I cannot do anything about, unfortunately, 
but it's no worse than it has been before.

This enables our source files to compile successfully using the standard header files, 
and use the typical malloc()/calloc()/realloc()/free(), the strwhatever()s and 
memwhatever()s. These end up, through macro and linker magic, mapped to the 
appropriate SDK or ROM functions.
2019-07-22 00:58:21 +03:00
Terry Ellison 1990f95740
Updated ROTables 1st tranch (#2742)
Updated ROTables
2019-05-08 14:08:20 +03:00
Terry Ellison fc94439b74 crypto.c: Clarify comments on use of userdata for header + context + key opad blocks 2019-04-08 13:57:46 +01:00
Terry Ellison 528973548c fix EM:0 error, and other memory leaks, plus minor typos in doc 2019-04-05 18:23:13 +01:00
sergio d77666c0e8 trailing spaces cleanup (#2659) 2019-02-17 18:26:29 +00:00
kicer 118acb808e Fix crypto.mask() to encode with correct mask (#1677) (#1678)
Thank you.
2016-12-23 12:03:02 -05:00
Johny Mattsson a112296850 Added crypto.new_hmac() feature. (#1499)
Docs for crypto module refactored for easier maintenance.
2016-09-16 17:46:39 +02:00
Arnim Läuger ecf8bd98d6 Add FatFs and SD card support (#1397)
* Add FatFs
* enable BUILD_FATFS for all-module build
* push vfs into rest of firmware
* align maximum filename length
* increase timeout for acmd41 during card initialization
* switch from DOS to Unix path semantics chdrive() is substituted by chdir()
* update to fatfs R.012a incl. patches 1-6
* add callback for rtc provisioning in file
* update docs
2016-09-05 20:17:13 +02:00
Bernd Meyer f2991f555d Remove improper free of userdata; It's for the garbage collection to free 2016-03-30 12:35:06 +11:00
Johny Mattsson 88369a5bd3 Merge pull request #1072 from TerryE/dev-encoder
Addition of encoder module with base64 and hex encode/decode as per #925
2016-02-26 12:35:02 +11:00
TerryE 8353991722 Update encoder files after #925 & #1072 review comments 2016-02-26 00:44:33 +00:00
Adam Bonner 96f905bf81 Crypto-new_hash Improved code based on review in #1037 2016-02-21 21:13:06 -08:00
Adam Bonner 332b53b9db Initial implementation of a chunk capable hash function in crypto module 2016-02-21 21:13:06 -08:00
TerryE ffa7ee9b67 Addition of encoder module with bas64 and hex encode/decode as per #925 2016-02-21 04:18:27 +00:00
cheloftus 58dd15e1d1 Added crypto.fhash function for hashing files 2016-02-05 22:19:00 +00:00
Johny Mattsson 5b381d2f1e Added AES support to crypto module.
Merely a wrapper around the (undocumented) internal SDK AES functions.
2016-01-19 15:19:11 +11:00
Johny Mattsson 4e8ef87d03 Reworked module registration, removed modules.h
Module creation & registration now made a lot simpler. In essence,
each module file is now self-contained and only needs a

  NODEMCU_MODULE(MYNAME, "myname", myname_map, luaopen_myname);

line to both be automatically recognised by the Lua initialization
as well as honor the LUA_USE_MODULES_MYNAME #define.
2015-12-16 16:09:16 +11:00
TerryE b773290b8c Major cleanup of module registration pass 2.
carrying on Johny's edits as per my comments on #810
2015-12-16 11:21:40 +11:00
Johny Mattsson 6b6456be47 Major cleanup of module registration.
As per #810 & #796, only LUA_OPTIMIZE_MEMORY=2 & MIN_OPT_LEVEL=2 are
supported when building. This commit effects that limitation.

With this change modules/auxmods.h no longer needs to be updated for
every new module, nor do module writers need to cater for a hypothetical
LUA_OPTIMIZE_MEMORY < 2 scenario.
2015-12-12 15:03:40 +11:00
Johny Mattsson 7867fd083c Move crypto things to irom0.text segment.
This releases 1168 bytes back to the heap.
2015-06-05 13:03:08 +10:00
Johny Mattsson 2d1e69151e Extended Lua crypto module with hash & hmac. 2015-06-02 18:17:30 +10:00
= 2128c42f02 Add headers for discovered rom functions 2015-05-28 15:10:12 -05:00
= 59df376a3a Rename base64Encode to toBase64 and hexEncode to toHex 2015-05-28 09:00:13 -05:00
= c8145434c3 Add crypto.hexEncode and crypto.mask 2015-05-28 07:47:09 -05:00
= ca78b9ea2c Add crypto module initially containing sha1 and base64_encode. 2015-05-28 07:46:57 -05:00