Skip to content
Snippets Groups Projects

compatibilty to openssl v3

Merged Hahn Axel (hahn) requested to merge 6141-update-for-openssl3 into master
2 files
+ 8
6
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 6
5
@@ -9,13 +9,14 @@
# 2021-04-13 v1.1 <axel.hahn@iml.unibe.ch> add support for custom config
# 2021-04-15 v1.2 <axel.hahn@iml.unibe.ch> added debugging of curl request
# 2021-10-14 v1.3 <axel.hahn@iml.unibe.ch> add nanoseconds in hashed base data
# 2023-02-14 v1.4 <axel.hahn@unibe.ch> compatibility to openssl v3
# ======================================================================
# ----------------------------------------------------------------------
# CONFIG
# ----------------------------------------------------------------------
version="v1.3"
version="v1.43"
about="CI PACKAGE GETTER $version;
(c) 2021 Institute for Medical Education (IML); University of Bern;
GNU GPL 3.0"
@@ -123,7 +124,7 @@ function makeRequest(){
if [ $bDebug = 1 ]; then
echo $line
echo $apiMethod ${apiHost}${apiRequest}
echo "$apiMethod ${apiHost}${apiRequest}"
echo $line
fi
@@ -132,7 +133,7 @@ function makeRequest(){
# --- date in http format
LANG=en_EN
# export TZ=GMT
apiTS=`date "+%a, %d %b %Y %H:%M:%S.%N %Z"`
apiTS=$(date "+%a, %d %b %Y %H:%M:%S.%N %Z")
# --- generate data to hash: method + uri + timestamp; delimited with line break
@@ -147,8 +148,8 @@ ${apiTS}
fi
# generate hash - split in 2 commands (piping "cut" sends additional line break)
myHash=`echo -n "$data" | openssl sha1 -hmac "${secret}" | cut -f 2 -d" "`
myHash=`echo -n "$myHash" | base64`
myHash=$(echo -n "$data" | openssl dgst -sha1 -hex -hmac "${secret}" | cut -f 2 -d " ")
myHash=$(echo -n "$myHash" | base64)
moreheaders="--fail"
test $bDebug = 1 && moreheaders="-i"
Loading