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

Decryption failed on long Ciphertexts #185

Open
therealchfkch opened this issue Jun 7, 2024 · 2 comments
Open

Decryption failed on long Ciphertexts #185

therealchfkch opened this issue Jun 7, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@therealchfkch
Copy link

Note that i include the rbw library in my app, so is is not really an issue for the CLI, i hope it is okay to raise an issue under these circumstances.

I recently created a custom field with a long cipher (a PGP Private key), which breaks the library with the following message:
thread 'main' panicked at /home/roman/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rbw-1.10.2/src/locked.rs:41:19: ArrayVec: capacity exceeded in extend/from_iter note: run withRUST_BACKTRACE=1environment variable to display a backtrace
The respective line which crashes is:

self.data.extend(it);

I am on the latest (1.10.2) version.
My Browser extension and the Linux desktop client can decrypt it.
The rbw CLI can also decrypt it if i use rbw get <ENTRYNAME> --raw

The cipher length is 18888. Not sure this is correct though.

@therealchfkch
Copy link
Author

I am using the library from this piece of code here:
https://codeberg.org/Chfkch/bitritter/src/commit/8a6191e2048d5298b8d967a5c1072c58656b8cd2/src/util/mod.rs#L198

It is my first app in Rust, so keep that in mind ;)

@doy doy added the enhancement New feature or request label Jun 20, 2024
@doy
Copy link
Owner

doy commented Jun 20, 2024

yeah, currently encrypted fields are limited to 4kb, because we go through a lot of effort to make sure that decrypted data isn't copied, or persisted in memory after it's freed, or swapped to disk, or things like that, and it's a lot harder to enforce those kinds of properties with dynamically sized chunks of memory. i'd be open to revisiting how this works, but it would probably be a pretty finicky change unfortunately/:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants