I have a Mikrotik RBM33G (SoC Type: MediaTek MT7621) running OpenWrt 19.07.3 (with Linux 4.14.180 #0 SMP Sat May 16 18:32:20 2020 mips GNU/Linux). Just upgraded from 19.07.2 (where I faced the same issue).
I am not able to decrypt a hard drive connected to my router, although i know
cryptsetup is being provided with the right key, as i've tried both copy-pasting the passphrase from a password manager and unlocking the drive with a key file. In both cases, i get the same error:
Command failed with code -1 (wrong or missing parameters).
Here is the full output of a debug crypsetup command:
# cryptsetup 2.1.0 processing "cryptsetup --debug open /dev/sda1 backup" # Running command open. # Locking memory. # Installing SIGINT/SIGTERM handler. # Unblocking interruption on signal. # Allocating context for crypt device /dev/sda1. # Trying to open and read device /dev/sda1 with direct-io. # Initialising device-mapper backend library. # Trying to load any crypt type from device /dev/sda1. # Crypto backend (Linux 4.14.180 kernel cryptoAPI) initialized in cryptsetup library version 2.1.0. # Detected kernel Linux 4.14.180 mips. # PBKDF pbkdf2, hash sha256, time_ms 2000 (iterations 0), max_memory_kb 0, parallel_threads 0. # Reading LUKS header of size 1024 from device /dev/sda1 # Key length 64, device size 3907020800 sectors, header size 4036 sectors. # Activating volume backup using token -1. # Interactive passphrase entry requested. Enter passphrase for /dev/sda1: # Activating volume backup [keyslot -1] using passphrase. # dm version [ opencount flush ]  (*1) # dm versions [ opencount flush ]  (*1) # Detected dm-ioctl version 4.37.0. # Detected dm-crypt version 1.18.1. # Device-mapper backend running with UDEV support disabled. # dm status backup [ opencount noflush ]  (*1) # Trying to open key slot 0 [ACTIVE]. # Releasing crypt device /dev/sda1 context. # Releasing device-mapper backend. # Unlocking memory. Command failed with code -1 (wrong or missing parameters).
Interestingly, it makes no difference whether i type in a wrong password, the right password, an empty password or provide a keyfile.
Every thing else looks normal otherwise (
block info sees the LUKS partition,
dmesg output shows the drive properly found). Any clues?