asn1_error_code retval;\
unsigned int length, sum = 0;\
asn1buf *buf=NULL;\
+ krb5_data *tmpcode;\
+\
+ *code = NULL;\
\
if (rep == NULL) return ASN1_MISSING_FIELD;\
\
/* produce the final output and clean up the workspace */
#define krb5_cleanup()\
- retval = asn12krb5_buf(buf,code);\
- if (retval) {\
- asn1buf_destroy(&buf);\
- return retval; }\
- retval = asn1buf_destroy(&buf);\
- if (retval) {\
- return retval; }\
-\
+ retval = asn12krb5_buf(buf,&tmpcode);\
+error:\
+ asn1buf_destroy(&buf);\
+ if (retval)\
+ return retval;\
+ *code = tmpcode;\
return 0
krb5_error_code encode_krb5_pa_pk_as_req(const krb5_pa_pk_as_req *rep, krb5_data **code)
{
krb5_setup();
retval = asn1_encode_pa_pk_as_req(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_pa_pk_as_req_draft9(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_pa_pk_as_rep(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_pa_pk_as_rep_draft9(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_auth_pack(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_auth_pack_draft9(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_kdc_dh_key_info(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_reply_key_pack(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_reply_key_pack_draft9(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_td_trusted_certifiers(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_sequence_of_typed_data(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}
{
krb5_setup();
retval = asn1_encode_sequence_of_algorithm_identifier(buf,rep,&length);
- if (retval) return retval;
+ if (retval) goto error;
sum += length;
krb5_cleanup();
}