mattydebie/bitwarden-rofi

Not able to unlock session

Opened this issue · 3 comments

Since the latest bitwarden-cli 2023.12.0-1 Arch package, I have not been able to unlock my BW session using my master password. Downgrading to bitwarden-cli 2023.10.0-1 resolved the issue.

The issue seems to be that the newer bitwarden-cli for some reason now outputs

mac failed.
SOME_HASH

instead of just the hash during unlock, as expected by bitwarden-rofi.

Temporary workaround: Add | grep -vF 'mac failed.' after bw --raw --nointeraction unlock "$mpw" 2>&1 (line 58 in /usr/bin/bwmenu, arch linux).
It should look like this:

ask_password() {
  rm $CACHE_FILE
  mpw=$(printf '' | rofi -dmenu -p "Master Password" -password -l 0 ${ROFI_OPTIONS[@]}) || exit $?
  if ! out="$(bw --raw --nointeraction unlock "$mpw" 2>&1 | grep -vF 'mac failed.')"; then
    exit_error 1 "Could not unlock vault: $out"
  fi
  echo "$out"
}

The issue seems to be that the newer bitwarden-cli for some reason now outputs

mac failed.
SOME_HASH

instead of just the hash during unlock, as expected by bitwarden-rofi.

Temporary workaround: Add | grep -vF 'mac failed.' after bw --raw --nointeraction unlock "$mpw" 2>&1 (line 58 in /usr/bin/bwmenu, arch linux). It should look like this:

ask_password() {
  rm $CACHE_FILE
  mpw=$(printf '' | rofi -dmenu -p "Master Password" -password -l 0 ${ROFI_OPTIONS[@]}) || exit $?
  if ! out="$(bw --raw --nointeraction unlock "$mpw" 2>&1 | grep -vF 'mac failed.')"; then
    exit_error 1 "Could not unlock vault: $out"
  fi
  echo "$out"
}

Can confirm this is working. Thank you!

The issue seems to be that the newer bitwarden-cli for some reason now outputs

mac failed.
SOME_HASH

instead of just the hash during unlock, as expected by bitwarden-rofi.

Temporary workaround: Add | grep -vF 'mac failed.' after bw --raw --nointeraction unlock "$mpw" 2>&1 (line 58 in /usr/bin/bwmenu, arch linux). It should look like this:

ask_password() {
  rm $CACHE_FILE
  mpw=$(printf '' | rofi -dmenu -p "Master Password" -password -l 0 ${ROFI_OPTIONS[@]}) || exit $?
  if ! out="$(bw --raw --nointeraction unlock "$mpw" 2>&1 | grep -vF 'mac failed.')"; then
    exit_error 1 "Could not unlock vault: $out"
  fi
  echo "$out"
}

Sorted me out too. Thanks for this!