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

Consistent handling of armor max size #26

Closed
covert-encryption opened this issue Nov 26, 2021 · 1 comment · Fixed by #59
Closed

Consistent handling of armor max size #26

covert-encryption opened this issue Nov 26, 2021 · 1 comment · Fixed by #59
Labels
bug Something isn't working

Comments

@covert-encryption
Copy link
Owner

The setting covert.cli.ARMOR_MAX_SIZE should refer to binary size, perhaps with some headroom when reading armored input instead. The current implementation does not make that distinction and needs to be fixed because it may reject something successfully armored as too large to be armored.

Additionally, this should be refactored into covert.util or another more appropriate module because it is not only relevant to CLI.

@covert-encryption covert-encryption added the bug Something isn't working label Nov 26, 2021
@covert-encryption
Copy link
Owner Author

The text form armored data is about 34 % larger than the equivalent binary. However, we can accept it to be up to 2 * ARMOR_MAX_SIZE, to keep things simple and to avoid introducing another variable for a more precisely calculated matching size.

Thus,

  1. Move ARMOR_MAX_SIZE to covert.util, and be sure that cli and gui both import it from there.
  2. Make sure that the size limit is two times that value in decryption code (cli and gui) where the input is armored text (so that anything successfully encrypted with armoring is not rejected on decryption).

Encryption still uses ARMOR_MAX_SIZE as is, as the limit for maximum binary size, possibly applied to a.total_size which then also is smaller than the final encrypted binary produced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant