Drive-Trust-Alliance / sedutil

DTA sedutil Self encrypting drive software
603 stars 233 forks source link

[feature] Add securemode, verifySIDPassword #408

Open hMcLauchlan opened 1 year ago

hMcLauchlan commented 1 year ago

Hello!

Thank you for working on this utility. Please find in this PR some patches which we've carried on top of master to enable our use cases (particularly around setting passwords on SEDs). They should be generic enough to be mainline'd, but I'm happy to make changes as appropriate.

This PR does two main things:

Please see commit messages for more details. Thanks!

Edit: Forgot to post my test plan:

[root@host~]# ./sedutil-cli -s -v -n --setSIDPassword /dev/nvme0n1
Log level set to DBG 
sedutil version : 
No password hashing incompatible with secure mode
Disabling password hashing in secure mode (-s)

Please enter password ***********************************Unknown Feature in Discovery 0 response 402
Unknown Feature in Discovery 0 response 402
Performing setSIDPassword 

Please enter the new password ***

Please confirm the new password ***   
[root@host ~]# ./sedutil-cli -s -v -n --verifySIDPassword /dev/nvme0
Log level set to DBG 
sedutil version : 
No password hashing incompatible with secure mode
Disabling password hashing in secure mode (-s)

Please enter password ***Unknown Feature in Discovery 0 response 402
Unknown Feature in Discovery 0 response 402
Performing verifySIDPassword 
Successfully verified SIDPassword
[root@host ~]# ./sedutil-cli -s -v -n --setSIDPassword /dev/nvme0n1 
Log level set to DBG 
sedutil version : 
No password hashing incompatible with secure mode
Disabling password hashing in secure mode (-s)

Please enter password ***Unknown Feature in Discovery 0 response 402
Unknown Feature in Discovery 0 response 402
Performing setSIDPassword 

Please enter the new password ***********************************

Please confirm the new password ***********************************
[root@host~]# ./sedutil-cli -s -v -n --verifySIDPassword /dev/nvme0
Log level set to DBG 
sedutil version : 
No password hashing incompatible with secure mode
Disabling password hashing in secure mode (-s)

Please enter password ***********************************Unknown Feature in Discovery 0 response 402
Unknown Feature in Discovery 0 response 402
Performing verifySIDPassword 
Successfully verified SIDPassword