[pki] add RSA-2048 signature validation for all server downloads

* Closes #1172
* Also fix a MinGW warning in badblocks.c
This commit is contained in:
Pete Batard 2018-06-29 18:19:05 +01:00
parent 2d262df8f3
commit fdfc9ff82d
8 changed files with 331 additions and 85 deletions

View file

@ -512,6 +512,22 @@ static __inline int PathGetDriveNumberU(char* lpPath)
return ret;
}
// This one is tricky since we can't blindly convert a
// UTF-16 position to a UTF-8 one. So we do it manually.
static __inline const char* PathFindFileNameU(const char* szPath)
{
size_t i;
if (szPath == NULL)
return NULL;
for (i = strlen(szPath); i != 0; i--) {
if ((szPath[i] == '/') || (szPath[i] == '\\')) {
i++;
break;
}
}
return &szPath[i];
}
// This function differs from regular GetTextExtentPoint in that it uses a zero terminated string
static __inline BOOL GetTextExtentPointU(HDC hdc, const char* lpString, LPSIZE lpSize)
{