summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2019-11-05 09:56:59 +0100
committerMatt Caswell <matt@openssl.org>2019-12-12 10:57:25 +0000
commit3dbc5156b0b2c7a57be160706e6ad38a14edae37 (patch)
treee86c4b137be850621acfd835398b4bc1cf699467 /include
parent0402c90ff9caac4c680e3cb6db7729e00d3fc20b (diff)
chunk 6 of CMP contribution to OpenSSL
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10297)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/cmp.h10
-rw-r--r--include/openssl/cmp_util.h7
-rw-r--r--include/openssl/cmperr.h31
3 files changed, 40 insertions, 8 deletions
diff --git a/include/openssl/cmp.h b/include/openssl/cmp.h
index 409d48515f..d778842b3b 100644
--- a/include/openssl/cmp.h
+++ b/include/openssl/cmp.h
@@ -264,7 +264,7 @@ int OSSL_CMP_CTX_set_option(OSSL_CMP_CTX *ctx, int opt, int val);
int OSSL_CMP_CTX_get_option(const OSSL_CMP_CTX *ctx, int opt);
/* CMP-specific callback for logging and outputting the error queue: */
int OSSL_CMP_CTX_set_log_cb(OSSL_CMP_CTX *ctx, OSSL_cmp_log_cb_t cb);
-#define OSSL_CMP_CTX_set_log_verbosity(ctx, level) \
+# define OSSL_CMP_CTX_set_log_verbosity(ctx, level) \
OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_LOG_VERBOSITY, level)
void OSSL_CMP_CTX_print_errors(OSSL_CMP_CTX *ctx);
/* message transfer: */
@@ -346,8 +346,12 @@ char *OSSL_CMP_CTX_snprint_PKIStatus(OSSL_CMP_CTX *ctx, char *buf,
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const OSSL_CMP_PKIHEADER *hdr);
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_recipNonce(const OSSL_CMP_PKIHEADER *hdr);
-# ifdef __cplusplus
+/* from cmp_msg.c */
+/* support application-level CMP debugging in cmp.c: */
+OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg);
+
+# ifdef __cplusplus
}
-# endif
+# endif
# endif /* !defined OPENSSL_NO_CMP */
#endif /* !defined OPENSSL_CMP_H */
diff --git a/include/openssl/cmp_util.h b/include/openssl/cmp_util.h
index fa5cee5e0c..ee368afa60 100644
--- a/include/openssl/cmp_util.h
+++ b/include/openssl/cmp_util.h
@@ -26,13 +26,12 @@ extern "C" {
/*
* convenience functions for CMP-specific logging via the trace API
*/
-
int OSSL_CMP_log_open(void);
void OSSL_CMP_log_close(void);
# define OSSL_CMP_LOG_PREFIX "CMP "
/* in OSSL_CMP_LOG_START, cannot use OPENSSL_FUNC when expands to __func__ */
# define OSSL_CMP_LOG_START "%s:" OPENSSL_FILE ":" \
- OPENSSL_MSTR(OPENSSL_LINE) ":" OSSL_CMP_LOG_PREFIX
+ OPENSSL_MSTR(OPENSSL_LINE) ":" OSSL_CMP_LOG_PREFIX
# define OSSL_CMP_alert(msg) OSSL_CMP_log(ALERT, msg)
# define OSSL_CMP_err(msg) OSSL_CMP_log(ERROR, msg)
# define OSSL_CMP_warn(msg) OSSL_CMP_log(WARN, msg)
@@ -72,8 +71,8 @@ typedef int (*OSSL_cmp_log_cb_t)(const char *func, const char *file, int line,
/* use of the logging callback for outputting error queue */
void OSSL_CMP_print_errors_cb(OSSL_cmp_log_cb_t log_fn);
-# ifdef __cplusplus
+# ifdef __cplusplus
}
-# endif
+# endif
# endif /* !defined OPENSSL_NO_CMP */
#endif /* !defined OPENSSL_CMP_UTIL_H */
diff --git a/include/openssl/cmperr.h b/include/openssl/cmperr.h
index 7da9a17829..b21db04ee8 100644
--- a/include/openssl/cmperr.h
+++ b/include/openssl/cmperr.h
@@ -33,13 +33,42 @@ int ERR_load_CMP_strings(void);
/*
* CMP reason codes.
*/
+# define CMP_R_BAD_REQUEST_ID 108
+# define CMP_R_CERTID_NOT_FOUND 109
+# define CMP_R_CERTIFICATE_NOT_FOUND 112
+# define CMP_R_CERTRESPONSE_NOT_FOUND 113
+# define CMP_R_CERT_AND_KEY_DO_NOT_MATCH 114
+# define CMP_R_ERROR_CALCULATING_PROTECTION 115
+# define CMP_R_ERROR_CREATING_CERTCONF 116
+# define CMP_R_ERROR_CREATING_CERTREP 117
+# define CMP_R_ERROR_CREATING_ERROR 118
+# define CMP_R_ERROR_CREATING_GENM 119
+# define CMP_R_ERROR_CREATING_GENP 120
+# define CMP_R_ERROR_CREATING_P10CR 121
+# define CMP_R_ERROR_CREATING_PKICONF 122
+# define CMP_R_ERROR_CREATING_POLLREP 123
+# define CMP_R_ERROR_CREATING_POLLREQ 124
+# define CMP_R_ERROR_CREATING_RP 125
+# define CMP_R_ERROR_CREATING_RR 126
# define CMP_R_ERROR_PARSING_PKISTATUS 107
+# define CMP_R_ERROR_PROTECTING_MESSAGE 127
+# define CMP_R_ERROR_SETTING_CERTHASH 128
# define CMP_R_FAILURE_OBTAINING_RANDOM 110
+# define CMP_R_FAIL_INFO_OUT_OF_RANGE 129
# define CMP_R_INVALID_ARGS 100
-# define CMP_R_MULTIPLE_SAN_SOURCES 102
+# define CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION 130
+# define CMP_R_MISSING_PRIVATE_KEY 131
# define CMP_R_MISSING_SENDER_IDENTIFICATION 111
+# define CMP_R_MULTIPLE_SAN_SOURCES 102
# define CMP_R_NO_STDIO 194
# define CMP_R_NULL_ARGUMENT 103
+# define CMP_R_PKISTATUSINFO_NOT_FOUND 132
+# define CMP_R_UNEXPECTED_PKIBODY 133
+# define CMP_R_UNKNOWN_ALGORITHM_ID 134
+# define CMP_R_UNKNOWN_CERT_TYPE 135
+# define CMP_R_UNSUPPORTED_ALGORITHM 136
+# define CMP_R_UNSUPPORTED_KEY_TYPE 137
+# define CMP_R_WRONG_ALGORITHM_OID 138
# endif
#endif