Remove string size limit
This commit is contained in:
@@ -12,7 +12,8 @@ public:
|
||||
Buffer();
|
||||
~Buffer();
|
||||
bool resize(size_t new_size);
|
||||
int add(uint8_t* data, size_t data_size);
|
||||
int add_end(uint8_t* data, size_t data_size);
|
||||
int add_middle(uint8_t* data, size_t data_size, size_t index);
|
||||
|
||||
// Removes data from buffer without checking if it's in the buffer
|
||||
void remove_fast(uint8_t* data, size_t data_size);
|
||||
|
@@ -5,9 +5,9 @@ class Buffer;
|
||||
class Cryptography;
|
||||
#include <string>
|
||||
|
||||
Pass* arg_get(Buffer& decrypted_buffer, const char* label);
|
||||
const char* arg_get(Buffer& decrypted_buffer, const char* label);
|
||||
|
||||
Pass* arg_generate(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
|
||||
const char* arg_generate(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
|
||||
|
||||
void arg_list(Buffer& decrypted_buffer);
|
||||
|
||||
@@ -15,7 +15,7 @@ void arg_delete(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char*
|
||||
|
||||
void arg_print_all_p(Buffer& decrypted_buffer, std::string& user_pass);
|
||||
|
||||
Pass* arg_input(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
|
||||
const char* arg_input(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
|
||||
|
||||
void arg_change(Buffer& decrypted_buffer, Buffer& encrypted_buffer, std::string& user_pass, Cryptography& crypto);
|
||||
|
||||
|
@@ -1,16 +1,20 @@
|
||||
#pragma once
|
||||
#include <fstream>
|
||||
|
||||
constexpr auto MAX_STRING_SIZE = 21;
|
||||
constexpr auto MAX_STRING_SIZE = 15;
|
||||
|
||||
class Buffer;
|
||||
|
||||
struct Pass
|
||||
{
|
||||
char label[MAX_STRING_SIZE];
|
||||
char password[MAX_STRING_SIZE];
|
||||
uint32_t label;
|
||||
uint32_t password;
|
||||
};
|
||||
|
||||
Pass() = default;
|
||||
struct Index
|
||||
{
|
||||
uint32_t count;
|
||||
uint32_t offset;
|
||||
};
|
||||
|
||||
enum class Arg
|
||||
@@ -26,13 +30,19 @@ enum class Arg
|
||||
Error // error
|
||||
};
|
||||
|
||||
Pass* find_password(Buffer* buff, const char* label);
|
||||
int find_password_in_buffer(Buffer& buff, const char* label);
|
||||
|
||||
void generate_password(char* password);
|
||||
void delete_password_from_buffer(Buffer& in, Buffer& out, int index_of_pass);
|
||||
|
||||
bool save_buffer_to_file(Buffer* buffer);
|
||||
void add_password_to_buffer(Buffer& in, const char* label, const char* password);
|
||||
|
||||
bool load_buffer_from_file(Buffer* buffer);
|
||||
const char* get_password_from_buffer(Buffer& decrypted_buffer, int label);
|
||||
|
||||
void generate_password(std::string& password);
|
||||
|
||||
bool save_buffer_to_file(Buffer& buffer);
|
||||
|
||||
bool load_buffer_from_file(Buffer& buffer);
|
||||
|
||||
void print_usage();
|
||||
|
||||
|
Reference in New Issue
Block a user