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).
This commit is contained in:
Gregg 2021-09-19 22:07:34 -05:00
parent 4da033195a
commit 5496503afd
2 changed files with 7 additions and 1 deletions

View File

@ -32,6 +32,7 @@
#include <ArduinoOTA.h>
#include <esp_ota_ops.h>
#include <driver/ledc.h>
#include <mbedtls/version.h>
#include "HomeSpan.h"
#include "HAP.h"
@ -111,6 +112,11 @@ void Span::begin(Category catID, const char *displayName, const char *hostNameBa
Serial.printf("\nPWM Resources: %d channels, %d timers, max %d-bit duty resolution",
LEDC_SPEED_MODE_MAX*LEDC_CHANNEL_MAX,LEDC_SPEED_MODE_MAX*LEDC_TIMER_MAX,LEDC_TIMER_BIT_MAX-1);
Serial.printf("\nSodium Version: %s Lib %d.%d",sodium_version_string(),sodium_library_version_major(),sodium_library_version_minor());
char mbtlsv[64];
mbedtls_version_get_string_full(mbtlsv);
Serial.printf("\nMbedTLS Version: %s",mbtlsv);
Serial.print("\nSketch Compiled: ");
Serial.print(__DATE__);
Serial.print(" ");

View File

@ -144,7 +144,7 @@ void SRP6A::createPublicKey(){
void SRP6A::getPrivateKey(){
uint8_t privateKey[32];
randombytes_buf(privateKey,16); // generate 32 random bytes using libsodium (which uses the ESP32 hardware-based random number generator)
randombytes_buf(privateKey,32); // generate 32 random bytes using libsodium (which uses the ESP32 hardware-based random number generator)
mbedtls_mpi_read_binary(&b,privateKey,32);
}