[0.4.7][RAPPS] "Let's encrypt" Certificate-Issuer-Update hamster-wheel

"Let's encrypt" certificate issuer string changed within last 24hours remotely.
Update its name to make RAPPS stop complaining on DB update.

And also fix a bug in rapps mixing A()/W() in the
messagebox that informs about that cert check failure.

Fix is port of
0.4.15-dev-1120-g 12caaece25
0.4.15-dev-1617-g f77f5a30cf

Next time this happens I will relentlessly undefine CMakeLists.txt USE_CERT_PINNING
This commit is contained in:
Joachim Henze 2021-01-11 21:30:00 +01:00
parent 5f0c98f291
commit d276da45a3

View file

@ -47,7 +47,8 @@
#include "misc.h" #include "misc.h"
#ifdef USE_CERT_PINNING #ifdef USE_CERT_PINNING
#define CERT_ISSUER_INFO "US\r\nLet's Encrypt\r\nLet's Encrypt Authority X3" #define CERT_ISSUER_INFO_OLD "US\r\nLet's Encrypt\r\nLet's Encrypt Authority X3"
#define CERT_ISSUER_INFO_NEW "US\r\nLet's Encrypt\r\nR3"
#define CERT_SUBJECT_INFO "rapps.reactos.org" #define CERT_SUBJECT_INFO "rapps.reactos.org"
#endif #endif
@ -782,7 +783,7 @@ DWORD WINAPI CDownloadManager::ThreadFunc(LPVOID param)
(wcscmp(InfoArray[iAppId].szUrl, APPLICATION_DATABASE_URL) == 0)) (wcscmp(InfoArray[iAppId].szUrl, APPLICATION_DATABASE_URL) == 0))
{ {
CLocalPtr subjectName, issuerName; CLocalPtr subjectName, issuerName;
CStringW szMsgText; CStringA szMsgText;
bool bAskQuestion = false; bool bAskQuestion = false;
if (!CertGetSubjectAndIssuer(hFile, subjectName, issuerName)) if (!CertGetSubjectAndIssuer(hFile, subjectName, issuerName))
{ {
@ -792,7 +793,8 @@ DWORD WINAPI CDownloadManager::ThreadFunc(LPVOID param)
else else
{ {
if (strcmp(subjectName, CERT_SUBJECT_INFO) || if (strcmp(subjectName, CERT_SUBJECT_INFO) ||
strcmp(issuerName, CERT_ISSUER_INFO)) (strcmp(issuerName, CERT_ISSUER_INFO_OLD) &&
strcmp(issuerName, CERT_ISSUER_INFO_NEW)))
{ {
szMsgText.Format(IDS_MISMATCH_CERT_INFO, (char*)subjectName, (const char*)issuerName); szMsgText.Format(IDS_MISMATCH_CERT_INFO, (char*)subjectName, (const char*)issuerName);
bAskQuestion = true; bAskQuestion = true;
@ -801,7 +803,7 @@ DWORD WINAPI CDownloadManager::ThreadFunc(LPVOID param)
if (bAskQuestion) if (bAskQuestion)
{ {
if (MessageBoxW(hMainWnd, szMsgText.GetString(), NULL, MB_YESNO | MB_ICONERROR) != IDYES) if (MessageBoxA(hMainWnd, szMsgText.GetString(), NULL, MB_YESNO | MB_ICONERROR) != IDYES)
{ {
goto end; goto end;
} }