Skip to content
Permalink
Browse files

[go-experimental] Do not generate HTTP signature unit test for every …

…generated SDK (#5588)

* Do not generate HTTP signature unit test for every generated SDK

* Add golang 1.14 to CI environment

* fix unit test issues

* remove script commands that were commented out

* add support for ed25519 private keys
  • Loading branch information
sebastien-rosset committed Mar 14, 2020
1 parent 972bd8e commit 5e6a261d12aa0d9c3a97159acadcf70ef9614cce
@@ -10,6 +10,12 @@ set -e
if [ "$NODE_INDEX" = "1" ]; then
echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
java -version
# Install golang version 1.14
go version
sudo mkdir /usr/local/go1.14
wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14
export PATH="/usr/local/go1.14/go/bin:$PATH"
go version

mvn --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
mvn --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
@@ -6,6 +6,7 @@ import (
"context"
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
@@ -382,8 +383,8 @@ func SignRequest(
}
case *ecdsa.PrivateKey:
signature, err = key.Sign(rand.Reader, d, h)
//case ed25519.PrivateKey: requires go 1.13
// signature, err = key.Sign(rand.Reader, msg, crypto.Hash(0))
case ed25519.PrivateKey: // requires go 1.13
signature, err = key.Sign(rand.Reader, msg, crypto.Hash(0))
default:
return fmt.Errorf("Unsupported private key")
}

0 comments on commit 5e6a261

Please sign in to comment.
You can’t perform that action at this time.