ocpasswordgen: Convert to EDK-II codestyle

This commit is contained in:
PMheart 2022-04-22 00:35:23 +02:00
parent 29bc486efd
commit d3bcfa2a30

View File

@ -5,22 +5,22 @@
#include <stdio.h>
#include <Base.h>
#include <Library/DebugLib.h>
#include <Library/OcCryptoLib.h>
#include <UserPseudoRandom.h>
int main(void) {
int Char;
UINT8 Password[OC_PASSWORD_MAX_LEN];
UINT8 PasswordLen;
UINT32 Salt[4];
UINT8 Index;
UINT8 PasswordHash[SHA512_DIGEST_SIZE];
CHAR8 Char;
UINT8 Password[OC_PASSWORD_MAX_LEN];
UINT8 PasswordLen;
UINT32 Salt[4];
UINT8 Index;
UINT8 PasswordHash[SHA512_DIGEST_SIZE];
printf("Please enter your password: ");
DEBUG ((DEBUG_ERROR, "Please enter your password: "));
for (PasswordLen = 0; PasswordLen < OC_PASSWORD_MAX_LEN; ++PasswordLen) {
Char = getchar();
Char = getchar ();
if (Char == EOF || Char == '\n') {
break;
}
@ -40,17 +40,16 @@ int main(void) {
PasswordHash
);
printf ("\nPasswordHash: <");
DEBUG ((DEBUG_ERROR, "\nPasswordHash: <"));
for (Index = 0; Index < sizeof (PasswordHash); ++Index) {
printf ("%02x", PasswordHash[Index]);
DEBUG ((DEBUG_ERROR, "%02x", PasswordHash[Index]));
}
printf ("> \nPasswordSalt: <");
printf (">\nPasswordSalt: <");
for (Index = 0; Index < sizeof (Salt); ++Index) {
printf ("%02x", ((unsigned char *) Salt)[Index]);
DEBUG ((DEBUG_ERROR, "%02x", ((UINT8 *) Salt)[Index]));
}
printf ("> \n");
DEBUG ((DEBUG_ERROR, ">\n"));
SecureZeroMem (Password, sizeof (Password));
SecureZeroMem (PasswordHash, sizeof (PasswordHash));