X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Focsp%2Focsp.h;h=bca1738f7b5e9c6c1beafa3e4730d4d2cfb1d50d;hp=7b2be2a7d2cc926d2f94fddbe4b235b74afaa121;hb=ec558b65480cb186979e0c3bf0cf8e36eb49a125;hpb=2f9f0c72de36b2d770f380c04e389c910c315304 diff --git a/crypto/ocsp/ocsp.h b/crypto/ocsp/ocsp.h index 7b2be2a7d2..bca1738f7b 100644 --- a/crypto/ocsp/ocsp.h +++ b/crypto/ocsp/ocsp.h @@ -177,11 +177,11 @@ typedef struct ocsp_response_st * byName [1] Name, * byKey [2] KeyHash } */ -#define V_OCSP_RESPID_NAME 1 -#define V_OCSP_RESPID_KEY 2 +#define V_OCSP_RESPID_NAME 0 +#define V_OCSP_RESPID_KEY 1 typedef struct ocsp_responder_id_st { - int tag; + int type; union { X509_NAME* byName; ASN1_OCTET_STRING *byKey; @@ -211,10 +211,12 @@ typedef struct ocsp_revoked_info_st #define V_OCSP_CERTSTATUS_UNKNOWN 2 typedef struct ocsp_cert_status_st { - int tag; - /* good [0] IMPLICIT NULL */ - OCSP_REVOKEDINFO *revoked; - /* unknown [2] OCSP_UNKNOWNINFO *unknown, which is NULL */ + int type; + union { + ASN1_NULL *good; + OCSP_REVOKEDINFO *revoked; + ASN1_NULL *unknown; + } value; } OCSP_CERTSTATUS; /* SingleResponse ::= SEQUENCE { @@ -442,112 +444,116 @@ X509_EXTENSION *OCSP_archive_cutoff_new(char* tim); X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, char **urls); -OCSP_SINGLERESP *OCSP_SINGLERESP_new(void); -void OCSP_SINGLERESP_free(OCSP_SINGLERESP *a); -int i2d_OCSP_SINGLERESP(OCSP_SINGLERESP *a, unsigned char **pp); -OCSP_SINGLERESP *d2i_OCSP_SINGLERESP(OCSP_SINGLERESP **a, unsigned char **pp, long length); -int i2a_OCSP_SINGLERESP(BIO *bp, OCSP_SINGLERESP* a); +int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x); +int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos); +int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos); +int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos); +X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc); +X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc); +void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx); +int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc); + +int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x); +int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos); +int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos); +int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos); +X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc); +X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc); +void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx); +int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc); + +int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x); +int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos); +int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos); +int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, int lastpos); +X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc); +X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc); +void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, int *idx); +int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc); + +int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x); +int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos); +int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj, int lastpos); +int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, int lastpos); +X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc); +X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc); +void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, int *idx); +int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc); + +DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP) OCSP_CERTSTATUS *OCSP_CERTSTATUS_new(void); void OCSP_CERTSTATUS_free(OCSP_CERTSTATUS *a); int i2d_OCSP_CERTSTATUS(OCSP_CERTSTATUS *a, unsigned char **pp); OCSP_CERTSTATUS *d2i_OCSP_CERTSTATUS(OCSP_CERTSTATUS **a, unsigned char **pp, long length); -int i2a_OCSP_CERTSTATUS(BIO *bp, OCSP_CERTSTATUS* a); OCSP_REVOKEDINFO *OCSP_REVOKEDINFO_new(void); void OCSP_REVOKEDINFO_free(OCSP_REVOKEDINFO *a); int i2d_OCSP_REVOKEDINFO(OCSP_REVOKEDINFO *a, unsigned char **pp); OCSP_REVOKEDINFO *d2i_OCSP_REVOKEDINFO(OCSP_REVOKEDINFO **a, unsigned char **pp, long length); -int i2a_OCSP_REVOKEDINFO(BIO *bp, OCSP_REVOKEDINFO* a); OCSP_BASICRESP *OCSP_BASICRESP_new(void); void OCSP_BASICRESP_free(OCSP_BASICRESP *a); int i2d_OCSP_BASICRESP(OCSP_BASICRESP *a, unsigned char **pp); OCSP_BASICRESP *d2i_OCSP_BASICRESP(OCSP_BASICRESP **a, unsigned char **pp, long length); -int i2a_OCSP_BASICRESP(BIO *bp, OCSP_BASICRESP* a); OCSP_RESPDATA *OCSP_RESPDATA_new(void); void OCSP_RESPDATA_free(OCSP_RESPDATA *a); int i2d_OCSP_RESPDATA(OCSP_RESPDATA *a, unsigned char **pp); OCSP_RESPDATA *d2i_OCSP_RESPDATA(OCSP_RESPDATA **a, unsigned char **pp, long length); -int i2a_OCSP_RESPDATA(BIO *bp, OCSP_RESPDATA* a); OCSP_RESPID *OCSP_RESPID_new(void); void OCSP_RESPID_free(OCSP_RESPID *a); int i2d_OCSP_RESPID(OCSP_RESPID *a, unsigned char **pp); OCSP_RESPID *d2i_OCSP_RESPID(OCSP_RESPID **a, unsigned char **pp, long length); -int i2a_OCSP_RESPID(BIO *bp, OCSP_RESPID* a); OCSP_RESPONSE *OCSP_RESPONSE_new(void); void OCSP_RESPONSE_free(OCSP_RESPONSE *a); int i2d_OCSP_RESPONSE(OCSP_RESPONSE *a, unsigned char **pp); OCSP_RESPONSE *d2i_OCSP_RESPONSE(OCSP_RESPONSE **a, unsigned char **pp, long length); -int i2a_OCSP_RESPONSE(BIO *bp, OCSP_RESPONSE* a); -int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* a); +int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* a, unsigned long flags); OCSP_RESPBYTES *OCSP_RESPBYTES_new(void); void OCSP_RESPBYTES_free(OCSP_RESPBYTES *a); int i2d_OCSP_RESPBYTES(OCSP_RESPBYTES *a, unsigned char **pp); OCSP_RESPBYTES *d2i_OCSP_RESPBYTES(OCSP_RESPBYTES **a, unsigned char **pp, long length); -int i2a_OCSP_RESPBYTES(BIO *bp, OCSP_RESPBYTES* a); OCSP_ONEREQ *OCSP_ONEREQ_new(void); void OCSP_ONEREQ_free(OCSP_ONEREQ *a); int i2d_OCSP_ONEREQ(OCSP_ONEREQ *a, unsigned char **pp); OCSP_ONEREQ *d2i_OCSP_ONEREQ(OCSP_ONEREQ **a, unsigned char **pp, long length); -int i2a_OCSP_ONEREQ(BIO *bp, OCSP_ONEREQ* a); OCSP_CERTID *OCSP_CERTID_new(void); void OCSP_CERTID_free(OCSP_CERTID *a); int i2d_OCSP_CERTID(OCSP_CERTID *a, unsigned char **pp); OCSP_CERTID *d2i_OCSP_CERTID(OCSP_CERTID **a, unsigned char **pp, long length); -int i2a_OCSP_CERTID(BIO *bp, OCSP_CERTID* a); OCSP_REQUEST *OCSP_REQUEST_new(void); void OCSP_REQUEST_free(OCSP_REQUEST *a); int i2d_OCSP_REQUEST(OCSP_REQUEST *a, unsigned char **pp); OCSP_REQUEST *d2i_OCSP_REQUEST(OCSP_REQUEST **a, unsigned char **pp, long length); -int i2a_OCSP_REQUEST(BIO *bp, OCSP_REQUEST* a); -int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a); + +int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags); OCSP_SIGNATURE *OCSP_SIGNATURE_new(void); void OCSP_SIGNATURE_free(OCSP_SIGNATURE *a); int i2d_OCSP_SIGNATURE(OCSP_SIGNATURE *a, unsigned char **pp); OCSP_SIGNATURE *d2i_OCSP_SIGNATURE(OCSP_SIGNATURE **a, unsigned char **pp, long length); -int i2a_OCSP_SIGNATURE(BIO *bp, OCSP_SIGNATURE* a); - -OCSP_REQINFO *OCSP_REQINFO_new(void); -void OCSP_REQINFO_free(OCSP_REQINFO *a); -int i2d_OCSP_REQINFO(OCSP_REQINFO *a, unsigned char **pp); -OCSP_REQINFO *d2i_OCSP_REQINFO(OCSP_REQINFO **a, unsigned char **pp, long length); -int i2a_OCSP_REQINFO(BIO *bp, OCSP_REQINFO* a); - -OCSP_CRLID *OCSP_CRLID_new(void); -void OCSP_CRLID_free(OCSP_CRLID *a); -int i2d_OCSP_CRLID(OCSP_CRLID *a, unsigned char **pp); -OCSP_CRLID *d2i_OCSP_CRLID(OCSP_CRLID **a, unsigned char **pp, long length); -int i2a_OCSP_CRLID(BIO *bp, OCSP_CRLID* a); -int OCSP_CRLID_print(BIO *bp, OCSP_CRLID *a, int ind); - -OCSP_SERVICELOC *OCSP_SERVICELOC_new(void); -void OCSP_SERVICELOC_free(OCSP_SERVICELOC *a); -int i2d_OCSP_SERVICELOC(OCSP_SERVICELOC *a, unsigned char **pp); -OCSP_SERVICELOC *d2i_OCSP_SERVICELOC(OCSP_SERVICELOC **a, unsigned char **pp, long length); -int i2a_OCSP_SERVICELOC(BIO *bp, OCSP_SERVICELOC* a); -int OCSP_SERVICELOC_print(BIO *bp, OCSP_SERVICELOC* a, int ind); - -int OCSP_extensions_print(BIO *bp, STACK_OF(X509_EXTENSION) *sk, char *title); -int OCSP_extension_print(BIO *bp, X509_EXTENSION *x, int ind); -void ERR_load_OCSP_strings(void); -X509_EXTENSION *OCSP_nochain_new(void); +DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO) +DECLARE_ASN1_FUNCTIONS(OCSP_CRLID) +DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC) -char* ocspResponseStatus2string(long s); -char* ocspCertStatus2string(long s); -char * cRLReason2string(long s); - -void OCSP_add_standard_extension(void); +void ERR_load_OCSP_strings(void); /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes @@ -562,6 +568,7 @@ void OCSP_add_standard_extension(void); #define OCSP_F_BASIC_RESPONSE_VERIFY 101 #define OCSP_F_CERT_ID_NEW 102 #define OCSP_F_CERT_STATUS_NEW 103 +#define OCSP_F_D2I_OCSP_NONCE 109 #define OCSP_F_REQUEST_VERIFY 104 #define OCSP_F_RESPONSE_VERIFY 105 #define OCSP_F_S2I_OCSP_NONCE 107