ocpasswordgen: Convert to EDK-II codestyle
#include <stdio.h>
-#include <Base.h>
+#include <Library/DebugLib.h>
#include <Library/OcCryptoLib.h>
#include <UserPseudoRandom.h>
int main(void) {
- int Char;
+ 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 ();
@@ -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: <");
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));
