From 40c270d232a8d7ba2e91f62ad197eec0e7e92335 Mon Sep 17 00:00:00 2001 From: Will Fiveash Date: Mon, 13 Nov 2006 20:25:08 +0000 Subject: more Novell ldap patches from Nov 6 and Fix for wrong password policy reference count This commit is to update the code with the following Novell patches from Nov 6, 2006: patch-ldap-kadm5-macro.diff patch-ldap-fixes.diff patch-ldap-key-seq-salt.diff patch-ldap-misc.diff And this patch from Nov 8: patch-ldap-pwd-policy.c ticket: new Target_Version: krb5-1.6 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18799 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/ldap_key_seq.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/krb5/asn.1/ldap_key_seq.c b/src/lib/krb5/asn.1/ldap_key_seq.c index c25d7afe6..1fe9a548f 100644 --- a/src/lib/krb5/asn.1/ldap_key_seq.c +++ b/src/lib/krb5/asn.1/ldap_key_seq.c @@ -338,8 +338,10 @@ static asn1_error_code asn1_decode_key(asn1buf *buf, krb5_key_data *key) key->key_data_type[1] = keytype; /* XXX range check?? */ checkerr; - ret = decode_tagged_octetstring (&slt, 1, &keylen, - &key->key_data_contents[1]); checkerr; + if (asn1buf_remains(&slt, 0) != 0) { /* Salt value is optional */ + ret = decode_tagged_octetstring (&slt, 1, &keylen, + &key->key_data_contents[1]); checkerr; + } safe_syncbuf (&subbuf, &slt); key->key_data_length[1] = keylen; /* XXX range check?? */ @@ -433,7 +435,7 @@ krb5_error_code asn1_decode_sequence_of_keys (krb5_data *in, /* Sequence of keys */ { - int i, ret1, buflen; + int i, buflen; asn1buf keyseq; if (t.tagnum != 4) cleanup (ASN1_MISSING_FIELD); @@ -447,7 +449,7 @@ krb5_error_code asn1_decode_sequence_of_keys (krb5_data *in, cleanup (ENOMEM); *out = tmp; (*out)[i - 1].key_data_kvno = kvno; - ret1 = asn1_decode_key(&keyseq, &(*out)[i - 1]); checkerr; + ret = asn1_decode_key(&keyseq, &(*out)[i - 1]); checkerr; (*n_key_data)++; if (asn1buf_remains(&keyseq, 0) == 0) break; /* Not freeing the last key structure */ -- cgit