Skip to content

Cannot get HMAC to use secret OID, and which functions to use? #36

Answered by ayushev
antfarmer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there,

you asked a couple of questions. I'll try to focus at least on the code snippet you have provided.
Hete you try to calculate an hmac using OPTIGA_KEY_ID_SESSION_BASED, for this you get an invalid OID error.
Invalid OID error means (in this particlar case) that the OID you are using doesn't contain a pre-shared secret and probably can't be used internally (EXECUTE access condition). You indicate that the OID is a pre-shared secret by setting up a corresponing metadata.

static const uint8_t metadata [] = {
    //Metadata tag in the data object
    0x20, 0x06,
        //Data object type set to PRESSEC
        0xE8, 0x01, 0x21,
       // Execute Access condition descriptor set to AL…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@antfarmer
Comment options

@ayushev
Comment options

@ayushev
Comment options

@antfarmer
Comment options

Answer selected by ayushev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants