Bitwarden_rs: PUT /api/ciphers/move not implemented

Created on 22 Jul 2018  路  10Comments  路  Source: dani-garcia/bitwarden_rs

New vault (#93) calls PUT on /api/ciphers/move to "Move selected" ciphers. We have POST handler already implemented for this, so this should be easy to fix.

bug future Vault good first issue

All 10 comments

Hi, I am new to Rust and wanted to start contributing to open source projects. This bug looked like a good beginner task, so I decided to give it a shot. I forked and cloned the project, but on "cargo run" I am getting the following error message:

JWT keys don't exist, checking if OpenSSL is available...
OpenSSL detected, creating keys...
Error creating keys, exiting...

Can someone please guide me on what could be the issue here?

Hi, I think the program fails to create the keys. Normally they are in the data directory, so make sure that whatever user you're running it under can create that folder and/or write to it.

Thanks @mprasil . I checked the data folder. I see 2 files inside it, rsa_key.der and rsa_key.pem. I also checked the permissions. The user has both read and write permissions on the data folder and as well as the 2 files inside the data folder. So, I tried to debug and it seems like 3 keys should have been created but only 2 are created. Creation of rsa_key.pub.der is failing here:

success &= Command::new("openssl").arg("rsa")
            .arg("-in").arg(&CONFIG.private_rsa_key)
            .arg("-inform").arg("DER")
            .arg("-RSAPublicKey_out")
            .arg("-outform").arg("DER")
            .arg("-out").arg(&CONFIG.public_rsa_key)
            .output().expect("Failed to create public der file")
            .status.success();

I also tried directly running openssl rsa -in rsa_key.der -inform DER -RSAPublicKey_out -outform DER -out rsa_key.pub.der in terminal. I am getting an error message saying unknown option -RSAPublicKey_out.

So, finally I found out the issue. It was the old openssl version being used. Even though I had 1.0.2l version installed through brew, the old version at /usr/local/bin/openssl was being picked up. I had to create a symlink to the newer version to make it work. https://apple.stackexchange.com/questions/126830/how-to-upgrade-openssl-in-os-x

Another question. While doing the setup I was following the instructions in Build.md file. Some of the instructions are out of date now, as in the latest vault release, project structure has been changed and the file settings.Production.json no longer exists. I had to use the previous release to build the project. Is the build process with the latest vault version documented anywhere?

Also, as per my understanding, the aim of this task is to accommodate the changes introduced as part of the latest vault release. So, to work on this bug I will need to setup the new vault. Is my understanding correct?

It鈥檚 not documented at the moment, but you can look at the lines 16-25 of the dockerfile to get an idea of the setup.

Basically, clone the 2.0 repo, apply the patch and run the npm commands.

I packaged vault for archlinux and as of my knowledge, you don't have to change anything anymore and the build process is as following (taken from build.sh in the vault repo):

$ npm install
$ npm run sub:update
$ npm run dist:selfhost

and the output directory is then build/

I have tested it and it worked fairly well but I can still be wrong.
EDIT: Ah there IS a patch :D I'll add that later today.

Note that this is still beta branch, so not ready yet. There are couple bugs that need to be fixed (like this one) before the new Vault (2.0) is usable.

Thanks to all. I was able to setup with Vault (2.0). Will start working on the bug now.

This should be fixed by #108

Was this page helpful?
0 / 5 - 0 ratings