File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,14 @@ jobs:
21
21
SIGNATURE=$(echo -n "$EVENT_PAYLOAD" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" | cut -d " " -f2)
22
22
echo "SIGNATURE=$SIGNATURE" >> $GITHUB_ENV
23
23
24
- # Encrypt the API token using the webhook secret as encryption key
25
- # Generate a random IV for AES encryption
24
+ # Create a consistent key from the webhook secret
25
+ KEY=$(echo -n "$WEBHOOK_SECRET" | openssl dgst -sha256 | cut -d ' ' -f2)
26
+
27
+ # Generate a random IV
26
28
IV=$(openssl rand -hex 16)
27
- ENCRYPTED_TOKEN=$(echo -n "$API_TOKEN" | openssl enc -aes-256-cbc -base64 -K $(echo -n "$WEBHOOK_SECRET" | xxd -p -c 64 | head -c 64) -iv $IV)
29
+
30
+ # Encrypt token with proper padding
31
+ ENCRYPTED_TOKEN=$(echo -n "$API_TOKEN" | openssl enc -aes-256-cbc -a -A -K "$KEY" -iv "$IV" -md sha256)
28
32
29
33
echo "ENCRYPTED_TOKEN=$ENCRYPTED_TOKEN" >> $GITHUB_ENV
30
34
echo "TOKEN_IV=$IV" >> $GITHUB_ENV
You can’t perform that action at this time.
0 commit comments