40#ifndef PROTOCORE_OIDC_H
41#define PROTOCORE_OIDC_H
45#if PROTOCORE_ENABLE_OIDC
50#define PROTOCORE_OIDC_RSA_BYTES 256
53#define PROTOCORE_OIDC_HDR_LEN 512
56#define PROTOCORE_OIDC_ISS_LEN 256
63#define PROTOCORE_PLAINTEXT_WORK_OIDC \
64 (PROTOCORE_OIDC_HDR_LEN + PROTOCORE_OIDC_RSA_BYTES + PROTOCORE_OIDC_MAX_LEN + PROTOCORE_OIDC_ISS_LEN)
69 PROTOCORE_OIDC_OK = 0,
70 PROTOCORE_OIDC_ERR_FORMAT = -1,
71 PROTOCORE_OIDC_ERR_ALG = -2,
72 PROTOCORE_OIDC_ERR_KEY = -3,
73 PROTOCORE_OIDC_ERR_SIGNATURE = -4,
74 PROTOCORE_OIDC_ERR_ISS = -5,
75 PROTOCORE_OIDC_ERR_AUD = -6,
76 PROTOCORE_OIDC_ERR_EXPIRED = -7,
77 PROTOCORE_OIDC_ERR_NOT_YET = -8,
78} protocore_oidc_result;
83 uint8_t n[PROTOCORE_OIDC_RSA_BYTES];
91 char sub[PROTOCORE_OIDC_SUB_LEN];
92 char email[PROTOCORE_OIDC_EMAIL_LEN];
95} protocore_oidc_claims;
103 protocore_oidc_key rsa;
138 OidcExpectArgs expect;
140 protocore_oidc_result result;
141 char text[PROTOCORE_OIDC_KID_LEN];
142 protocore_oidc_claims claims;
146extern OidcVars OidcV;
151 void (*
const token_kid)(uint8_t *work);
152 void (*
const jwks_find)(uint8_t *work);
153 void (*
const verify_with_key)(uint8_t *work);
154 void (*
const verify)(uint8_t *work);
159void protocore_oidc_token_kid(uint8_t *work);
160void protocore_oidc_jwks_find(uint8_t *work);
161void protocore_oidc_verify_with_key(uint8_t *work);
162void protocore_oidc_verify(uint8_t *work);
168static const OidcNs Oidc __attribute__((unused)) = {
169 .token_kid = protocore_oidc_token_kid,
170 .jwks_find = protocore_oidc_jwks_find,
171 .verify_with_key = protocore_oidc_verify_with_key,
172 .verify = protocore_oidc_verify,
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS