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

deprecated key derivation used by amcrypt-ossl #112

Open
MEitelwein opened this issue Sep 1, 2019 · 16 comments
Open

deprecated key derivation used by amcrypt-ossl #112

MEitelwein opened this issue Sep 1, 2019 · 16 comments

Comments

@MEitelwein
Copy link

With last versions of openssl the warning message

? data encrypt: *** WARNING : deprecated key derivation used.
? data encrypt: Using -iter or -pbkdf2 would be better.

is being produced by amcrypt-ossl.
It can be corrected by adding -pbkdf2 to the amcrypt-ossl calls to openssl:

if [ "$1" = -d ]; then
        # decrypt
        "${OPENSSL}" enc -pbkdf2 -d "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}"
else
        # encrypt
        pad | "${OPENSSL}" enc -pbkdf2 -e "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}"
fi
stefangweichinger added a commit to stefangweichinger/amanda that referenced this issue Dec 14, 2019
@stefangweichinger
Copy link
Contributor

stefangweichinger commented May 14, 2020

Still not fixed upstream.
I hit this again as some manually patched Debian servers reinstalled the old unpatched scripts when upgrading to Debian Buster 10.4

bump

edit: we need to be careful here, in my tests I noticed problems at the restore.

@tacerus
Copy link

tacerus commented Feb 5, 2021

Any update on this? Encountering this in Amanda version 3.5.1.

@stefangweichinger
Copy link
Contributor

one year gone, still no reply from the responsible maintainers

@tacerus
Copy link

tacerus commented Feb 6, 2022

I have since stopped using Amanda and moved to Restic. But Amanda stays in a special place in my heart. :)

@djmitche
Copy link
Contributor

djmitche commented Feb 6, 2022

Who are the "responsible maintainers"?

@Hawk777
Copy link

Hawk777 commented Feb 6, 2022

Who are the "responsible maintainers"?

I don’t know who specifically, but I would assume anyone with commit access to this repo counts.

@dirkx
Copy link
Contributor

dirkx commented Mar 3, 2022

Had the same issue; and as of 1/1/2022 it is now important to be sogis.eu compliant (EU version of a lot of the NIST federal processing regulation) - filed #165

@stefangweichinger
Copy link
Contributor

Still patching manually on backup servers :-(

@stefangweichinger
Copy link
Contributor

It can be corrected by adding -pbkdf2 to the amcrypt-ossl calls to openssl:

if [ "$1" = -d ]; then
        # decrypt
        "${OPENSSL}" enc -pbkdf2 -d "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}"
else
        # encrypt
        pad | "${OPENSSL}" enc -pbkdf2 -e "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}"
fi

Still facing these issues. Applied that patch on a debian 11.3 machine, running amdump gives me a "FAIL" run with:

[missing size line from sendbackup]

Anyone else seeing this, any better workaround?

@exuvo
Copy link

exuvo commented May 4, 2022

I have replaced my encryption needs with:

# cat /etc/amanda/encrypt
#!/bin/bash

AMANDA_HOME=~amanda
PASSPHRASE=$AMANDA_HOME/.am_passphrase    # required
RANDFILE=$AMANDA_HOME/.rnd
export RANDFILE

if [ "$1" = -d ]; then
    /usr/bin/openssl enc -pbkdf2 -d -aes-256-ctr -salt -pass fd:3 3< "${PASSPHRASE}"
else
    /usr/bin/openssl enc -pbkdf2 -e -aes-256-ctr -salt -pass fd:3 3< "${PASSPHRASE}"
fi

pbkdf2 to fix the deprecated key derivation, aes-256-ctr for better and faster encryption (ctr can be parallelized). Also padding is not needed with this encryption method.

@stefangweichinger
Copy link
Contributor

stefangweichinger commented May 4, 2022

great. Let me add this one for completeness: the file defined in $RANDFILE has to be created and seeded like in:

backup:~$ dd if=/dev/urandom of=.rnd bs=256 count=1 

Could that maybe even be done by the wrapper script itself?

@exuvo
Copy link

exuvo commented May 4, 2022 via email

@stefangweichinger
Copy link
Contributor

@exuvo thanks for the explanation. Correct, I see it replaced already. So it would make even more sense to add some block to the wrapper like "if not exists file $RANDFILE, dd some random bytes into it". This would help the initial configuration/setup (which I tend to put into some HOWTO somewhere).

@exuvo
Copy link

exuvo commented May 4, 2022

This should do it:

if [ ! -f "$RANDFILE"]; then
  dd if=/dev/urandom of="$RANDFILE" bs=256 count=1 
fi

@stefangweichinger
Copy link
Contributor

Yep, looks ok. Will test, thanks.

@stefangweichinger
Copy link
Contributor

stefangweichinger commented May 5, 2022

A whitespace before the closing bracket was missing, tiny correction:

if [ ! -f "$RANDFILE" ]; then

Edit: unfortunately I see "missing size line from sendbackup" in the amanda reports.
My quick tests show that this is with DLEs using amsamba plus the encryption.

The simpler tar-based DLEs seem to work fine.

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

No branches or pull requests

7 participants