chore(): fix typo

This commit is contained in:
Nicolas Carlier 2020-08-20 08:18:24 +00:00
parent 5911b8f3c3
commit 072124865e
4 changed files with 9 additions and 9 deletions

View File

@ -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()))

View File

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

View File

@ -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, "")
}

View File

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