Skip to content

Commit 2780d98

Browse files
author
Christian Svensson
committed
doc(todo): Explain some TODOs a bit more
Signed-off-by: Christian Svensson <[email protected]>
1 parent a1283e3 commit 2780d98

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

pkg/core/core_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package core
22

3-
// TODO
3+
// TODO: The plan here is to extract some RPC responses and test the parsing
4+
// against these known drives to ensure long-term compatibility.
5+
// Here are some Discovery Level0 bytes to get started.
46

57
// Samsung EVO 860:
68
// d0raw: [0 0 0 144 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 16 12 17 0 0 0 0 0 0 0 0 0 0 0 0 2 16 12 31 0 0 0 0 0 0 0 0 0 0 0 0 3 16 28 1 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 2 2 16 12 0 0 0 9 0 160 0 0 0 0 0 1 2 3 16 16 16 4 0 1 0 0 4 0 9 0 0 0 0 0 0 0]

pkg/core/table/locking.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,6 @@ func Locking_Set(s *core.Session, row *LockingRow) error {
277277
// TODO: Add these columns
278278
//mc.StartOptionalParameter(3, "RangeStart")
279279
//mc.StartOptionalParameter(4, "RangeLength")
280-
//mc.StartOptionalParameter(5, "ReadLockEnabled")
281-
//mc.StartOptionalParameter(6, "WriteLockEnabled")
282280

283281
if row.ReadLockEnabled != nil {
284282
mc.StartOptionalParameter(5, "ReadLockEnabled")
@@ -303,7 +301,6 @@ func Locking_Set(s *core.Session, row *LockingRow) error {
303301
}
304302

305303
// TODO: Add these columns
306-
//mc.StartOptionalParameter(8, "WriteLocked")
307304
//mc.StartOptionalParameter(9, "LockOnReset")
308305
//mc.StartOptionalParameter(10, "ActiveKey")
309306

pkg/locking/locking.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func NewSession(cs *core.ControlSession, lmeta *LockingSPMeta, auth LockingSPAut
134134
return nil, err
135135
}
136136

137-
// TODO: Fill l.Authorities
137+
// TODO: Fill l.Authorities with known users for admin actions
138138
return l, nil
139139
}
140140

@@ -243,18 +243,22 @@ func initializeEnterprise(s *core.Session, d0 *core.Level0Discovery, ic *initial
243243
if err == nil {
244244
lmeta.MSID = msidPin
245245
}
246-
// TODO: Take ownership
247-
// TODO: lockdown
246+
// TODO: Implement take ownership for enterprise if activated in initializeConfig.
247+
// The spec should explain what is needed.
248+
// TODO: If initializeConfig wants WithHardended, implement relevant
249+
// FIPS recommendations.
248250
return nil
249251
}
250252

251253
func initializeOpalFamily(s *core.Session, d0 *core.Level0Discovery, ic *initializeConfig, lmeta *LockingSPMeta) error {
252-
// TODO: Verify with C_PIN behavior and Block SID
254+
// TODO: Verify with C_PIN behavior and Block SID - no need to burn PIN tries
255+
// if we can say that MSID will not work.
253256
msidPin, err := table.Admin_C_PIN_MSID_GetPIN(s)
254257
if err == nil {
255258
lmeta.MSID = msidPin
256259
}
257260
// TODO: Take ownership (*before* Activate to ensure that the PINs are copied)
261+
// This is explained in the spec.
258262
lcs, err := table.Admin_SP_GetLifeCycleState(s, core.LockingSP)
259263
if err != nil {
260264
return err
@@ -274,7 +278,8 @@ func initializeOpalFamily(s *core.Session, d0 *core.Level0Discovery, ic *initial
274278
return fmt.Errorf("unsupported life cycle state on locking SP: %v", lcs)
275279
}
276280

277-
// TODO: lockdown
281+
// TODO: If initializeConfig wants WithHardended, implement relevant
282+
// FIPS recommendations.
278283
return nil
279284
}
280285

pkg/locking/range.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type Range struct {
4545
ReadLocked bool
4646
WriteLocked bool
4747

48-
//LockOnReset SomeType TODO
48+
//LockOnReset SomeType TODO: Create this type from spec
4949
}
5050

5151
func fillRanges(s *core.Session, l *LockingSP) error {
@@ -86,8 +86,8 @@ func fillRanges(s *core.Session, l *LockingSP) error {
8686
r.ReadLocked = *lr.ReadLocked
8787
r.WriteLocked = *lr.WriteLocked
8888
}
89-
// TODO: Users
90-
// TODO: LockOnReset
89+
// TODO: Enumerate users with permissions on this range
90+
// TODO: Fill the LockOnReset property
9191
l.Ranges = append(l.Ranges, r)
9292
}
9393
return nil

0 commit comments

Comments
 (0)