-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
49 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
// Author: pi-314159@GitHub | ||
// License: MIT | ||
// Last updated: 2024-06-10 | ||
|
||
#include <actions/add.h> | ||
#include <tools/string.h> | ||
|
@@ -12,14 +11,14 @@ namespace ACTIONS { | |
void Add(std::vector<tOTP_object>& tOTPObjects) { | ||
auto str = std::make_unique_for_overwrite<TOOLS::String>(); | ||
std::string inputBuffer, tag, secret; | ||
char alg = '1'; | ||
std::string alg = "sha1"; | ||
unsigned int period; | ||
unsigned short digits; | ||
while (inputBuffer.empty()) { | ||
str->Input(inputBuffer, "Please enter the issuer (e.g., GitHub), then hit Enter TWICE to proceed:", true); | ||
str->FormatInput(inputBuffer, inputBuffer); | ||
} | ||
tag = inputBuffer + "::"; | ||
tag = inputBuffer + ":"; | ||
inputBuffer = ""; | ||
while (inputBuffer.empty()) { | ||
str->Input(inputBuffer, "Please enter the account (e.g., [email protected]), \nthen hit Enter TWICE to proceed:", true); | ||
|
@@ -44,11 +43,11 @@ namespace ACTIONS { | |
} | ||
str->Input(inputBuffer, "Please select the hash algorithm:\n[1] SHA-1\n[2] SHA-256\n[3] SHA-384\n[5] SHA-512\nEnter your choice (default 1):"); | ||
if (inputBuffer == "2") { | ||
alg = '2'; | ||
alg = "sha256"; | ||
} else if (inputBuffer == "3") { | ||
alg = '3'; | ||
alg = "sha384"; | ||
} else if (inputBuffer == "5") { | ||
alg = '5'; | ||
alg = "sha512"; | ||
} | ||
str->Input(inputBuffer, "Please enter the digits (between 6 - 10, default 6):"); | ||
if (str->FormatInput(inputBuffer, digits, '2')) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
// Author: pi-314159@GitHub | ||
// License: MIT | ||
// Last updated: 2024-06-10 | ||
|
||
#ifndef ACTIONS__GENERATETOTP_H_ | ||
#define ACTIONS__GENERATETOTP_H_ | ||
|
||
#include <totp.h> | ||
|
||
namespace ACTIONS { | ||
std::string GenerateTOTP(tOTP_object& tOTP); | ||
std::string GenerateTotp(tOTP_object& tOTP); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
// Author: pi-314159@GitHub | ||
// License: MIT | ||
// Last updated: 2024-06-10 | ||
|
||
#ifndef TOOLS__GENERATEIV_H_ | ||
#define TOOLS__GENERATEIV_H_ | ||
|
||
namespace TOOLS { | ||
void GenerateIV(unsigned char* iV, unsigned int iVSize = 16); | ||
void GenerateIv(unsigned char* iV, unsigned int iVSize = 16); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
// Author: pi-314159@GitHub | ||
// License: MIT | ||
// Last updated: 2024-06-10 | ||
|
||
#include <tools/base32decode.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.