Ziti C SDK
Loading...
Searching...
No Matches
errors.h File Reference

Defines the macros, functions, typedefs and constants pertaining to errors observed when using a Ziti Network. More...

#include "externs.h"

Go to the source code of this file.

Macros

#define ZITI_OK   (0)
 The expected outcome of a successful operation.
 
#define ZITI_CONFIG_NOT_FOUND   (-1)
 The provided configuration was not found.
 
#define ZITI_JWT_NOT_FOUND   (-2)
 The provided JWT was not found.
 
#define ZITI_JWT_INVALID   (-3)
 The provided JWT is not accepted by the controller.
 
#define ZITI_JWT_INVALID_FORMAT   (-4)
 The provided JWT has an invalid format.
 
#define ZITI_PKCS7_ASN1_PARSING_FAILED   (-5)
 PKCS7/ASN.1 parsing failed.
 
#define ZITI_JWT_SIGNING_ALG_UNSUPPORTED   (-6)
 unsupported JWT signing algorithm
 
#define ZITI_JWT_VERIFICATION_FAILED   (-7)
 JWT verification failed.
 
#define ZITI_ENROLLMENT_METHOD_UNSUPPORTED   (-8)
 unsupported enrollment method
 
#define ZITI_ENROLLMENT_CERTIFICATE_REQUIRED   (-9)
 enrollment method requires client certificate
 
#define ZITI_KEY_GENERATION_FAILED   (-10)
 Attempt to generate a private key failed.
 
#define ZITI_KEY_LOAD_FAILED   (-11)
 Attempt to load TLS key failed.
 
#define ZITI_CSR_GENERATION_FAILED   (-12)
 Attempt to generate a CSR failed.
 
#define ZITI_INVALID_CONFIG   (-13)
 Some or all of the provided configuration is incorrect.
 
#define ZITI_AUTHENTICATION_FAILED   (-14)
 the certificates presented are incorrect, out of date, or invalid
 
#define ZITI_NOT_AUTHORIZED   (-15)
 Returned when the identity does not have the correct level of access needed.
 
#define ZITI_CONTROLLER_UNAVAILABLE   (-16)
 The SDK has attempted to communicate to the Ziti Controller but the controller is offline or did not respond to the request.
 
#define ZITI_GATEWAY_UNAVAILABLE   (-17)
 The SDK cannot send data to the Ziti Network because an Edge Router was not available.
 
#define ZITI_SERVICE_UNAVAILABLE   (-18)
 The SDK cannot send data to the Ziti Network because the requested service was not available.
 
#define ZITI_EOF   (-19)
 The connection has been closed gracefully.
 
#define ZITI_TIMEOUT   (-20)
 A connect or write operation did not complete in the allocated timeout.
 
#define ZITI_CONNABORT   (-21)
 The connection has been closed abnormally.
 
#define ZITI_INVALID_STATE   (-22)
 SDK detected invalid state, most likely caused by improper use.
 
#define ZITI_CRYPTO_FAIL   (-23)
 SDK detected invalid cryptographic state of Ziti connection.
 
#define ZITI_CONN_CLOSED   (-24)
 connection was closed
 
#define ZITI_INVALID_POSTURE   (-25)
 failed posture check
 
#define ZITI_MFA_EXISTS   (-26)
 attempted to start MFA enrollment when it already has been started or completed
 
#define ZITI_MFA_INVALID_TOKEN   (-27)
 attempted to use an MFA token that is invalid
 
#define ZITI_MFA_NOT_ENROLLED   (-28)
 attempted to verify or retrieve details of an MFA enrollment that has not been completed
 
#define ZITI_NOT_FOUND   (-29)
 not found, usually indicates stale reference or permission
 
#define ZITI_DISABLED   (-30)
 operation attempted while ziti_context is not enabled
 
#define ZITI_PARTIALLY_AUTHENTICATED   (-31)
 returned when authentication is attempted but there is an existing api session waiting for auth queries to pass
 
#define ZITI_INVALID_AUTHENTICATOR_TYPE   (-32)
 returned during certificate authenticator extension if the authenticator cannot be extended because it is the wrong type (i.e.
 
#define ZITI_INVALID_AUTHENTICATOR_CERT   (-33)
 returned during certificate authentication extension when the current client cert does not match the authenticator
 
#define ZITI_INVALID_CERT_KEY_PAIR   (-34)
 returned when attempting to set the current certificate and key being used by a ztx when it could not be parsed/applied
 
#define ZITI_CERT_IN_USE   (-35)
 returned when attempting to enroll the same key/cert with an external CA that has already been used
 
#define ZITI_CERT_FAILED_VALIDATION   (-36)
 returned when enrolling a key/cert with an external CA and no CA matches the cert
 
#define ZITI_MISSING_CERT_CLAIM   (-37)
 returned when the certificate doesn't have an externalId") \
 
#define ZITI_ALLOC_FAILED   (-38)
 ziti could not allocate memory
 
#define ZITI_WTF   (-111)
 Inspired by the Android SDK: What a Terrible Failure.
 

Functions

const char * ziti_errorstr (int err)
 Returns a human-readable description for the provided code.
 

Detailed Description

Defines the macros, functions, typedefs and constants pertaining to errors observed when using a Ziti Network.

Macro Definition Documentation

◆ ZITI_ALLOC_FAILED

#define ZITI_ALLOC_FAILED   (-38)

ziti could not allocate memory

◆ ZITI_AUTHENTICATION_FAILED

#define ZITI_AUTHENTICATION_FAILED   (-14)

the certificates presented are incorrect, out of date, or invalid

◆ ZITI_CERT_FAILED_VALIDATION

#define ZITI_CERT_FAILED_VALIDATION   (-36)

returned when enrolling a key/cert with an external CA and no CA matches the cert

◆ ZITI_CERT_IN_USE

#define ZITI_CERT_IN_USE   (-35)

returned when attempting to enroll the same key/cert with an external CA that has already been used

◆ ZITI_CONFIG_NOT_FOUND

#define ZITI_CONFIG_NOT_FOUND   (-1)

The provided configuration was not found.

◆ ZITI_CONN_CLOSED

#define ZITI_CONN_CLOSED   (-24)

connection was closed

◆ ZITI_CONNABORT

#define ZITI_CONNABORT   (-21)

The connection has been closed abnormally.

◆ ZITI_CONTROLLER_UNAVAILABLE

#define ZITI_CONTROLLER_UNAVAILABLE   (-16)

The SDK has attempted to communicate to the Ziti Controller but the controller is offline or did not respond to the request.

◆ ZITI_CRYPTO_FAIL

#define ZITI_CRYPTO_FAIL   (-23)

SDK detected invalid cryptographic state of Ziti connection.

◆ ZITI_CSR_GENERATION_FAILED

#define ZITI_CSR_GENERATION_FAILED   (-12)

Attempt to generate a CSR failed.

◆ ZITI_DISABLED

#define ZITI_DISABLED   (-30)

operation attempted while ziti_context is not enabled

◆ ZITI_ENROLLMENT_CERTIFICATE_REQUIRED

#define ZITI_ENROLLMENT_CERTIFICATE_REQUIRED   (-9)

enrollment method requires client certificate

◆ ZITI_ENROLLMENT_METHOD_UNSUPPORTED

#define ZITI_ENROLLMENT_METHOD_UNSUPPORTED   (-8)

unsupported enrollment method

◆ ZITI_EOF

#define ZITI_EOF   (-19)

The connection has been closed gracefully.

◆ ZITI_GATEWAY_UNAVAILABLE

#define ZITI_GATEWAY_UNAVAILABLE   (-17)

The SDK cannot send data to the Ziti Network because an Edge Router was not available.

Common causes are: the identity connecting is not associated with any Edge Routers the Edge Router in use is no longer responding

◆ ZITI_INVALID_AUTHENTICATOR_CERT

#define ZITI_INVALID_AUTHENTICATOR_CERT   (-33)

returned during certificate authentication extension when the current client cert does not match the authenticator

◆ ZITI_INVALID_AUTHENTICATOR_TYPE

#define ZITI_INVALID_AUTHENTICATOR_TYPE   (-32)

returned during certificate authenticator extension if the authenticator cannot be extended because it is the wrong type (i.e.

UPDB or 3rd party)

◆ ZITI_INVALID_CERT_KEY_PAIR

#define ZITI_INVALID_CERT_KEY_PAIR   (-34)

returned when attempting to set the current certificate and key being used by a ztx when it could not be parsed/applied

◆ ZITI_INVALID_CONFIG

#define ZITI_INVALID_CONFIG   (-13)

Some or all of the provided configuration is incorrect.

◆ ZITI_INVALID_POSTURE

#define ZITI_INVALID_POSTURE   (-25)

failed posture check

◆ ZITI_INVALID_STATE

#define ZITI_INVALID_STATE   (-22)

SDK detected invalid state, most likely caused by improper use.

◆ ZITI_JWT_INVALID

#define ZITI_JWT_INVALID   (-3)

The provided JWT is not accepted by the controller.

◆ ZITI_JWT_INVALID_FORMAT

#define ZITI_JWT_INVALID_FORMAT   (-4)

The provided JWT has an invalid format.

◆ ZITI_JWT_NOT_FOUND

#define ZITI_JWT_NOT_FOUND   (-2)

The provided JWT was not found.

◆ ZITI_JWT_SIGNING_ALG_UNSUPPORTED

#define ZITI_JWT_SIGNING_ALG_UNSUPPORTED   (-6)

unsupported JWT signing algorithm

◆ ZITI_JWT_VERIFICATION_FAILED

#define ZITI_JWT_VERIFICATION_FAILED   (-7)

JWT verification failed.

◆ ZITI_KEY_GENERATION_FAILED

#define ZITI_KEY_GENERATION_FAILED   (-10)

Attempt to generate a private key failed.

◆ ZITI_KEY_LOAD_FAILED

#define ZITI_KEY_LOAD_FAILED   (-11)

Attempt to load TLS key failed.

◆ ZITI_MFA_EXISTS

#define ZITI_MFA_EXISTS   (-26)

attempted to start MFA enrollment when it already has been started or completed

◆ ZITI_MFA_INVALID_TOKEN

#define ZITI_MFA_INVALID_TOKEN   (-27)

attempted to use an MFA token that is invalid

◆ ZITI_MFA_NOT_ENROLLED

#define ZITI_MFA_NOT_ENROLLED   (-28)

attempted to verify or retrieve details of an MFA enrollment that has not been completed

◆ ZITI_MISSING_CERT_CLAIM

#define ZITI_MISSING_CERT_CLAIM   (-37)

returned when the certificate doesn't have an externalId") \

◆ ZITI_NOT_AUTHORIZED

#define ZITI_NOT_AUTHORIZED   (-15)

Returned when the identity does not have the correct level of access needed.

no policy exists granting the identity access for requestion operation

◆ ZITI_NOT_FOUND

#define ZITI_NOT_FOUND   (-29)

not found, usually indicates stale reference or permission

◆ ZITI_OK

#define ZITI_OK   (0)

The expected outcome of a successful operation.

◆ ZITI_PARTIALLY_AUTHENTICATED

#define ZITI_PARTIALLY_AUTHENTICATED   (-31)

returned when authentication is attempted but there is an existing api session waiting for auth queries to pass

◆ ZITI_PKCS7_ASN1_PARSING_FAILED

#define ZITI_PKCS7_ASN1_PARSING_FAILED   (-5)

PKCS7/ASN.1 parsing failed.

◆ ZITI_SERVICE_UNAVAILABLE

#define ZITI_SERVICE_UNAVAILABLE   (-18)

The SDK cannot send data to the Ziti Network because the requested service was not available.

Common causes are: the service does not exist the identity connecting is not associated with the given service

◆ ZITI_TIMEOUT

#define ZITI_TIMEOUT   (-20)

A connect or write operation did not complete in the allocated timeout.

#DEFAULT_TIMEOUT

◆ ZITI_WTF

#define ZITI_WTF   (-111)

Inspired by the Android SDK: What a Terrible Failure.

A condition that should never happen.

Function Documentation

◆ ziti_errorstr()

const char * ziti_errorstr ( int  err)
extern

Returns a human-readable description for the provided code.