Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I got error message "is_valid_tomb:local:57: not valid in this context: " when I ran the command "tomb lock -k secrets.tomb.key secrets.tomb" for testing. #487

Closed
blueDesert opened this issue Jul 4, 2023 · 3 comments
Assignees
Labels
enhancement An issue to improve current behavior
Milestone

Comments

@blueDesert
Copy link

blueDesert commented Jul 4, 2023

Hi guys,

I ran command tomb with parameters dig & forge that was success as below:

[root@/tmp]# tomb dig -s 10 secrets.tomb
tomb  .  Commanded to dig tomb 
tomb (*) Creating a new tomb in secrets.tomb
tomb  .  Generating secrets.tomb of 10MiB
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.0401147 s, 261 MB/s
-rw------- 1 root root 10M Jul  5 00:09 secrets.tomb
tomb (*) Done digging secrets.tomb
tomb  .  Your tomb is not yet ready, you need to forge a key and lock it:
tomb  .  tomb forge secrets.tomb.key
tomb  .  tomb lock secrets.tomb -k secrets.tomb.key
[root@/tmp]# tomb forge -k secrets.tomb.key 
tomb  .  Commanded to forge key secrets.tomb.key with cipher algorithm AES256
tomb [W] This operation takes time. Keep using this computer on other tasks.
tomb [W] Once done you will be asked to choose a password for your tomb.
tomb [W] To make it faster you can move the mouse around.
tomb [W] If you are on a server, you can use an Entropy Generation Daemon.
512+0 records in
512+0 records out
512 bytes (512 B) copied, 0.00114654 s, 447 kB/s
tomb (*) Choose the password of your key: secrets.tomb.key
tomb  .  (You can also change it later using 'tomb passwd'.)
tomb  .  Key is valid.
tomb  .  Done forging secrets.tomb.key
tomb (*) Your key is ready:
-rw------- 1 root root 894 Jul  5 00:09 secrets.tomb.key

But I got the error message when I was ready to lock it:

[root@/tmp]# tomb lock secrets.tomb -k secrets.tomb.key
tomb [W] File is not yet a tomb: secrets.tomb
is_valid_tomb:local:57: not valid in this context: 

The coreutils version 8.32 were compiled by myself because sha256sum of coreutils v8.22 didn't support parameter zero.

[root@/tmp]# /usr/bin/sha256sum --version
sha256sum (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Ulrich Drepper, Scott Miller, and David Madore.

System information:

Linux TWNXXXXXXX 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
CentOS Linux release 7.9.2009 (Core)

Does anyone have any idea about this problem?

@Narrat
Copy link
Contributor

Narrat commented Aug 3, 2023

Two things I noticed:

  • 10MB as a size is fairly small. Just to make sure this isn't a cause of breakage one should try a bigger tomb
  • Creating the key:
    • You used tomb forge -k secrets.tomb.key
    • Should be tomb forge secrets.tomb.key (notice the missing -k)

@jaromil
Copy link
Member

jaromil commented Jan 29, 2024

This teaches us two lessons in usability:

  1. implement a check on minimum size for dig
  2. support also -k on forge (its intuitive ...)

@jaromil jaromil self-assigned this May 11, 2024
@jaromil jaromil added the enhancement An issue to improve current behavior label May 11, 2024
@jaromil jaromil added this to the 3.0 milestone May 11, 2024
@jaromil
Copy link
Member

jaromil commented May 12, 2024

The proposed fixes were made in a previous commit.

@jaromil jaromil closed this as completed May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue to improve current behavior
Projects
None yet
Development

No branches or pull requests

3 participants