Skip to content

Commit

Permalink
v0.72 Release Bug Fix
Browse files Browse the repository at this point in the history
  - fix bad hash algorithm implementation in the CLI functions
  - fix schema migration issues on `dsip_settings` table
  - fix edge cases where bootstrapping failed
  • Loading branch information
devopsec committed Apr 3, 2023
1 parent e0bbbfa commit 62a1ef6
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 299 deletions.
8 changes: 7 additions & 1 deletion dsiprouter/dsip_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,13 @@ function hashCreds() {

# python native version
# no external dependencies other than vanilla python3
${PYTHON} -c "import hashlib,binascii; print(binascii.hexlify(hashlib.pbkdf2_hmac('sha512', '$CREDS'.encode('utf-8'), '$SALT'.encode('utf-8'), iterations=$HASH_ITERATIONS, dklen=$DK_LEN)).decode('utf-8'));"
${PYTHON} <<EOPYTHON
import hashlib,binascii
creds='$CREDS'.encode('utf-8')
salt='$SALT'.encode('utf-8')
hash=hashlib.pbkdf2_hmac('sha512', creds, salt, iterations=$HASH_ITERATIONS, dklen=$DK_LEN) + salt
print(binascii.hexlify(hash).decode('utf-8'))
EOPYTHON
# bash native version
# currently too slow for production usage
#${DSIP_PROJECT_DIR}/dsiprouter/pbkdf2.sh 'sha512' "$CREDS" "$SALT" "$HASH_ITERATIONS" 4
Expand Down
2 changes: 1 addition & 1 deletion resources/upgrade/v0.72/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ rm -rf /tmp/dsiprouter 2>/dev/null
git clone --depth 1 -b "$TAG_NAME" "$REPO_URL" /tmp/dsiprouter
ln -sf /tmp/dsiprouter/resources/upgrade /opt/dsiprouter/resources/upgrade
. /tmp/dsiprouter/dsiprouter/dsip_lib.sh
. /tmp/dsiprouter/dsiprouter.sh upgrade -rel v0.72
/tmp/dsiprouter/dsiprouter.sh upgrade -rel v0.72

0 comments on commit 62a1ef6

Please sign in to comment.