diff options
author | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
commit | 0c8fa354358381b3f1b92598e7f1b46f8cf744cc (patch) | |
tree | ed28ffb73cc0ae48a9892dab3f10b09bc36436d5 /crypto/heimdal/lib/krb5/rd_cred.c | |
parent | 06c859ecf534f468a52f24a3eb14409d73a4907c (diff) | |
download | FreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.zip FreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.tar.gz |
import of heimdal 0.3f
Diffstat (limited to 'crypto/heimdal/lib/krb5/rd_cred.c')
-rw-r--r-- | crypto/heimdal/lib/krb5/rd_cred.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crypto/heimdal/lib/krb5/rd_cred.c b/crypto/heimdal/lib/krb5/rd_cred.c index ca8ff02..c7729b1 100644 --- a/crypto/heimdal/lib/krb5/rd_cred.c +++ b/crypto/heimdal/lib/krb5/rd_cred.c @@ -33,7 +33,7 @@ #include <krb5_locl.h> -RCSID("$Id: rd_cred.c,v 1.12 2001/01/04 16:19:00 joda Exp $"); +RCSID("$Id: rd_cred.c,v 1.14 2001/05/14 06:14:50 assar Exp $"); krb5_error_code krb5_rd_cred(krb5_context context, @@ -50,6 +50,8 @@ krb5_rd_cred(krb5_context context, krb5_crypto crypto; int i; + *ret_creds = NULL; + ret = decode_KRB_CRED(in_data->data, in_data->length, &cred, &len); if(ret) @@ -57,11 +59,13 @@ krb5_rd_cred(krb5_context context, if (cred.pvno != 5) { ret = KRB5KRB_AP_ERR_BADVERSION; + krb5_clear_error_string (context); goto out; } if (cred.msg_type != krb_cred) { ret = KRB5KRB_AP_ERR_MSG_TYPE; + krb5_clear_error_string (context); goto out; } @@ -108,7 +112,7 @@ krb5_rd_cred(krb5_context context, krb5_address *a; int cmp; - ret = krb5_make_addrport (&a, + ret = krb5_make_addrport (context, &a, auth_context->remote_address, auth_context->remote_port); if (ret) @@ -123,6 +127,7 @@ krb5_rd_cred(krb5_context context, free (a); if (cmp == 0) { + krb5_clear_error_string (context); ret = KRB5KRB_AP_ERR_BADADDR; goto out; } @@ -135,6 +140,7 @@ krb5_rd_cred(krb5_context context, && !krb5_address_compare (context, auth_context->local_address, enc_krb_cred_part.r_address)) { + krb5_clear_error_string (context); ret = KRB5KRB_AP_ERR_BADADDR; goto out; } @@ -149,6 +155,7 @@ krb5_rd_cred(krb5_context context, enc_krb_cred_part.usec == NULL || abs(*enc_krb_cred_part.timestamp - sec) > context->max_skew) { + krb5_clear_error_string (context); ret = KRB5KRB_AP_ERR_SKEW; goto out; } @@ -183,6 +190,7 @@ krb5_rd_cred(krb5_context context, creds = calloc(1, sizeof(*creds)); if(creds == NULL) { ret = ENOMEM; + krb5_set_error_string (context, "malloc: out of memory"); goto out; } |