Skip to content

Commit 953febc

Browse files
author
Alex Couture-Beil
committed
create test to ensure interoperability with openssl tooling
1 parent 5fc65f7 commit 953febc

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Earthfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ RUN apk add --update --no-cache \
1414
less \
1515
make \
1616
openssl \
17+
openssh-keygen \
1718
shellcheck \
1819
util-linux
1920

@@ -86,7 +87,14 @@ secretshare-all:
8687
COPY +secretshare-darwin/secretshare ./secretshare-darwin-amd64
8788
SAVE ARTIFACT ./*
8889

90+
test:
91+
COPY +secretshare-linux/secretshare ./secretshare
92+
RUN ./secretshare
93+
RUN bash -c "echo -n hello | openssl pkeyutl -encrypt -pubin -inkey <(ssh-keygen -f ~/.secretshare.pub -e -m PKCS8) -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 -pkeyopt rsa_mgf1_md:sha256 | base64 | ./secretshare decrypt > output"
94+
RUN bash -c "diff output <( echo -n hello)"
95+
8996
release:
97+
BUILD +test
9098
FROM node:13.10.1-alpine3.11
9199
RUN npm install -g github-release-cli@v1.3.1
92100
WORKDIR /release

build/linux/amd64/secretshare

-512 Bytes
Binary file not shown.

cmd/secretshare/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func main() {
188188
fmt.Fprintf(os.Stderr, "failed while decrypting: %s", err.Error())
189189
os.Exit(1)
190190
}
191-
fmt.Println(data2)
191+
fmt.Printf("%s", data2)
192192
return
193193
}
194194

@@ -197,5 +197,5 @@ func main() {
197197
fmt.Fprintf(os.Stderr, "failed while encrypting: %s", err.Error())
198198
os.Exit(1)
199199
}
200-
fmt.Println(encrypted)
200+
fmt.Printf("%s", encrypted)
201201
}

0 commit comments

Comments
 (0)