Commit a7cca246 authored by Senthil Prabakaran's avatar Senthil Prabakaran Committed by Mouse

Only do encode of JER

parent 6a8ac437
......@@ -431,6 +431,23 @@ asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
break;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
case ATS_BASIC_JER:
if(td->op->jer_encoder) {
er = jer_encode(td, sptr, 0, callback, callback_key);
if(er.encoded == -1) {
if(er.failed_type && er.failed_type->op->jer_encoder) {
errno = EBADF; /* Structure has incorrect form. */
} else {
errno = ENOENT; /* XER is not defined for this type. */
}
}
} else {
errno = ENOENT; /* Transfer syntax is not defined for this type. */
ASN__ENCODE_FAILED;
}
break;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
default:
errno = ENOENT;
ASN__ENCODE_FAILED;
......@@ -516,13 +533,6 @@ asn_decode(const asn_codec_ctx_t *opt_codec_ctx,
errno = ENOENT;
ASN__DECODE_FAILED;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
case ATS_BASIC_JER:
#if !defined(ASN_DISABLE_JER_SUPPORT)
return jer_decode(opt_codec_ctx, td, sptr, buffer, size);
#else
errno = ENOENT;
ASN__DECODE_FAILED;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment