diff --git a/pkg/middleware/signature.go b/pkg/middleware/signature.go index 6f65d8a..57c26b8 100644 --- a/pkg/middleware/signature.go +++ b/pkg/middleware/signature.go @@ -24,7 +24,7 @@ func HTTPSignature(trustStore pubkey.TrustStore) Middleware { w.Write([]byte("invalid HTTP signature: " + err.Error())) return } - err = verifier.Verify(entry.Pubkey, entry.Algorythm) + err = verifier.Verify(entry.Pubkey, entry.Algorithm) if err != nil { w.WriteHeader(400) w.Write([]byte("invalid HTTP signature: " + err.Error())) diff --git a/pkg/pubkey/pem_truststore.go b/pkg/pubkey/pem_truststore.go index 634fb3f..e186d9d 100644 --- a/pkg/pubkey/pem_truststore.go +++ b/pkg/pubkey/pem_truststore.go @@ -48,7 +48,7 @@ func newPEMTrustStore(filename string) (*pemTrustStore, error) { keyID = "default" } result.keys[keyID] = TrustStoreEntry{ - Algorythm: defaultAlgorithm, + Algorithm: defaultAlgorithm, Pubkey: rsaPublicKey, } logger.Debug.Printf("public key \"%s\" loaded into the trustore", keyID) @@ -60,7 +60,7 @@ func newPEMTrustStore(filename string) (*pemTrustStore, error) { rsaPublicKey, _ := cert.PublicKey.(*rsa.PublicKey) keyID := string(cert.Subject.CommonName) result.keys[keyID] = TrustStoreEntry{ - Algorythm: defaultAlgorithm, + Algorithm: defaultAlgorithm, Pubkey: rsaPublicKey, } logger.Debug.Printf("certificate \"%s\" loaded into the trustore", keyID) diff --git a/pkg/pubkey/test/pem_truststore_test.go b/pkg/pubkey/test/pem_truststore_test.go index a7943fd..4f7cb55 100644 --- a/pkg/pubkey/test/pem_truststore_test.go +++ b/pkg/pubkey/test/pem_truststore_test.go @@ -19,7 +19,7 @@ func TestTrustStoreWithNoKeyID(t *testing.T) { assert.True(t, entry == nil, "") entry = ts.Get("default") assert.NotNil(t, entry, "") - assert.Equal(t, httpsig.RSA_SHA256, entry.Algorythm, "") + assert.Equal(t, httpsig.RSA_SHA256, entry.Algorithm, "") } func TestTrustStoreWithKeyID(t *testing.T) { @@ -30,7 +30,7 @@ func TestTrustStoreWithKeyID(t *testing.T) { assert.NotNil(t, ts, "") entry := ts.Get("test") assert.NotNil(t, entry, "") - assert.Equal(t, httpsig.RSA_SHA256, entry.Algorythm, "") + assert.Equal(t, httpsig.RSA_SHA256, entry.Algorithm, "") } func TestTrustStoreWithCertificate(t *testing.T) { @@ -41,7 +41,7 @@ func TestTrustStoreWithCertificate(t *testing.T) { assert.NotNil(t, ts, "") entry := ts.Get("test.localnet") assert.NotNil(t, entry, "") - assert.Equal(t, httpsig.RSA_SHA256, entry.Algorythm, "") + assert.Equal(t, httpsig.RSA_SHA256, entry.Algorithm, "") } func TestTrustStoreWithMultipleEntries(t *testing.T) { @@ -52,8 +52,8 @@ func TestTrustStoreWithMultipleEntries(t *testing.T) { assert.NotNil(t, ts, "") entry := ts.Get("test.localnet") assert.NotNil(t, entry, "") - assert.Equal(t, httpsig.RSA_SHA256, entry.Algorythm, "") + assert.Equal(t, httpsig.RSA_SHA256, entry.Algorithm, "") entry = ts.Get("foo") assert.NotNil(t, entry, "") - assert.Equal(t, httpsig.RSA_SHA256, entry.Algorythm, "") + assert.Equal(t, httpsig.RSA_SHA256, entry.Algorithm, "") } diff --git a/pkg/pubkey/truststore.go b/pkg/pubkey/truststore.go index f8193b6..1a389b0 100644 --- a/pkg/pubkey/truststore.go +++ b/pkg/pubkey/truststore.go @@ -14,7 +14,7 @@ const defaultAlgorithm = httpsig.RSA_SHA256 // TrustStoreEntry is a trust store entry type TrustStoreEntry struct { Pubkey crypto.PublicKey - Algorythm httpsig.Algorithm + Algorithm httpsig.Algorithm } // TrustStore is a generic interface to retrieve a public key