Skip to content

Commit e4094fd

Browse files
authored
Merge pull request #176 from sil-org/details
minor cleanup (grammar, spelling, comment rules, name style, dead code)
2 parents c5f4172 + a1e3984 commit e4094fd

6 files changed

Lines changed: 18 additions & 17 deletions

File tree

.github/workflows/govulncheck.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: govulncheck
22
on:
3-
push:
43
schedule: # Every day at 6:08am UTC
54
- cron: '8 6 * * *'
65
workflow_dispatch:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ proxy container to keep tabs on the progress.
136136

137137
To exercise the API as it would be used in AWS Lambda, run this command: `air -c .air-cdk.toml`. This will run a
138138
file watcher that will rebuild the app code and the CDK stack, then run `sam local start-api` using the generated
139-
Cloudformation template. This will listen on port 8160. Any code changes will trigger a rebuild and SAM will restart
139+
CloudFormation template. This will listen on port 8160. Any code changes will trigger a rebuild and SAM will restart
140140
using the new code.
141141

142142
Implementation notes:

apikey_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func TestApiKey_EncryptDecrypt(t *testing.T) {
139139
}
140140

141141
if !bytes.Equal(tt.plaintext, decrypted) {
142-
t.Errorf("results from decypt do not match expected. Got: %s, wanted: %s", decrypted, tt.plaintext)
142+
t.Errorf("results from decrypt do not match expected. Got: %s, wanted: %s", decrypted, tt.plaintext)
143143
return
144144
}
145145
})

totp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type TOTP struct {
4444
// their authenticator app.
4545
ImageURL string `dynamodbav:"-" json:"-"`
4646

47-
// OTPAuthURL is a otpauth URI like "otpauth://totp/idp:john_doe?secret=G5KFM3LNJ5NWQP3O&issuer=idp" that contains
47+
// OTPAuthURL is an otpauth URI like "otpauth://totp/idp:john_doe?secret=G5KFM3LNJ5NWQP3O&issuer=idp" that contains
4848
// the password secret key. It may also contain metadata like issuer, algorithm, and number of digits.
4949
OTPAuthURL string `dynamodbav:"-" json:"-"`
5050
}

u2fsimulator/u2fsimulator.go

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,22 @@ const (
3333
// including the UserPresent (UP) and AttestedCredentialData (AT) flags would be done
3434
// by using the value 65.
3535
// AT(64) + UP(1) = 65
36-
AttObjFlagUserPresent_UP = 1
37-
AttObjFlagUserVerified_UV = 2
38-
AttObjFlagAttestedCredData_AT = 64
39-
AttObjFlagExtensionData_ED = 128
36+
// See https://www.w3.org/TR/webauthn-2/#flags.
37+
38+
// AttObjFlagUserPresent (UP) is the flag that indicates the user is present (UP).
39+
AttObjFlagUserPresent = 1
40+
41+
// AttObjFlagUserVerified is the flag that indicates the user is verified (UV).
42+
AttObjFlagUserVerified = 2
43+
44+
// AttObjFlagAttestedCredData is the flag that indicates attested credential data is included (AT).
45+
AttObjFlagAttestedCredData = 64
46+
47+
// AttObjFlagExtensionData is the flag that indicates extension data is included (ED).
48+
AttObjFlagExtensionData = 128
4049
)
4150

42-
// Internal type for ASN1 coercion
51+
// DsaSignature is an internal type for ASN1 coercion
4352
type DsaSignature struct {
4453
R, S *big.Int
4554
}
@@ -128,7 +137,7 @@ func GetAuthDataAndPrivateKey(rpID, keyHandle string) (authDataStr string, authD
128137
authData = append(authData, r)
129138
}
130139

131-
authData = append(authData, byte(AttObjFlagAttestedCredData_AT+AttObjFlagUserPresent_UP)) // AT & UP flags
140+
authData = append(authData, byte(AttObjFlagAttestedCredData+AttObjFlagUserPresent)) // AT & UP flags
132141

133142
// Add 4 bytes for counter = 0 (for now, just make it 0)
134143
authData = append(authData, []byte{byte(0), byte(0), byte(0), byte(0)}...)

utils_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,6 @@ func encodeBase64(buf []byte) string {
107107
return strings.TrimRight(s, "=")
108108
}
109109

110-
// SignResponse as defined by the FIDO U2F Javascript API.
111-
type SignResponse struct {
112-
KeyHandle string `json:"keyHandle"`
113-
SignatureData string `json:"signatureData"`
114-
ClientData string `json:"clientData"`
115-
}
116-
117110
// ClientData as defined by the FIDO U2F Raw Message Formats specification.
118111
type ClientData struct {
119112
Typ string `json:"type"`

0 commit comments

Comments
 (0)