l8w8jwt
Loading...
Searching...
No Matches
Macros
retcodes.h File Reference

Macros for possible integer codes returned by the various l8w8jwt functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define L8W8JWT_SUCCESS   0
 
#define L8W8JWT_NULL_ARG   100
 
#define L8W8JWT_INVALID_ARG   200
 
#define L8W8JWT_OUT_OF_MEM   300
 
#define L8W8JWT_OVERFLOW   310
 
#define L8W8JWT_SIGNATURE_CREATION_FAILURE   400
 
#define L8W8JWT_SHA2_FAILURE   410
 
#define L8W8JWT_KEY_PARSE_FAILURE   420
 
#define L8W8JWT_BASE64_FAILURE   425
 
#define L8W8JWT_WRONG_KEY_TYPE   450
 
#define L8W8JWT_MBEDTLS_CTR_DRBG_SEED_FAILURE   500
 
#define L8W8JWT_DECODE_FAILED_INVALID_TOKEN_FORMAT   600
 
#define L8W8JWT_DECODE_FAILED_MISSING_SIGNATURE   700
 
#define L8W8JWT_UNSUPPORTED_ALG   800
 

Detailed Description

Macros for possible integer codes returned by the various l8w8jwt functions.

Author
Raphael Beck

Macro Definition Documentation

◆ L8W8JWT_BASE64_FAILURE

#define L8W8JWT_BASE64_FAILURE   425

Base64(URL) encoding or decoding error.

◆ L8W8JWT_DECODE_FAILED_INVALID_TOKEN_FORMAT

#define L8W8JWT_DECODE_FAILED_INVALID_TOKEN_FORMAT   600

Returned if the token is invalid (format-wise).

◆ L8W8JWT_DECODE_FAILED_MISSING_SIGNATURE

#define L8W8JWT_DECODE_FAILED_MISSING_SIGNATURE   700

Returned if the token is invalid because it's missing the signature (despite having specified an alg that isn't "none").

◆ L8W8JWT_INVALID_ARG

#define L8W8JWT_INVALID_ARG   200

This error code is returned by a l8w8jwt function if you passed an invalid parameter into it.

◆ L8W8JWT_KEY_PARSE_FAILURE

#define L8W8JWT_KEY_PARSE_FAILURE   420

Returned if some PEM-formatted key string couldn't be parsed.

◆ L8W8JWT_MBEDTLS_CTR_DRBG_SEED_FAILURE

#define L8W8JWT_MBEDTLS_CTR_DRBG_SEED_FAILURE   500

When the mbedtls_ctr_drbg_seed() function fails...

◆ L8W8JWT_NULL_ARG

#define L8W8JWT_NULL_ARG   100

Error code returned by a l8w8jwt function if you passed a NULL argument that shouldn't have been NULL.

◆ L8W8JWT_OUT_OF_MEM

#define L8W8JWT_OUT_OF_MEM   300

This is returned if some allocation inside a l8w8jwt function failed: you're out of memory at this point.

◆ L8W8JWT_OVERFLOW

#define L8W8JWT_OVERFLOW   310

Not good...

◆ L8W8JWT_SHA2_FAILURE

#define L8W8JWT_SHA2_FAILURE   410

If one of the SHA-2 functions fails (e.g. SHA-256).

◆ L8W8JWT_SIGNATURE_CREATION_FAILURE

#define L8W8JWT_SIGNATURE_CREATION_FAILURE   400

Returned if signing a JWT failed.

◆ L8W8JWT_SUCCESS

#define L8W8JWT_SUCCESS   0

Returned from a l8w8jwt function when everything went smooth 'n' chill. Time to get Schwifty, Morteyy!

◆ L8W8JWT_UNSUPPORTED_ALG

#define L8W8JWT_UNSUPPORTED_ALG   800

Returned if the JWT signing alg parameter that was passed is not supported (e.g. the used l8w8jwt library was built without support for that algo, e.g. Ed25519). See the README.md for more details!

◆ L8W8JWT_WRONG_KEY_TYPE

#define L8W8JWT_WRONG_KEY_TYPE   450

Returned if you passed the wrong private or public key type (e.g. trying to use an RSA key for ECDSA tokens, etc...).

Especially for the ECDSA algorithms like ES256, ES384 and ES512 double-check that you passed keys of the correct curve!

Only use the P-256 curve for ES256, P-384 (a.k.a. secp384r1) for ES384 and P-521 (a.k.a. secp521r1) for ES512.