From 23a7e5e2b29db1069d81d73822336bb8e5aa0043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 24 Oct 2006 12:30:04 +0000 Subject: [PATCH] (hx509_cert_get_base_subject): one less EINVAL (_hx509_cert_private_decrypt): one less EINVAL git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18854 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/cert.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/hx509/cert.c b/lib/hx509/cert.c index 76917bae6..aacba17d5 100644 --- a/lib/hx509/cert.c +++ b/lib/hx509/cert.c @@ -990,12 +990,17 @@ hx509_cert_get_subject(hx509_cert p, hx509_name *name) } int -hx509_cert_get_base_subject(hx509_context context, hx509_cert c, hx509_name *name) +hx509_cert_get_base_subject(hx509_context context, hx509_cert c, + hx509_name *name) { if (c->basename) return hx509_name_copy(context, c->basename, name); - if (is_proxy_cert(context, c->data, NULL) == 0) - return EINVAL; /* XXX */ + if (is_proxy_cert(context, c->data, NULL) == 0) { + hx509_set_error_string(context, 0, ret, + "Proxy certificate have not been " + "canonicalize yet, no base name"); + return HX509_PROXY_CERTIFICATE_NOT_CANONICALIZED; + } return _hx509_name_from_Name(&c->data->tbsCertificate.subject, name); } @@ -1021,7 +1026,7 @@ _hx509_cert_private_decrypt(const heim_octet_string *ciphertext, cleartext->length = 0; if (p->private_key == NULL) - return EINVAL; /* XXX */ + return HX509_PRIVATE_KEY_MISSING; return _hx509_private_key_private_decrypt(ciphertext, encryption_oid,