/* Copyright (c) 2016, Google Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */

/* This header is provided in order to make compiling against code that expects
   OpenSSL easier. */

#include "asn1.h"

//==============================================================================
// Samsung patch. Add CMS, OCSP and PKCS7 support for Email application.
#ifdef SAMSUNG_VNDK_EXT

#ifndef HEADER_ASN1_MAC_H
#define HEADER_ASN1_MAC_H

#include <openssl/asn1.h>

#if defined(__cplusplus)
extern "C" {
#endif

OPENSSL_EXPORT int asn1_GetSequence(ASN1_const_CTX *c, long *length);

#define M_ASN1_D2I_start_sequence() \
    if (!asn1_GetSequence(&c, &length)) { \
      c.line=__LINE__; \
      goto err; \
    }

#define M_ASN1_D2I_end_sequence() \
    (((c.inf & 1) == 0) ? (c.slen <= 0) : \
        (c.eos = ASN1_const_check_infinite_end(&c.p, c.slen)))


#if defined(__cplusplus)
} // extern C
#endif
#endif // HEADER_ASN1_MAC_H

#endif
//==============================================================================
