forked from jeelabs/esp-link
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep this function, as the one from the library appears to crash.
- Loading branch information
1 parent
848c973
commit d7f58e2
Showing
3 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef BASE64_H | ||
#define BASE64_H | ||
|
||
int base64_decode(size_t in_len, const char *in, size_t out_len, unsigned char *out); | ||
int my_base64_decode(size_t in_len, const char *in, size_t out_len, unsigned char *out); | ||
|
||
#endif | ||
#endif |
d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered if we would need to do this. (is it me or does my_function make you think of writing your first code?)
I couldn't find the source for the ssl library - do you know where I can find it?
The esp library is a bit large, I'm hoping we can use a skeleton version of it to keep the build smaller.
By the way - how did it function? As expected?
d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dannybackx This might be a worthwhile read esp8266/Arduino#43
Doing this all from my cell right now, so taking some time to go through it all.
d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well looky here...
https://drive.google.com/file/d/0B9AEI0achpAGVDFwWkpXRnRDTlE/view?usp=drivesdk
This pdf should be more than enough.
Looks like memory constraints are going to be tough.
If it does not already, certificates will likely need to by streamed from filesystem and not stored in memory.
d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know about the espressif docs. The SSL manual doesn't say much. If you look at example code, you'll see that you mostly need to replace espconn_xx calls by espconn_secure_xx calls.
I have code sitting on my disk for that, but it doesn't work. I will read the esp8266/Arduino#43 and will do some more tests, but for me this is not priority jeelabs#1.
I would categorise as jeelabs#1 to finish what we talked about yesterday, and jeelabs#2 talk this through with @tve so it gets picked up. Only jeelabs#3 is getting SSL to work.
Agree ?
d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And yes, to get SSL support in order, storing keys/certificates in the filesystem is required.
Did it work ? To some extent, yes. I need to do more testing. Things weren't stable and I'm not sure why.
An obvious problem with the construction in main.c is that the (HTML/JavaScript) UI does some calls such as the JSON you referred to; securing these should not result in a UI that stops working.
d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to investigate whether I am right on that paragraph. Tomorrow. It's after midnight now, just back from volleyball and off to bed... Don't know where you're located, I'm in Belgium.
The old implementation is insecure, so offering to close those ports or to password-protect them is a
bonus.
Argument against that : the only conflicts are with questionable elements ("hacks") in the source code.
Example : if you would state that communication between the ESP and Arduino need to be secure,
then you're defending against someone with physical hardware access.
This would be wrong : if someone already has physical access, then you have other problems.
To translate my example to your question : I think we need to assess which services in main.c to
(password-)protect and see if we can consistently implement that.
That's an order of magnitude more important (security wise) than hashing a password.
Just my analysis. Please comment.
d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, that's my fault for not being more clear.
I meant to refer to username/pass required to visit the webpage.
My only thought here is that tve appears to be a very detailed analyzer - I also know he mentioned reduction of RAM & other space limitations. So needlessly having it in the build only increases it's size.
Yes, of course. My first approach to the security was trying to take into account physical access - but really, there's very little you can do to prevent someone cracking/extracting your code with physical access to the device. Once I got that line of thought out of my head, I tried to focus on remote access security
With that in mind, I plan to:
As far as consistently implementing an 'authBasic' login into the webpage, this is quite easy to do via the main.c The rules are applied in a top->bottom scheme, so just placing a line similar to
{"/telnet.html", authBasic, myPassFn},
above the page your protecting is all it should take.d7f58e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with your line of thought, including removal of ssl from Makefile for now.
So go ahead with changes.