Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e1fcdb108 | |||
| 29f4a67c1c | |||
| 146da4e883 |
@@ -199,3 +199,4 @@ When contributing:
|
|||||||
1. The version will automatically increment on builds
|
1. The version will automatically increment on builds
|
||||||
2. For major features, consider manually creating minor version tags
|
2. For major features, consider manually creating minor version tags
|
||||||
3. Generated version files (`src/version.*`, `VERSION`) should not be committed
|
3. Generated version files (`src/version.*`, `VERSION`) should not be committed
|
||||||
|
# Test change
|
||||||
|
|||||||
16
build.sh
16
build.sh
@@ -57,8 +57,20 @@ increment_version() {
|
|||||||
print_warning "Failed to stage changes (maybe not a git repository)"
|
print_warning "Failed to stage changes (maybe not a git repository)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Commit changes with version message
|
# Prompt for commit message
|
||||||
if git commit -m "Version $NEW_VERSION - Automatic version increment" 2>/dev/null; then
|
echo ""
|
||||||
|
print_status "Please enter a meaningful commit message for version $NEW_VERSION:"
|
||||||
|
echo -n "> "
|
||||||
|
read -r COMMIT_MESSAGE
|
||||||
|
|
||||||
|
# Check if user provided a message
|
||||||
|
if [[ -z "$COMMIT_MESSAGE" ]]; then
|
||||||
|
print_warning "No commit message provided. Using default message."
|
||||||
|
COMMIT_MESSAGE="Version $NEW_VERSION - Automatic version increment"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Commit changes with user-provided message
|
||||||
|
if git commit -m "Version $NEW_VERSION - $COMMIT_MESSAGE" 2>/dev/null; then
|
||||||
print_success "Committed changes for version $NEW_VERSION"
|
print_success "Committed changes for version $NEW_VERSION"
|
||||||
else
|
else
|
||||||
print_warning "Failed to commit changes (maybe no changes to commit or not a git repository)"
|
print_warning "Failed to commit changes (maybe no changes to commit or not a git repository)"
|
||||||
|
|||||||
14
otp.c
14
otp.c
@@ -377,7 +377,7 @@ int list_available_pads(void) {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
printf("Available pads:\n");
|
printf("Available pads:\n");
|
||||||
printf("%-4s %-20s %-12s %-12s %-8s\n", "No.", "Hash (first 16 chars)", "Size", "Used", "% Used");
|
printf("%-4s %-20s %-12s %-12s %-8s\n", "No.", "ChkSum (first 16 chars)", "Size", "Used", "% Used");
|
||||||
printf("%-4s %-20s %-12s %-12s %-8s\n", "---", "-------------------", "----------", "----------", "------");
|
printf("%-4s %-20s %-12s %-12s %-8s\n", "---", "-------------------", "----------", "----------", "------");
|
||||||
|
|
||||||
while ((entry = readdir(dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
@@ -455,7 +455,7 @@ int show_pad_info(const char* chksum) {
|
|||||||
read_state_offset(chksum, &used_bytes);
|
read_state_offset(chksum, &used_bytes);
|
||||||
|
|
||||||
printf("=== Pad Information ===\n");
|
printf("=== Pad Information ===\n");
|
||||||
printf("Hash: %s\n", chksum);
|
printf("ChkSum: %s\n", chksum);
|
||||||
printf("File: %s\n", pad_filename);
|
printf("File: %s\n", pad_filename);
|
||||||
|
|
||||||
double size_gb = (double)st.st_size / (1024.0 * 1024.0 * 1024.0);
|
double size_gb = (double)st.st_size / (1024.0 * 1024.0 * 1024.0);
|
||||||
@@ -920,9 +920,9 @@ int encrypt_text(const char* pad_identifier) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output in ASCII armor format
|
// Output in ASCII armor format
|
||||||
printf("\n-----BEGIN OTP MESSAGE-----\n");
|
printf("\n\n-----BEGIN OTP MESSAGE-----\n");
|
||||||
printf("Version: %s\n", get_version());
|
printf("Version: %s\n", get_version());
|
||||||
printf("Pad-Hash: %s\n", chksum_hex);
|
printf("Pad-ChkSum: %s\n", chksum_hex);
|
||||||
printf("Pad-Offset: %lu\n", current_offset);
|
printf("Pad-Offset: %lu\n", current_offset);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
@@ -932,7 +932,7 @@ int encrypt_text(const char* pad_identifier) {
|
|||||||
printf("%.64s\n", base64_cipher + i);
|
printf("%.64s\n", base64_cipher + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("-----END OTP MESSAGE-----\n\n");
|
printf("-----END OTP MESSAGE-----\n\n\n");
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
free(pad_data);
|
free(pad_data);
|
||||||
@@ -972,8 +972,8 @@ int decrypt_text(const char* pad_identifier) {
|
|||||||
|
|
||||||
if (!found_begin) continue;
|
if (!found_begin) continue;
|
||||||
|
|
||||||
if (strncmp(line, "Pad-Hash: ", 10) == 0) {
|
if (strncmp(line, "Pad-ChkSum: ", 12) == 0) {
|
||||||
strncpy(stored_chksum, line + 10, 64);
|
strncpy(stored_chksum, line + 12, 64);
|
||||||
stored_chksum[64] = '\0';
|
stored_chksum[64] = '\0';
|
||||||
}
|
}
|
||||||
else if (strncmp(line, "Pad-Offset: ", 12) == 0) {
|
else if (strncmp(line, "Pad-Offset: ", 12) == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user