File: release_util_script_decrypt_var.sh

package info (click to toggle)
cbmc 6.6.0-4
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 153,852 kB
  • sloc: cpp: 386,459; ansic: 114,466; java: 28,405; python: 6,003; yacc: 4,552; makefile: 4,041; lex: 2,487; xml: 2,388; sh: 2,050; perl: 557; pascal: 184; javascript: 163; ada: 36
file content (15 lines) | stat: -rwxr-xr-x 642 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# --------------------------------------------------------------------------------
# This script can be used to double check that an encrypted variable found in a
# file (e.g. gpg key id) is correct (e.g. no misspellings have occurred).
# It is the peer of 'release_util_script_encrypt_var.sh' - which is used for
# encrypting a variable (e.g. a gpg key id).
# --------------------------------------------------------------------------------
set -euo pipefail

SSL_PWD="$1"
VAR_ENC="$2"

echo "decrypted var is:"
VAR=$(echo "${VAR_ENC}" | openssl enc -A -base64 -d | openssl aes-256-cbc -d -a -pass pass:"$SSL_PWD")
echo "${VAR}"