add signature test for snowflake plugin

This commit is contained in:
apeace
2022-08-02 11:50:02 -04:00
parent 8d39f1512a
commit 136133e643
3 changed files with 22 additions and 3 deletions

View File

@@ -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,