Skip to content

Commit

Permalink
fixed mkcert leap year issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Feb 29, 2024
1 parent f436acd commit 11b764c
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
4 changes: 4 additions & 0 deletions core/libgamestream/src/mkcert.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ static int mkcert_generate_impl(mbedtls_pk_context *key, mbedtls_x509write_cert
char not_before[16], not_after[16];
strftime(not_before, 16, "%Y%m%d%H%M%S", ptr_time);
ptr_time->tm_year += NUM_YEARS;
if (ptr_time->tm_mon == 1 && ptr_time->tm_mday == 29) {
// Don't ever set the date to February 29th, to avoid leap year issues
ptr_time->tm_mday = 28;
}
strftime(not_after, 16, "%Y%m%d%H%M%S", ptr_time);
if ((ret = mbedtls_x509write_crt_set_validity(crt, not_before, not_after)) != 0) {
mbedtls_strerror(ret, buf, 512);
Expand Down
16 changes: 1 addition & 15 deletions core/libgamestream/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,4 @@ if (NOT BUILD_TESTS)
return()
endif ()

find_package(OpenSSL 1.0)

if (NOT OPENSSL_FOUND)
message(WARNING "OpenSSL not found, skipping tests")
return()
endif ()

foreach (suite_name aes challenge hash sign)
add_executable(test-gamestream-crypt-${suite_name} ${suite_name}.c ${CMAKE_CURRENT_SOURCE_DIR}/../src/set_error.c)
target_include_directories(test-gamestream-crypt-${suite_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../libgamestream ${CMAKE_CURRENT_SOURCE_DIR}/../src)
target_link_libraries(test-gamestream-crypt-${suite_name} PRIVATE ${OPENSSL_LIBRARIES})
target_link_libraries(test-gamestream-crypt-${suite_name} PRIVATE ${MBEDCRYPTO_LIBRARY} ${MBEDX509_LIBRARY})
target_include_directories(test-gamestream-crypt-${suite_name} SYSTEM PRIVATE ${MBEDTLS_INCLUDE_DIRS})
add_test(test-gamestream-crypt-${suite_name} test-gamestream-crypt-${suite_name})
endforeach ()
add_subdirectory(crypt)
15 changes: 15 additions & 0 deletions core/libgamestream/tests/crypt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
find_package(OpenSSL 1.0)

if (NOT OPENSSL_FOUND)
message(WARNING "OpenSSL not found, skipping tests")
return()
endif ()

foreach (suite_name aes challenge hash sign)
add_executable(test-gamestream-crypt-${suite_name} ${suite_name}.c ${CMAKE_CURRENT_SOURCE_DIR}/../../src/set_error.c)
target_include_directories(test-gamestream-crypt-${suite_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../libgamestream ${CMAKE_CURRENT_SOURCE_DIR}/../../src)
target_link_libraries(test-gamestream-crypt-${suite_name} PRIVATE ${OPENSSL_LIBRARIES})
target_link_libraries(test-gamestream-crypt-${suite_name} PRIVATE ${MBEDCRYPTO_LIBRARY} ${MBEDX509_LIBRARY})
target_include_directories(test-gamestream-crypt-${suite_name} SYSTEM PRIVATE ${MBEDTLS_INCLUDE_DIRS})
add_test(test-gamestream-crypt-${suite_name} test-gamestream-crypt-${suite_name})
endforeach ()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions src/app/ui/launcher/pair.dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

#include "lvgl.h"

extern const lv_fragment_class_t pair_dialog_class;

void pair_dialog_open(const uuidstr_t *uuid);

0 comments on commit 11b764c

Please sign in to comment.