Lines Matching defs:code
76 asn1_error_code asn1buf_wrap_data(asn1buf *buf, const krb5_data *code)
78 if(code == NULL || code->data == NULL) return ASN1_MISSING_FIELD;
79 buf->next = buf->base = code->data;
80 buf->bound = code->data + code->length - 1;
255 asn1_error_code asn12krb5_buf(const asn1buf *buf, krb5_data **code)
258 *code = (krb5_data*)calloc(1,sizeof(krb5_data));
259 if(*code == NULL) return ENOMEM;
260 (*code)->magic = KV5M_DATA;
261 (*code)->data = NULL;
262 (*code)->length = 0;
263 (*code)->length = asn1buf_len(buf);
264 (*code)->data = (char*)malloc((((*code)->length)+1)*sizeof(char));
265 if ((*code)->data == NULL) {
266 free(*code);
267 *code = NULL;
270 for(i=0; i < (*code)->length; i++)
271 ((*code)->data)[i] = (buf->base)[((*code)->length)-i-1];
272 ((*code)->data)[(*code)->length] = '\0';