Commit Graph

23 Commits

Author SHA1 Message Date
Gregg 9209cb6b41 Completed Pair-Setup M3 update 2023-12-28 11:13:34 -06:00
Gregg 6979ab8080 In process of updated Pair-Setup M3...
Cleaning up code by replacing calls to mbedTLS within Pair-Setup with arguments passed to/from SRP6A.  Much better and better encapsulates SRP6A
2023-12-28 07:04:07 -06:00
Gregg c529f93646 Moved definitions of N3072 and other constants into SRP6A structure 2023-12-27 21:45:09 -06:00
Gregg b960c2fdaf Initial integration of local SRP6A into Pair Setup 2023-12-27 17:13:32 -06:00
Gregg da55b9b6b1 Start re-working SRP6A's use in Pair-Setup to make it local instead of global 2023-12-27 14:31:22 -06:00
Gregg 6280c17154 Removed all old TLV code 2023-12-25 22:17:08 -06:00
Gregg 3c172da714 Completed and fully tested refactoring of TLV8
Next up: remove old TLV code and clean up
2023-12-25 22:04:02 -06:00
Gregg 70126cb04f Eliminated .get() from TempBuffer objects where possible
Stylistic only.  Cannot remove .get() when a TempBuffer is being re-cast.  Also can't remove .get() when cast can't be determined, such as when used in Serial.printf() [potential to do: explore if this can be addressed, though this is stylistic only and has no impact on code]
2023-11-25 16:48:23 -06:00
Gregg f6ebc1ae22 Changed various static and dynamic stack-based buffers to TempBuffer
Also added casting overload to TempBuffer so that get() method is no longer needed
2023-11-25 16:13:24 -06:00
Gregg 7bc885dd26 Completed initial migration of Serial.print to LOG0
Finished all applicable cases in main source code.
TO DO: apply LOG0 to extras
2023-05-10 22:12:21 -05:00
Gregg 66bb13af03 Continued change from Serial.print to LOG0() 2023-05-08 22:43:42 -05:00
Gregg 88897ee085 Updated copyright dates on source code 2023-02-04 11:41:57 -06:00
Gregg 02d841390c Updated License Dates 2022-02-20 13:05:03 -06:00
Gregg 07da5ac924 Updated SRP code for 2.0.0 compatibility
Arduino-ESP32 has modified the Mbed TLS library so that it uses ESP32 hardware acceleration.  However, there is a 512-byte limit to the size of the variables used in an exponential modulo calculation.  One of the steps in the SRP code used a 768-byte variable, which cannot be handled in version 2.0.0 though it works fine in version 1.0.6.  Solution was to simply reduce the 768-byte variable by modulo N prior to performing the exponential modulo calculation.
2021-09-23 21:12:37 -05:00
Gregg 5496503afd Added version info for sodium and mbedtls
Also, fixed "bug" in SRP route (did not impact function - just a generated less random numbers than expected).
2021-09-19 22:07:34 -05:00
Gregg 170f972d3b Fixed bug in pairing logic that would drop leading zeros when transmitting SALT
A 16-byte SALT with a leading zero would be sent as only a 15-byte number.  The chance of this occuring is 1 in 256, which is small but still significant.  Solution is to specify required size of MPI output in loadTLV.  This forces mbedtls_mpi_write_binary() to pad with leading zeros.

Also eliminated unused code (TLV pack_old).
2021-02-06 16:29:55 -06:00
Gregg 78cbd926f1 Updated licenses and version number
Change copyright years to 2020-2021, and updated version number to 1.1.4 in preparation for next patch.
2021-01-24 12:02:24 -06:00
Gregg 750a658241 Added new method homeSpan.setPortNum(port)
HomeSpan defaults to running the HAP Server on port 80 (the standard HTTP port).  This method allows the user to over-ride the default and have HomeSpan run the HAP Server on any other port.

ALSO:  In updating this portion of the code, identified an additional parameter to the ESP32 version of WiFiServer that allows one to specify the number of simultaneous Server connections.  The ESP32 default is 4, which suggests that the ESP32 was internally juggling connections that HomeSpan was keeping open (since the HomeSpan default is 8 connections).

This WiFiServer call has been updated to now specify both the port number AND the number of maximum simultaneous connections (to match whatever has been set by HomeSpan).  This may or may not result in improving performance when more than 4 clients are connected.
2021-01-22 09:45:50 -06:00
Gregg b6c5a6b68d Added License Info to all files 2020-11-02 20:09:09 -06:00
Gregg ba66c6f01a Normalized all #includes
Convention is that every *.cpp references, in this order:

1) Any required core librries
2) Its own *.h  (i.e. Foo.cpp -> Foo.h)
3) All other *.h files needed by the cpp, UNLESS those *.h files are already in its own *.h file.  Must include all *.h files that are not in its own *.h file even if it is others that are referenced.
2020-09-29 07:28:27 -05:00
Gregg 49b1aa277d Create SRP6A:loadVerifyCode()
And updated other SRP routines to complete implementation of use of stored verification code instead of live setup code.

Next up: Add method to change setup code in serial interface and implement similar code after network configuration routines.
2020-09-21 07:10:23 -05:00
Gregg 446679abab Created SRP6A:createVerifyCode()
This generates an SRP verification code from a setupCode and randomly-generated salt.  Function creates the salt internally and returns both the resulting verification code and salt that was used.  These are stored in NVS permanently.

Next Step: create SRP6A:loadVerifycode()
2020-09-20 22:00:01 -05:00
Gregg cccb61f946 Initial commit 2020-07-18 21:47:39 -05:00