From 35dda6b1b971b8a05e9c134e960e7b3f9155546e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 26 Nov 2006 17:54:18 +0000 Subject: [PATCH] Sprinkle more error string and hx509_contexts. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19130 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/cert.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/hx509/cert.c b/lib/hx509/cert.c index cef010b4d..dffeecc88 100644 --- a/lib/hx509/cert.c +++ b/lib/hx509/cert.c @@ -1016,7 +1016,8 @@ _hx509_cert_private_key(hx509_cert p) } int -_hx509_cert_private_decrypt(const heim_octet_string *ciphertext, +_hx509_cert_private_decrypt(hx509_context context, + const heim_octet_string *ciphertext, const heim_oid *encryption_oid, hx509_cert p, heim_octet_string *cleartext) @@ -1024,10 +1025,14 @@ _hx509_cert_private_decrypt(const heim_octet_string *ciphertext, cleartext->data = NULL; cleartext->length = 0; - if (p->private_key == NULL) + if (p->private_key == NULL) { + hx509_set_error_string(context, 0, HX509_PRIVATE_KEY_MISSING, + "Private key missing"); return HX509_PRIVATE_KEY_MISSING; + } - return _hx509_private_key_private_decrypt(ciphertext, + return _hx509_private_key_private_decrypt(context, + ciphertext, encryption_oid, p->private_key, cleartext);