summaryrefslogtreecommitdiff
path: root/internal/verify/verify.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-06-21 10:13:35 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-06-21 10:13:35 +0200
commitf6c074f4fb99fa29927d3b62dd10457bd659f3ed (patch)
tree032eae2267ba2c82c8ae2e25f2eb356b00b51fee /internal/verify/verify.go
parent717a7cf2b9e04bb08e5b9f68fc5b7fa0e1d99e48 (diff)
Verify: Inline the public keys
Diffstat (limited to 'internal/verify/verify.go')
-rw-r--r--internal/verify/verify.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/internal/verify/verify.go b/internal/verify/verify.go
index c335e39..e9a9316 100644
--- a/internal/verify/verify.go
+++ b/internal/verify/verify.go
@@ -7,14 +7,6 @@ import (
"github.com/jwijenbergh/eduvpn-common/internal/types"
)
-// getKeys returns keys taken from https://git.sr.ht/~eduvpn/disco.eduvpn.org#public-keys.
-func getKeys() []string {
- return []string{
- "RWRtBSX1alxyGX+Xn3LuZnWUT0w//B6EmTJvgaAxBMYzlQeI+jdrO6KF", // fkooman@tuxed.net, kolla@uninett.no
- "RWQKqtqvd0R7rUDp0rWzbtYPA3towPWcLDCl7eY9pBMMI/ohCmrS0WiM", // RoSp
- }
-}
-
// Verify verifies the signature (.minisig file format) on signedJson.
//
// expectedFileName must be set to the file type to be verified, either "server_list.json" or "organization_list.json".
@@ -27,7 +19,11 @@ func getKeys() []string {
//
// Verify is a wrapper around verifyWithKeys where allowedPublicKeys is set to the list from https://git.sr.ht/~eduvpn/disco.eduvpn.org#public-keys.
func Verify(signatureFileContent string, signedJson []byte, expectedFileName string, minSignTime uint64, forcePrehash bool) (bool, error) {
- keyStrs := getKeys()
+ // keys taken from https://git.sr.ht/~eduvpn/disco.eduvpn.org#public-keys
+ keyStrs := []string{
+ "RWRtBSX1alxyGX+Xn3LuZnWUT0w//B6EmTJvgaAxBMYzlQeI+jdrO6KF", // fkooman@tuxed.net, kolla@uninett.no
+ "RWQKqtqvd0R7rUDp0rWzbtYPA3towPWcLDCl7eY9pBMMI/ohCmrS0WiM", // RoSp
+ }
valid, err := verifyWithKeys(signatureFileContent, signedJson, expectedFileName, minSignTime, keyStrs, forcePrehash)
if err != nil {
return valid, &types.WrappedErrorMessage{Message: "failed signature verify", Err: err}