Skip to content

Conversation

@cedwies
Copy link
Collaborator

@cedwies cedwies commented Nov 20, 2025

Add support for changing the device password on an initialized BitBox02.

Changes:

  • Add ChangePasswordRequest protobuf message to bitbox02_system.proto
  • Add change_password field to Request oneof in hww.proto
  • Implement ChangePassword() method in system.go
  • Add firmware version check (requires v9.25.0+)
  • Add status validation (device must be StatusInitialized)
  • Add TestSimulatorChangePassword test coverage
  • Regenerate protobuf Go files

The ChangePassword() method validates device state and firmware version before initiating the password change workflow on the device.

@cedwies cedwies marked this pull request as ready for review November 20, 2025 13:29
return nil
}

func (device *Device) ChangePassword() error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a docstring

func TestSimulatorChangePassword(t *testing.T) {
testInitializedSimulators(t, func(t *testing.T, device *Device, stdOut *bytes.Buffer) {
t.Helper()
require.NoError(t, device.ChangePassword())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail on simulators <v9.25, so something like this will be needed:

if device.version.AtLeast(semver.NewSemVer(9, 21, 0)) {
require.NoError(t, err)
require.Equal(t,
map[int][]byte{
1: unhex("5120f99b8e8d97aa7b068dd7b4e7ae31f51784f5c2a0cae280748cfd23832b7dcba7"),
},
result.GeneratedOutputs,
)
} else {
require.EqualError(t, err, UnsupportedError("9.21.0").Error())
}

Add support for changing the device password on an initialized BitBox02.

Changes:
- Add ChangePasswordRequest protobuf message to bitbox02_system.proto
- Add change_password field to Request oneof in hww.proto
- Implement ChangePassword() method in system.go
- Add firmware version check (requires v9.25.0+)
- Add status validation (device must be StatusInitialized)
- Add TestSimulatorChangePassword test coverage
- Regenerate protobuf Go files

The ChangePassword() method validates device state and firmware version
before initiating the password change workflow on the device.
@cedwies cedwies force-pushed the cedwies/change-password branch from c0a17a6 to 8d2cb78 Compare November 20, 2025 15:36
Copy link
Contributor

@benma benma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK, nice! Please merge 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants