add signature test for snowflake plugin
This commit is contained in:
@@ -69,7 +69,7 @@ var aliceSU3 []byte
|
||||
|
||||
func TestSig_reseed_i2pgit(t *testing.T) {
|
||||
t.Skip()
|
||||
key := fileRSAPubKey(t, "./testdata/hankhill19580_at_gmail.com.crt")
|
||||
key := fileRSAPubKey(t, "./testdata/reseed-hankhill19580_at_gmail.com.crt")
|
||||
content := fileBytes(t, "./testdata/reseed-i2pgit-content.zip")
|
||||
sig := fileBytes(t, "./testdata/reseed-i2pgit-signature")
|
||||
hash := crypto.SHA512.New()
|
||||
@@ -81,6 +81,20 @@ func TestSig_reseed_i2pgit(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSig_plugin_snowflake(t *testing.T) {
|
||||
t.Skip()
|
||||
key := fileRSAPubKey(t, "./testdata/snowflake-hankhill19580_at_gmail.com.crt")
|
||||
content := fileBytes(t, "./testdata/snowflake-content")
|
||||
sig := fileBytes(t, "./testdata/snowflake-signature")
|
||||
hash := crypto.SHA512.New()
|
||||
hash.Write(content)
|
||||
digest := hash.Sum(nil)
|
||||
err := rsa.VerifyPKCS1v15(key, 0, digest, sig)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRead(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -273,7 +287,7 @@ func TestRead(t *testing.T) {
|
||||
name: "reseed-i2pgit.su3",
|
||||
skip: true,
|
||||
reader: fileReader(t, "testdata/reseed-i2pgit.su3"),
|
||||
key: fileRSAPubKey(t, "./testdata/hankhill19580_at_gmail.com.crt"),
|
||||
key: fileRSAPubKey(t, "./testdata/reseed-hankhill19580_at_gmail.com.crt"),
|
||||
wantSU3: &SU3{
|
||||
SignatureType: RSA_SHA512_4096,
|
||||
SignatureLength: 512,
|
||||
|
7
lib/su3/testdata/README.md
vendored
7
lib/su3/testdata/README.md
vendored
@@ -1,6 +1,11 @@
|
||||
This directory contains test data for the `su3` package.
|
||||
|
||||
- `hankhill19580_at_gmail.com.crt` - A 4096-bit RSA public key
|
||||
- `reseed-hankhill19580_at_gmail.com.crt` - A 4096-bit RSA public key used to sign `reseed-i2pgit.su3`.
|
||||
- `reseed-i2pgit.su3` - A reseed file obtained from [https://reseed.i2pgit.org/](https://reseed.i2pgit.org/) on 2022-07-28.
|
||||
- `reseed-i2pgit-content.zip` - The content of the above reseed file.
|
||||
- `reseed-i2pgit-signature` - The signature of the above reseed file.
|
||||
|
||||
- `snowflake-hankhill19580_at_gmail.com.crt` - A 4096-bit RSA public key used to sign `snowflake-linux.su3`.
|
||||
- `snowflake-linux.su3` - A plugin file obtained from [https://github.com/eyedeekay/blizzard/releases](https://github.com/eyedeekay/blizzard/releases) on 2022-08-02.
|
||||
- `snowflake-content` - The content of the above plugin file.
|
||||
- `snowflake-signature` - The signature of the above plugin file.
|
||||
|
Reference in New Issue
Block a user