Skip to content

Commit

Permalink
fix password hash format
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Dec 3, 2024
1 parent ae7bd7d commit 642ef87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ jobs:
docker pull ${{ needs.build.outputs.IMAGE }}
docker tag ${{ needs.build.outputs.IMAGE }} bitcoin-core-docker
- uses: actions/checkout@v4
- run: ./examples/${CONTAINER_NAME}.sh
- name: Start ${{ env.CONTAINER_NAME }}
run: ./examples/${CONTAINER_NAME}.sh
- name: Wait for healthy
run: |
while ! docker exec -i ${CONTAINER_NAME} /opt/wallet-health.sh; do
Expand All @@ -102,4 +103,6 @@ jobs:
echo "waiting for ${CONTAINER_NAME} health"
echo "Last log: $(docker logs -n1 ${CONTAINER_NAME})"
sleep 15
done
done
- name: Ensure default user works with whitelist
run: docker exec ${CONTAINER_NAME} bitcoin-cli -rpcuser=default -rpcpassword=default getblockcount
2 changes: 1 addition & 1 deletion wallet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generate_rpcauth_entry() {
local salt
local hashed_password
salt=$(head -c 16 /dev/urandom | xxd -ps | tr -d '\n')
hashed_password=$(echo -n "${password}${salt}" | sha256sum | awk '{print $1}')
hashed_password=$(echo -n "${password}" | openssl dgst -sha256 -hmac "${salt}" -binary | xxd -p -c 64)

echo "rpcauth=${user}:${salt}\$${hashed_password}"
}
Expand Down

0 comments on commit 642ef87

Please sign in to comment.