device/virtio-nsm: Support string data for extendPCR
PATCH 1/1 device/virtio-nsm: Support string data for extendPCR
NSM device in AWS Nitro Enclaves supports extending with both bytestring and string data.
--- hw/virtio/virtio-nsm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
hw/virtio/virtio-nsm.c +14 -7
@@ -444,7 +444,7 @@ static bool handle_describe_pcr(VirtIONSM *vnsm, struct iovec *request,* key = String("index"), * value = Uint8(pcr), * key = String("data"), -* value = Byte_String(data), +* value = Byte_String(data) || String(data), * } * } * }
@@ -504,14 +504,21 @@ static enum NSMResponseTypes get_nsm_extend_pcr_req(uint8_t *req, size_t len,if (cbor_string_length (pair[i].key) ==4 &&memcmp (str,"data" ,4 ) ==0 ) { -if (!cbor_isa_bytestring (pair[i].value)) { +if (cbor_isa_bytestring (pair[i].value)) { + str =cbor_bytestring_handle (pair[i].value); +if (!str) { + goto cleanup; + } + nsm_req->data_len =cbor_bytestring_length (pair[i].value); + }else if (cbor_isa_string (pair[i].value)) { + str =cbor_string_handle (pair[i].value); +if (!str) { + goto cleanup; + } + nsm_req->data_len =cbor_string_length (pair[i].value); + }else { goto cleanup; } - str =cbor_bytestring_handle (pair[i].value); -if (!str) { - goto cleanup; - } - nsm_req->data_len =cbor_bytestring_length (pair[i].value);/* * nsm_req->data_len will be smaller than NSM_REQUEST_MAX_SIZE as * we already check for the max request size before processing
Signature · 1 line
2.39.5
Hey Dorjoy,
Thanks a lot for the patch! Would you mind to send to the ML so it can go through the normal review + apply cycle? :)
Same comment for the other patches.
Alex
Quoted 51 lines · Dorjoy Chowdhury
NSM device in AWS Nitro Enclaves supports extending with both bytestring and string data.
Signed-off-by Dorjoy Chowdhury <[email protected]>--- hw/virtio/virtio-nsm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)hw/virtio/virtio-nsm.c +14
-8@@ -444,7 +444,7 @@ static bool handle_describe_pcr(VirtIONSM *vnsm, struct iovec *request,* key = String("index"), * value = Uint8(pcr), * key = String("data"), -* value = Byte_String(data), +* value = Byte_String(data) || String(data), * } * } * } @@ -504,14 +504,21 @@ static enum NSMResponseTypes get_nsm_extend_pcr_req(uint8_t *req, size_t len,if (cbor_string_length (pair[i].key) ==4 &&memcmp (str,"data" ,4 ) ==0 ) { -if (!cbor_isa_bytestring (pair[i].value)) { +if (cbor_isa_bytestring (pair[i].value)) { + str =cbor_bytestring_handle (pair[i].value); +if (!str) { + goto cleanup; + } + nsm_req->data_len =cbor_bytestring_length (pair[i].value); + }else if (cbor_isa_string (pair[i].value)) { + str =cbor_string_handle (pair[i].value); +if (!str) { + goto cleanup; + } + nsm_req->data_len =cbor_string_length (pair[i].value); + }else { goto cleanup; } - str =cbor_bytestring_handle (pair[i].value); -if (!str) { - goto cleanup; - } - nsm_req->data_len =cbor_bytestring_length (pair[i].value);/* * nsm_req->data_len will be smaller than NSM_REQUEST_MAX_SIZE as * we already check for the max request size before processing --
Quoted 2 lines
2.39.5
Amazon Web Services Development Center Germany GmbH Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
Hey Alex,
Quoted 7 lines · Alexander Graf
Hey Dorjoy,
Thanks a lot for the patch! Would you mind to send to the ML so it can go through the normal review + apply cycle? :)
Same comment for the other patches.
I don't understand. I sent them to the mailing list too, no? I see the cc's on the patches.
Regards,
Dorjoy
Quoted 1 line
Hey Dorjoy,
Quoted 11 lines · Dorjoy Chowdhury
Hey Alex,
On Tue, Nov 12, 2024, 6:14 PM Alexander Graf <[email protected]> wrote:
Hey Dorjoy,
Thanks a lot for the patch! Would you mind to send to the ML so it can
go through the normal review + apply cycle? :)
Quoted 5 lines
Same comment for the other patches.
I don't understand. I sent them to the mailing list too, no? I see the cc's on the patches.
You did indeed - I'm just blind :). Let me have another look at the actual contents of the patches!
Alex
Amazon Web Services Development Center Germany GmbH Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
Ping.
This is a small one that needs review.
Regards,
Dorjoy
Quoted 3 lines · Dorjoy Chowdhury
Ping.
Ping...
This is a small one that can be reviewed and picked up for merging. Thanks!
Regards,
Dorjoy
Quoted 9 lines · Dorjoy Chowdhury
Quoted 3 lines · Dorjoy Chowdhury
Ping.
Ping...
This is a small one that can be reviewed and picked up for merging. Thanks!
Gentle ping.
Regards,
Dorjoy
Quoted 4 lines · Dorjoy Chowdhury
NSM device in AWS Nitro Enclaves supports extending with both bytestring and string data.
Signed-off-by Dorjoy Chowdhury <[email protected]>
Alex
Quoted 46 lines
--- hw/virtio/virtio-nsm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)hw/virtio/virtio-nsm.c +14
-8@@ -444,7 +444,7 @@ static bool handle_describe_pcr(VirtIONSM *vnsm, struct iovec *request,* key = String("index"), * value = Uint8(pcr), * key = String("data"), -* value = Byte_String(data), +* value = Byte_String(data) || String(data), * } * } * } @@ -504,14 +504,21 @@ static enum NSMResponseTypes get_nsm_extend_pcr_req(uint8_t *req, size_t len,if (cbor_string_length (pair[i].key) ==4 &&memcmp (str,"data" ,4 ) ==0 ) { -if (!cbor_isa_bytestring (pair[i].value)) { +if (cbor_isa_bytestring (pair[i].value)) { + str =cbor_bytestring_handle (pair[i].value); +if (!str) { + goto cleanup; + } + nsm_req->data_len =cbor_bytestring_length (pair[i].value); + }else if (cbor_isa_string (pair[i].value)) { + str =cbor_string_handle (pair[i].value); +if (!str) { + goto cleanup; + } + nsm_req->data_len =cbor_string_length (pair[i].value); + }else { goto cleanup; } - str =cbor_bytestring_handle (pair[i].value); -if (!str) { - goto cleanup; - } - nsm_req->data_len =cbor_bytestring_length (pair[i].value);/* * nsm_req->data_len will be smaller than NSM_REQUEST_MAX_SIZE as * we already check for the max request size before processing --
Quoted 2 lines
2.39.5
Amazon Web Services Development Center Germany GmbH Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
Quoted 11 lines · Alexander Graf
Quoted 4 lines · Dorjoy Chowdhury
NSM device in AWS Nitro Enclaves supports extending with both bytestring and string data.
Signed-off-by Dorjoy Chowdhury <[email protected]>Reviewed-by Alexander Graf <[email protected]>
cc Paolo. This has been reviewed as well so can be picked up for merging. Thanks!
Regards,
Dorjoy
Philippe Mathieu-Daudé
AppliedQuoted 7 lines · Dorjoy Chowdhury
NSM device in AWS Nitro Enclaves supports extending with both bytestring and string data.
Signed-off-by Dorjoy Chowdhury <[email protected]>--- hw/virtio/virtio-nsm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
Queued, thanks!