From d2222349510357663c6959467c8eb12958c8421e Mon Sep 17 00:00:00 2001 From: Marcel Poul Date: Mon, 23 Apr 2012 13:45:02 +0000 Subject: [PATCH] better error codes --- emi.canl.canl-c/src/canl.h | 2 +- emi.canl.canl-c/src/canl_cred.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/emi.canl.canl-c/src/canl.h b/emi.canl.canl-c/src/canl.h index fde58cb..465d75d 100644 --- a/emi.canl.canl-c/src/canl.h +++ b/emi.canl.canl-c/src/canl.h @@ -29,7 +29,7 @@ void CANL_CALLCONV canl_free_ctx(canl_ctx cc); canl_err_code CANL_CALLCONV -canl_create_io_handler(canl_ctx cc, canl_io_handler*); +canl_create_io_handler(canl_ctx cc, canl_io_handler *io); canl_err_code CANL_CALLCONV canl_io_connect(canl_ctx cc, canl_io_handler io, const char *host, diff --git a/emi.canl.canl-c/src/canl_cred.c b/emi.canl.canl-c/src/canl_cred.c index 9bcf964..931fc5a 100644 --- a/emi.canl.canl-c/src/canl_cred.c +++ b/emi.canl.canl-c/src/canl_cred.c @@ -347,14 +347,15 @@ canl_cred_sign_proxy(canl_ctx ctx, canl_cred signer_cred, canl_cred proxy_cred) if (proxy_crd->c_req) { EVP_PKEY *tmp_key = X509_REQ_get_pubkey(proxy_crd->c_req); if (!tmp_key) - return set_error(cc, 0, CANL_ERROR, "Cannot extract key out of" - " the certificate request" ); + return set_error(cc, CANL_ERR_unknown, CANL_ERROR, "Cannot" + "extract key out of the certificate request" ); key_size = EVP_PKEY_size(tmp_key); /*TODO free tmp_key? is it duplicate or poiter? */ if ((proxy_crd->c_lifetime > LIFETIME_TRESHOLD) && (key_size <= DEF_KEY_LEN_LONGER)) - return set_error(cc, 0, CANL_ERROR, "Cannot sign cert. request -" - " the key is too short with respect to cert. lifetime"); + return set_error(cc, CANL_ERR_unknown, CANL_ERROR, "Cannot" + "sign cert. request -the key is too short with " + " respect to cert. lifetime"); } /*TODO flags - limited,version*/ -- 1.8.2.3