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

Error while deriving the key (kdf_open) while importing Aegis encrypted JSON #376

Closed
IoSonoPiero opened this issue Aug 4, 2024 · 26 comments
Assignees
Milestone

Comments

@IoSonoPiero
Copy link

IoSonoPiero commented Aug 4, 2024

Hello,
I used OTPClient on Ubuntu without issues until I moved to Fedora 40.
I get the error: "Error while deriving the key (kdf_open)" when I open a file I created on Aegis on my Android smartphone.
I've always used OTPClient and imported the file several times.
I have the latest package for Fedora.

I've attached the screenshot of the error if it can be helpful.
I'm available to do tests so OTPClient can be used again (at least on my machine if it's my issue).
Thanks!

Schermata del 2024-08-04 11-23-23

Note: I am having the same error when using the Flatpak version.

@paolostivanin
Copy link
Owner

Hello,
so you are facing an issue in the following case, correct?

  1. open OTPClient. This is a first run, because db is empty
  2. import and Aegis backup, the error appears

@IoSonoPiero
Copy link
Author

Hello, sorry for the late reply.
Yes, that's precisely what's happened.

@IoSonoPiero
Copy link
Author

IoSonoPiero commented Aug 5, 2024

And ... well, this is new: freshly booted laptop, I got this error:

[WARNING] your operating system's memlock limit may be too low for you (current value: 8388608 bytes).
This may cause issues when importing third parties databases or dealing with tens of tokens.
For information on how to increase the memlock value, please have a look at https://github.com/paolostivanin/OTPClient/wiki/Secure-Memory-Limitations
couldn't lock 16384 bytes of memory (secret_session): Impossibile allocare memoria

(otpclient:12901): GLib-ERROR **: 15:25:26.920: ../glib/gmem.c:139: failed to allocate 18446744073709551600 bytes

I was looking to import any other key and then Aegis to try.

@paolostivanin
Copy link
Owner

installed from repo or from flatpak?

@IoSonoPiero
Copy link
Author

Installed from the repo. My bad; I needed to be more precise in the first post.
I tried flatpak, too.
Same issue.

@IoSonoPiero
Copy link
Author

I tried with Twitter 2FA, same error.

@GuilhermeReda
Copy link

GuilhermeReda commented Aug 5, 2024

Same thing here. Installed it from flatpak, and I get this error when importing any type of exported file.

Edit: rolling back to 3.6.0 fixed the issue, then I was able to update to the latest version and preserve all imported keys

@paolostivanin
Copy link
Owner

@GuilhermeReda wait, what? You upgraded to v4, opened the database, downgraded to v3 and still were able to open the db? The same exact db?

@GuilhermeReda
Copy link

other way around. I tried importing from v4, got the error described above. reverted to 3.6, imported my backup, then upgraded to v4 again and the db was there

@paolostivanin
Copy link
Owner

ah ok, makes sense. Tomorrow I'll look at this bug with high priority, sorry all.

@GuilhermeReda
Copy link

I tried andotp_exports.json.aes, andotp_exports.json and aegis_encrypted.json. All failed.
All exported from a second machine running OTPClient

@paolostivanin paolostivanin added this to the 4.0.2 milestone Aug 6, 2024
@paolostivanin
Copy link
Owner

And ... well, this is new: freshly booted laptop, I got this error:

[WARNING] your operating system's memlock limit may be too low for you (current value: 8388608 bytes).
This may cause issues when importing third parties databases or dealing with tens of tokens.
For information on how to increase the memlock value, please have a look at https://github.com/paolostivanin/OTPClient/wiki/Secure-Memory-Limitations
couldn't lock 16384 bytes of memory (secret_session): Impossibile allocare memoria

(otpclient:12901): GLib-ERROR **: 15:25:26.920: ../glib/gmem.c:139: failed to allocate 18446744073709551600 bytes

I was looking to import any other key and then Aegis to try.

That's happening because you don't have enough secure memory available. Please have a look at the wiki on how to increase it.

@paolostivanin
Copy link
Owner

@GuilhermeReda you're also on Fedora, right?

@paolostivanin
Copy link
Owner

found and fixed the bug, will make a new release by late morning

@IoSonoPiero
Copy link
Author

Grande Paolo!
Thank you very much!

@paolostivanin
Copy link
Owner

paolostivanin commented Aug 6, 2024

about this

couldn't lock 16384 bytes of memory (secret_session): Impossibile allocare memoria

I can only randomly reproduce it. It's something that happens on the OS when the memlock is insufficient. I will add a stricter check on the memlock value.

@IoSonoPiero
Copy link
Author

It may be related to Fedora. I've used OTPClient on Ubuntu, and I've never noticed messages.

@paolostivanin
Copy link
Owner

You're not the only one having issues on Fedora. I don't know what kind of security they have in place, but on Ubuntu, openSUSE and Arch I've never seen such thing.

Just to compare, could you check ulimit -l on both Ubuntu and Fedora?

@IoSonoPiero
Copy link
Author

On my machines, I have:
Fedora 40: 8192
Ubuntu 24.04 LTS: 2033328
Ubuntu 22.04.4 LTS: 3069668

@paolostivanin
Copy link
Owner

there you go! You have 8 MiB on Fedora (why so low by default?!?!) VS 2 and 3 GB on Ubuntu...

@IoSonoPiero
Copy link
Author

Understood.
Please consider that there are default installations with no modifications made by me.

@paolostivanin
Copy link
Owner

yes, I can confirm that. I've just installed Fedora 40 and I also got 8192. I need to think whether to exit in such case or continue operation, because it's not easy to detect the error you posted above. It comes abruptly without any chance of catching it.

@IoSonoPiero
Copy link
Author

Hello, Just a question:
Have you been able to release the new version yet?
I got this update:

 libcotp3        x86_64       3.0.0-1.50         download.opensuse.org_repositories_home_polslinux_otpclient_Fedora_40_
 otpclient       x86_64       4.0.1-1.5          download.opensuse.org_repositories_home_polslinux_otpclient_Fedora_40_ 

but I always get the following error:
immagine

@paolostivanin
Copy link
Owner

@IoSonoPiero not yet. Got caught up with other things.
Tomorrow morning I'll make a new release!

@IoSonoPiero
Copy link
Author

No worries at all. I just got the update from the repo.
Thanks for all the support, by the way!

@IoSonoPiero
Copy link
Author

It works!
Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants