Skip to content

Commit 2ba33de

Browse files
generatedunixname894542063453888meta-codesync[bot]
authored andcommitted
fbcode/security/sks
Reviewed By: siutsin Differential Revision: D99649668 fbshipit-source-id: 49207ac7cf87b961e7137e86294a1955ff11f739
1 parent 32331cd commit 2ba33de

2 files changed

Lines changed: 7 additions & 23 deletions

File tree

errors.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ package sks
1616

1717
// Define the error messages' patterns that are common across platforms
1818
const (
19-
ErrGenKeyPair = "sks: error while generating key pair with label %q and tag %q: %w"
20-
ErrSignWithKey = "sks: error while signing with key with label %q and tag %q: %w"
21-
ErrFindPubKey = "sks: error while trying to find key with label %q and tag %q: %w"
22-
ErrFindPubKeyNil = "sks: nil key returned for key with label %q and tag %q"
23-
ErrRemoveKey = "sks: error while trying to remove key with label %q and tag %q: %w"
24-
ErrLabelOrTagUnspecified = "sks: you must specify both a label and a tag"
25-
ErrAttributeLookup = "sks: error while looking up attributes for key with label %q and tag %q: %w"
26-
ErrUpdateKeyAttr = "sks: error updating attribute for key with label %q and tag %q"
19+
ErrGenKeyPair = "sks: error while generating key pair with label %q and tag %q: %w"
20+
ErrSignWithKey = "sks: error while signing with key with label %q and tag %q: %w"
21+
ErrFindPubKey = "sks: error while trying to find key with label %q and tag %q: %w"
22+
ErrFindPubKeyNil = "sks: nil key returned for key with label %q and tag %q"
23+
ErrRemoveKey = "sks: error while trying to remove key with label %q and tag %q: %w"
24+
ErrLabelOrTagUnspecified = "sks: you must specify both a label and a tag"
25+
2726
ErrGetSecureHardwareVendorData = "sks: error fetching Secure Hardware Vendor Data: %w"
2827
ErrNotImplemented = "sks: %q method not implemented"
2928
ErrAttestationFailure = "sks: error while trying to attest key with label %q and tag %q: %w"

key.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,6 @@ type regularKey struct {
6161
tag string
6262
}
6363

64-
// LoadKey returns an existing key backed by SKS given the corresponding label, tag, and hash
65-
func LoadKey(label, tag string, hash []byte) (Key, error) {
66-
if pubKey, err := findPubKey(label, tag, hash); err != nil {
67-
return nil, err
68-
} else if pubKey != nil {
69-
return &regularKey{
70-
pubKey: rawToEcdsa(pubKey),
71-
label: label,
72-
tag: tag,
73-
}, nil
74-
}
75-
76-
return nil, fmt.Errorf(ErrFindPubKeyNil, label, tag)
77-
}
78-
7964
// AttestKey will attest the provided SKS key
8065
func AttestKey(label, tag string, attestor attest.Attestor) (*attest.Resp, error) {
8166
return attestKey(label, tag, attestor)

0 commit comments

Comments
 (0)