-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: add eckey_t #93
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long term this is not my preferred method of addressing this issue. Moving to a COSE Key structure and replacing the current CBOR key passed in allows for similar ways of dealing with the passed in keys and also allows for keeping the internal keys created around for a period of time if they are used multiple times, for example doing a signature verification against the same key multiple times.
I can understand doing this short term but it might mean another change later down the line
include/cose/cose.h
Outdated
typedef struct eckey_t { | ||
struct ec_key_st *key; | ||
int group; | ||
} eckey_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure where this came from. I would expect it to be an EVP_KEY*
Replacing the CBOR key will break compatibility, is that acceptable? If true, I agree we should replace CBOR key with a COSE key. |
It would be possible to provide a thin wrapper that converts a CBOR key to a COSE key for a while and mark those functions as depreciated. Although I think every compiler does that differently. |
Thanks! It makes sense to me. |
Can we make this in a next mr? I wanted to make sure that ot-commissioner works with upstream cose-c. And it seems to work ok now... i’m for merging, adding a test and change the interfaces... @jimsch what do you think? |
Yeah, if the code would be c++, then this would be part of the language ;) |
A new PR WFM - I chose C rather than C++ because of the environment that I was shooting for. In retrospect I think I could have gone with C++ but that is life. |
I meant, that i think is better to merge this now (no side effects for existing users) then to improve it... |
int group; | ||
} eckey_t; | ||
#endif // COSE_C_USE_MBEDTLS | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted in the other pull request, this is not the way that I think this should go in the end. It would be better to declare a COSE_Key structure and have a method to build that. This can this be changed internal to the library without issues as well as adding some other types of keys. If you are doing this, please just make this specific to MBEDTLS as passing in the structure is not how one would do this for OpenSSL, instead you would pass in an EVP_KEY *.
I don't know what the current support is in MBEDTLS for TEMs at the moment. I would expect that at some point in the future this is going to be added if not currently present and that would require yet a different possible internal change for that support.
I am tossing together a framework for this right now. |
thanks @jimsch ! |
what
cose_configure.h
is create on the fly at configure time similiar to autoconfCOSE_C_...
why