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)
68 PROTOCORE_OIDC_OK = 0,
69 PROTOCORE_OIDC_ERR_FORMAT = -1,
70 PROTOCORE_OIDC_ERR_ALG = -2,
71 PROTOCORE_OIDC_ERR_KEY = -3,
72 PROTOCORE_OIDC_ERR_SIGNATURE = -4,
73 PROTOCORE_OIDC_ERR_ISS = -5,
74 PROTOCORE_OIDC_ERR_AUD = -6,
75 PROTOCORE_OIDC_ERR_EXPIRED = -7,
76 PROTOCORE_OIDC_ERR_NOT_YET = -8,
82 uint8_t n[PROTOCORE_OIDC_RSA_BYTES];
90 char sub[PROTOCORE_OIDC_SUB_LEN];
91 char email[PROTOCORE_OIDC_EMAIL_LEN];
94} protocore_oidc_claims;
102 protocore_oidc_key rsa;
137 OidcExpectArgs expect;
139 protocore_oidc_result result;
140 char text[PROTOCORE_OIDC_KID_LEN];
141 protocore_oidc_claims claims;
145extern OidcVars OidcV;
150 void (*
const token_kid)(
const uint8_t *work);
151 void (*
const jwks_find)(uint8_t *work);
152 void (*
const verify_with_key)(
const uint8_t *work);
153 void (*
const verify)(uint8_t *work);
158void protocore_oidc_token_kid(
const uint8_t *work);
159void protocore_oidc_jwks_find(uint8_t *work);
160void protocore_oidc_verify_with_key(
const uint8_t *work);
161void protocore_oidc_verify(uint8_t *work);
167static const OidcNs Oidc __attribute__((unused)) = {
168 .token_kid = protocore_oidc_token_kid,
169 .jwks_find = protocore_oidc_jwks_find,
170 .verify_with_key = protocore_oidc_verify_with_key,
171 .verify = protocore_oidc_verify,
EMBED_ENUM_BYTE(ProtoConn, PROTO_NONE=0, PROTO_HTTP=1, PROTO_TELNET=2, PROTO_SSH=3, PROTO_MODBUS=4, PROTO_OPCUA=5, PROTO_SSH_RFWD=6, PROTO_RELAY=7, PROTO_BRIDGE=8, PROTO_NTRIP_CASTER=9, PROTO_MESH=10, PROTO_UDP=11,)
Application protocol spoken on a listener port or connection slot.