Skip to content

Commit 91d4e23

Browse files
authored
Deprecate the BlockedKeyTable feature flag (letsencrypt#4881)
This commit consists of three classes of changes: 1) Changing various command main.go files to always behave as they would have when features.BlockedKeyTable was true. Also changing one test in the same manner. 2) Removing the BlockedKeyTable flag from configuration in config-next, because the flag is already live. 3) Moving the BlockedKeyTable flag to the "deprecated" section of features.go, and regenerating featureflag_strings.go. A future change will remove the BlockedKeyTable flag (and other similarly deprecated flags) from features.go entirely. Fixes letsencrypt#4873
1 parent 7b93e00 commit 91d4e23

File tree

18 files changed

+25
-74
lines changed

18 files changed

+25
-74
lines changed

cmd/boulder-ca/main.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,7 @@ func main() {
165165
cmd.FailOnError(err, "Failed to load credentials and create gRPC connection to SA")
166166
sa := bgrpc.NewStorageAuthorityClient(sapb.NewStorageAuthorityClient(conn))
167167

168-
var blockedKeyFunc goodkey.BlockedKeyCheckFunc
169-
if features.Enabled(features.BlockedKeyTable) {
170-
blockedKeyFunc = sa.KeyBlocked
171-
}
172-
kp, err := goodkey.NewKeyPolicy(c.CA.WeakKeyFile, c.CA.BlockedKeyFile, blockedKeyFunc)
168+
kp, err := goodkey.NewKeyPolicy(c.CA.WeakKeyFile, c.CA.BlockedKeyFile, sa.KeyBlocked)
173169
cmd.FailOnError(err, "Unable to create key policy")
174170

175171
var orphanQueue *goque.Queue

cmd/boulder-ra/main.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,7 @@ func main() {
204204
pendingAuthorizationLifetime = time.Duration(c.RA.PendingAuthorizationLifetimeDays) * 24 * time.Hour
205205
}
206206

207-
var blockedKeyFunc goodkey.BlockedKeyCheckFunc
208-
if features.Enabled(features.BlockedKeyTable) {
209-
blockedKeyFunc = sac.KeyBlocked
210-
}
211-
kp, err := goodkey.NewKeyPolicy(c.RA.WeakKeyFile, c.RA.BlockedKeyFile, blockedKeyFunc)
207+
kp, err := goodkey.NewKeyPolicy(c.RA.WeakKeyFile, c.RA.BlockedKeyFile, sac.KeyBlocked)
212208
cmd.FailOnError(err, "Unable to create key policy")
213209

214210
if c.RA.MaxNames == 0 {

cmd/boulder-wfe/main.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,8 @@ func main() {
143143
clk := cmd.Clock()
144144

145145
rac, sac, rns, npm := setupWFE(c, logger, stats, clk)
146-
var blockedKeyFunc goodkey.BlockedKeyCheckFunc
147-
if features.Enabled(features.BlockedKeyTable) {
148-
blockedKeyFunc = sac.KeyBlocked
149-
}
150146
// don't load any weak keys, but do load blocked keys
151-
kp, err := goodkey.NewKeyPolicy("", c.WFE.BlockedKeyFile, blockedKeyFunc)
147+
kp, err := goodkey.NewKeyPolicy("", c.WFE.BlockedKeyFile, sac.KeyBlocked)
152148
cmd.FailOnError(err, "Unable to create key policy")
153149
wfe, err := wfe.NewWebFrontEndImpl(stats, clk, kp, rns, npm, logger)
154150
cmd.FailOnError(err, "Unable to create WFE")

cmd/boulder-wfe2/main.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,8 @@ func main() {
316316
clk := cmd.Clock()
317317

318318
rac, sac, rns, npm := setupWFE(c, logger, stats, clk)
319-
var blockedKeyFunc goodkey.BlockedKeyCheckFunc
320-
if features.Enabled(features.BlockedKeyTable) {
321-
blockedKeyFunc = sac.KeyBlocked
322-
}
323319
// don't load any weak keys, but do load blocked keys
324-
kp, err := goodkey.NewKeyPolicy("", c.WFE.BlockedKeyFile, blockedKeyFunc)
320+
kp, err := goodkey.NewKeyPolicy("", c.WFE.BlockedKeyFile, sac.KeyBlocked)
325321
cmd.FailOnError(err, "Unable to create key policy")
326322

327323
if c.WFE.StaleTimeout.Duration == 0 {

features/featureflag_string.go

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

features/features.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const (
1818
CheckRenewalFirst
1919
ParallelCheckFailedValidation
2020
DeleteUnusedChallenges
21+
BlockedKeyTable
2122

2223
// Currently in-use features
2324
// Check CAA and respect validationmethods parameter.
@@ -49,12 +50,8 @@ const (
4950
StoreIssuerInfo
5051
// StoreKeyHashes enables storage of SPKI hashes associated with certificates.
5152
StoreKeyHashes
52-
// BlockedKeyTable enables storage, and checking, of the blockedKeys table in addition
53-
// to the blocked key list
54-
BlockedKeyTable
5553
// StoreRevokerInfo enables storage of the revoker and a bool indicating if the row
56-
// was checked for extant unrevoked certificates in the blockedKeys table. It should
57-
// only be enabled if BlockedKeyTable is also enabled.
54+
// was checked for extant unrevoked certificates in the blockedKeys table.
5855
StoreRevokerInfo
5956
// RestrictRSAKeySizes enables restriction of acceptable RSA public key moduli to
6057
// the common sizes (2048, 3072, and 4096 bits).
@@ -84,7 +81,6 @@ var features = map[FeatureFlag]bool{
8481
StoreIssuerInfo: false,
8582
WriteIssuedNamesPrecert: false,
8683
StoreKeyHashes: false,
87-
BlockedKeyTable: false,
8884
StoreRevokerInfo: false,
8985
RestrictRSAKeySizes: false,
9086
FasterNewOrdersRateLimit: false,

ra/ra.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ func (ra *RegistrationAuthorityImpl) revokeCertificate(ctx context.Context, cert
16761676
if err != nil {
16771677
return err
16781678
}
1679-
if features.Enabled(features.BlockedKeyTable) && reason == ocsp.KeyCompromise {
1679+
if reason == ocsp.KeyCompromise {
16801680
digest, err := core.KeyDigest(cert.PublicKey)
16811681
if err != nil {
16821682
return err

ra/ra_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3835,10 +3835,6 @@ func TestRevocationAddBlockedKey(t *testing.T) {
38353835
_, _, ra, _, cleanUp := initAuthorities(t)
38363836
defer cleanUp()
38373837

3838-
err := features.Set(map[string]bool{"BlockedKeyTable": true})
3839-
test.AssertNotError(t, err, "features.Set failed")
3840-
defer features.Reset()
3841-
38423838
mockSA := mockSABlockedKey{}
38433839
ra.SA = &mockSA
38443840
ra.CA = &mockCAOCSP{}

sa/_db-next/migrations/20200407130407_AddKeyHashTable.sql renamed to sa/_db/migrations/20200407130407_AddKeyHashTable.sql

File renamed without changes.

sa/_db-next/migrations/20200414124347_AddBlockedKeysTable.sql renamed to sa/_db/migrations/20200414124347_AddBlockedKeysTable.sql

File renamed without changes.

0 commit comments

Comments
 (0)