Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux: Correct error handling for derive_psk_digest #877

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

prashanth-nayak
Copy link
Contributor

Treat only negative return values from derive_psk_digest () as errors.

@prashanth-nayak
Copy link
Contributor Author

prashanth-nayak commented Aug 6, 2024

Without the fix:

ssan-rx2530-15:~ # nvme gen-tls-key -I 1 -m 1 -c nqn.1992-08.com.netapp:sn.0a86ed924b8d11efa459d039ea482fba:subsystem.s2 -i
NVMeTLSkey-1:01:BLRhgb8OqN3M2nchfHb1r8b0nUzOFe8KyGRGX56Jbbojq6oZ:
Inserted TLS key
00000000

With the fix:

ssan-rx2530-15:~ # nvme gen-tls-key -n nqn.2014-08.org.nvmexpress:uuid:713b3816-f9bf-ba43-b95a-5e4bf8c726e9 -c nqn.1992-08.com.netapp:sn.2f7701d3542f11efb872005056bba694:subsystem.ss1 -m 1 -I 1 -i
NVMeTLSkey-1:01:5ldrsnYzSywCj8FMdxV6kfLAMs/4torA6QhS8d9f0UTCGhPy:
Inserted TLS key 12daac64
ssan-rx2530-15:~ #

ssan-rx2530-15:~ # cat /proc/keys | grep NVMe
12daac64 I--Q--- 5 perm 3b010000 0 0 psk NVMe1R01 nqn.2014-08.org.nvmexpress:uuid:713b3816-f9bf-ba43-b95a-5e4bf8c726e9 nqn.1992-08.com.netapp:sn.2f7701d3542f11efb872005056bba694:subsystem.ss1 nQlz29o14678dui139NFoI7EeqVvpYsTlV7zQpdKdR4=: 32

Treat only negative return values are errors.

Signed-off-by: Prashanth Nayak <[email protected]>
@martin-gpy
Copy link
Contributor

Thanks @prashanth-nayak

@igaw - This should fix #875

@igaw igaw merged commit 9967817 into linux-nvme:master Aug 7, 2024
15 checks passed
@igaw
Copy link
Collaborator

igaw commented Aug 7, 2024

Thanks a lot!

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.

3 participants