-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As part of container image we also have detached gpg bundle signature and this pr is verify that with bundle to make sure bundle is coming from us.
- Loading branch information
1 parent
56c4db3
commit 93babb5
Showing
64 changed files
with
12,307 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package gpg | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/ProtonMail/go-crypto/openpgp" | ||
"github.com/code-ready/crc/pkg/crc/constants" | ||
) | ||
|
||
func Verify(filePath, signatureFilePath string) error { | ||
data, err := os.Open(filePath) | ||
if err != nil { | ||
return err | ||
} | ||
defer data.Close() | ||
|
||
signature, err := os.Open(signatureFilePath) | ||
if err != nil { | ||
return err | ||
} | ||
defer signature.Close() | ||
|
||
keyring, err := openpgp.ReadArmoredKeyRing(bytes.NewBufferString(constants.GPGPublicKey)) | ||
if err != nil { | ||
return fmt.Errorf("failed to parse public key: %s", err) | ||
} | ||
|
||
if _, err = openpgp.CheckArmoredDetachedSignature(keyring, data, signature, nil); err != nil { | ||
return fmt.Errorf("failed to check signature: %s", err) | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
vendor/github.com/ProtonMail/go-crypto/AUTHORS
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
vendor/github.com/ProtonMail/go-crypto/CONTRIBUTORS
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
vendor/github.com/ProtonMail/go-crypto/LICENSE
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
vendor/github.com/ProtonMail/go-crypto/PATENTS
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.