openssl failing to decrypt randomly?

adig
New Contributor III

Hi

I've been using this function to decrypt api account password in one of my scripts, and i can see it failing to decrypt in some machines. Different versions of macOS, i really can't see a pattern. Anyone seen something similar?

function decrypt_string() {

apipass=$(echo "$encrypted_string" | openssl enc -aes-256-cbc -d -salt -base64 -A -S "$salt" -k "$passphrase" )
}

 

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III

I suggest taking a look at this thread. It may explain the issue and what you need to do to make it work.

FYI: Using EncryptedStrings method for Classic API... - Jamf Nation Community - 257606

View solution in original post

2 REPLIES 2

mm2270
Legendary Contributor III

I suggest taking a look at this thread. It may explain the issue and what you need to do to make it work.

FYI: Using EncryptedStrings method for Classic API... - Jamf Nation Community - 257606

adig
New Contributor III

Yep, it was exactly that. Seems that the change was made with 2.9.1 version of Libressl. https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.9.1-relnotes.txt

Thanks!