#include <openssl/objects.h>
#include <openssl/buffer.h>
#include <openssl/err.h>
+#include "crypto/asn1.h"
#include "internal/numbers.h"
#include "asn1_local.h"
*/
#define ASN1_MAX_CONSTRUCTED_NEST 30
-static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
- long len, const ASN1_ITEM *it,
- int tag, int aclass, char opt, ASN1_TLC *ctx,
- int depth, OSSL_LIB_CTX *libctx,
- const char *propq);
-
static int asn1_check_eoc(const unsigned char **in, long len);
static int asn1_find_end(const unsigned char **in, long len, char inf);
* tag mismatch return -1 to handle OPTIONAL
*/
-static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
- long len, const ASN1_ITEM *it,
- int tag, int aclass, char opt, ASN1_TLC *ctx,
- int depth, OSSL_LIB_CTX *libctx,
- const char *propq)
+int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
+ long len, const ASN1_ITEM *it,
+ int tag, int aclass, char opt, ASN1_TLC *ctx,
+ int depth, OSSL_LIB_CTX *libctx,
+ const char *propq)
{
const ASN1_TEMPLATE *tt, *errtt = NULL;
const ASN1_EXTERN_FUNCS *ef;
}
/* This ensures that |*in| advances properly no matter what */
- if ((ret = ASN1_item_ex_d2i(pval, in, len,
- ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
- tag, aclass, opt, ctx)) <= 0)
+ if ((ret = asn1_item_embed_d2i(pval, in, len,
+ ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
+ tag, aclass, opt, ctx, 0,
+ NULL, NULL)) <= 0) {
+ x509_pubkey_ex_free(pval, it);
return ret;
+ }
publen = *in - in_saved;
if (!ossl_assert(publen > 0)) {
void ossl_asn1_string_set_bits_left(ASN1_STRING *str, unsigned int num);
+int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
+ long len, const ASN1_ITEM *it, int tag, int aclass,
+ char opt, ASN1_TLC *ctx, int depth,
+ OSSL_LIB_CTX *libctx, const char *propq);
+
#endif /* ndef OSSL_CRYPTO_ASN1_H */