From: Greg Hudson Date: Fri, 6 Jan 2012 20:46:17 +0000 (+0000) Subject: Fix asn1_encode_subject_pk_info without params X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=255e1dd08f2398ef23a4ff83f69bb0806c6b76c7;p=krb5.git Fix asn1_encode_subject_pk_info without params r20923 inadvertently broke asn1_encode_subject_pk_info in the case where algorithm.parameters.length == 0. Fortunately this case never happens, but fix it anyway. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25607 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/asn.1/asn1_k_encode.c b/src/lib/krb5/asn.1/asn1_k_encode.c index 82f99b12b..8aecfdf56 100644 --- a/src/lib/krb5/asn.1/asn1_k_encode.c +++ b/src/lib/krb5/asn.1/asn1_k_encode.c @@ -1762,13 +1762,15 @@ asn1_encode_subject_pk_info(asn1buf *buf, const krb5_subject_pk_info *val, } if (val->algorithm.parameters.length != 0) { - unsigned int length; - retval = asn1buf_insert_octetstring(buf, val->algorithm.parameters.length, val->algorithm.parameters.data); if (retval) return retval; sum += val->algorithm.parameters.length; + } + + { + unsigned int length; retval = asn1_encode_oid(buf, val->algorithm.algorithm.length, val->algorithm.algorithm.data,