libspdm icon indicating copy to clipboard operation
libspdm copied to clipboard

Question: Can we consider adding support for certs path?

Open ZhibinLiIntel opened this issue 1 year ago • 7 comments

As https://github.com/DMTF/libspdm/blob/main/os_stub/spdm_device_secret_lib_sample/cert.c#L55 shows, now spdm-emu/libspdm will only search for certificates under the built binary directory which is less flexible in some cases. Or am I missing some options/key parameters here? If not, can we consider adding such an option/parameter for specifying the certs path?

ZhibinLiIntel avatar Apr 27 '23 08:04 ZhibinLiIntel

Do you want to include your own certificates in unit tests?

steven-bellock avatar Apr 27 '23 14:04 steven-bellock

Do you want to include your own certificates in unit tests?

Not at this moment but this could be a valid use case.

Another possible use case is that if I want to build my own binary based on libspdm/spdm-emu, then I have to put my binary in the same path with those stock certificates which is not that flexible especially when I only want the binary in some system PATH (/usr/bin for example) and the certificates in some other path (let's say /usr/share).

ZhibinLiIntel avatar Apr 28 '23 03:04 ZhibinLiIntel

Then why not override the default key with your key?

jyao1 avatar Apr 30 '23 13:04 jyao1

Or you can create your own spdm_device_secret_lib instance to provide such capability.

jyao1 avatar May 01 '23 14:05 jyao1

Or you can create your own spdm_device_secret_lib instance to provide such capability.

Yes this works. I'm asking just because the functionalities of the default library is quite enough except the one I mention here so I'm wondering if such an option can be added (which sounds reasonable from my POV). Or I can look into it and file a PR later if you guys think this is actually needed.

Then why not override the default key with your key?

By overriding the default key do you mean that I have to create a custom spdm_device_secret_lib, too? Or is there another simpler way to do so?

ZhibinLiIntel avatar May 04 '23 10:05 ZhibinLiIntel

Then why not override the default key with your key?

By overriding the default key do you mean that I have to create a custom spdm_device_secret_lib, too? Or is there another simpler way to do so?

I mean after make copy_sample_key action, you can copy your own key to the build\bin\ dir to override the default key there.

jyao1 avatar May 12 '23 02:05 jyao1

@ZhibinLiIntel , assign to you. Please propose a fix or close it if you agree.

jyao1 avatar Jul 20 '23 01:07 jyao1