File: decrypt_ssl

package info (click to toggle)
cryptsetup 2%3A2.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 19,624 kB
  • sloc: ansic: 62,955; sh: 16,774; cpp: 994; xml: 920; makefile: 488; perl: 486
file content (17 lines) | stat: -rw-r--r-- 347 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
#
# Script to decrypt the key which is encrypted with openssl.
# See /usr/share/doc/cryptsetup/examples/gen-ssl-key to create such a key.
#

decrypt_ssl () {
	echo "" >&2
	echo "Decrypting ssl key $1..." >&2
	if ! /usr/bin/openssl enc -aes-256-cbc -d -salt -in "$1" 2>/dev/null; then
		return 1
	fi
	return 0
}

decrypt_ssl "$1"
exit $?