Initial commit

This commit is contained in:
estkme 2023-09-21 12:15:29 +08:00
parent 5cdbb58284
commit f71cf7b183
684 changed files with 72864 additions and 0 deletions

2
.gitignore vendored
View file

@ -9,3 +9,5 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
build
.vscode

39
CMakeLists.txt Normal file
View file

@ -0,0 +1,39 @@
option(LINUX_MINGW32 "Build for windows on Linux" OFF)
if(LINUX_MINGW32)
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endif()
cmake_minimum_required (VERSION 2.8.12)
project (lpac)
set(BUILD_SHARED_AND_STATIC_LIBS ON CACHE BOOL "" FORCE)
set(ENABLE_CJSON_TEST OFF CACHE BOOL "" FORCE)
set(ENABLE_CJSON_UTILS OFF CACHE BOOL "" FORCE)
set(ENABLE_LOCALES OFF CACHE BOOL "" FORCE)
set(ENABLE_CJSON_UNINSTALL OFF CACHE BOOL "" FORCE)
set(ENABLE_CUSTOM_COMPILER_FLAGS OFF CACHE BOOL "" FORCE)
add_subdirectory(cjson)
unset(ENABLE_CJSON_TEST)
unset(ENABLE_CJSON_UTILS)
unset(ENABLE_LOCALES)
unset(ENABLE_CJSON_UNINSTALL)
unset(ENABLE_CUSTOM_COMPILER_FLAGS)
unset(BUILD_SHARED_AND_STATIC_LIBS)
include_directories(.)
add_subdirectory(euicc)
add_subdirectory(interface)
add_subdirectory(src)

15
README.md Normal file
View file

@ -0,0 +1,15 @@
## Compile for Linux
```
mkdir build
cd build
cmake ..
make
```
## Compile for Windows (MINGW32 on Linux)
```
mkdir build
cd build
cmake -DLINUX_MINGW32=ON ..
make
```

619
asn1/PKIXExplicit88.asn Normal file
View file

@ -0,0 +1,619 @@
PKIX1Explicit88 { iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0) id-pkix1-explicit(18) }
DEFINITIONS EXPLICIT TAGS ::=
BEGIN
-- EXPORTS ALL --
-- IMPORTS NONE --
-- UNIVERSAL Types defined in 1993 and 1998 ASN.1
-- and required by this specification
-- UniversalString ::= [UNIVERSAL 28] IMPLICIT OCTET STRING
-- UniversalString is defined in ASN.1:1993
-- BMPString ::= [UNIVERSAL 30] IMPLICIT OCTET STRING
-- BMPString is the subtype of UniversalString and models
-- the Basic Multilingual Plane of ISO/IEC/ITU 10646-1
-- UTF8String ::= [UNIVERSAL 12] IMPLICIT OCTET STRING
-- The content of this type conforms to RFC 2279.
-- PKIX specific OIDs
id-pkix OBJECT IDENTIFIER ::=
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) }
-- PKIX arcs
id-pe OBJECT IDENTIFIER ::= { id-pkix 1 }
-- arc for private certificate extensions
id-qt OBJECT IDENTIFIER ::= { id-pkix 2 }
-- arc for policy qualifier types
id-kp OBJECT IDENTIFIER ::= { id-pkix 3 }
-- arc for extended key purpose OIDS
id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
-- arc for access descriptors
-- policyQualifierIds for Internet policy qualifiers
id-qt-cps OBJECT IDENTIFIER ::= { id-qt 1 }
-- OID for CPS qualifier
id-qt-unotice OBJECT IDENTIFIER ::= { id-qt 2 }
-- OID for user notice qualifier
-- access descriptor definitions
id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
id-ad-timeStamping OBJECT IDENTIFIER ::= { id-ad 3 }
id-ad-caRepository OBJECT IDENTIFIER ::= { id-ad 5 }
-- attribute data types
Attribute ::= SEQUENCE {
type AttributeType,
values SET OF AttributeValue }
-- at least one value is required
AttributeType ::= OBJECT IDENTIFIER
AttributeValue ::= ANY
AttributeTypeAndValue ::= SEQUENCE {
type AttributeType,
value AttributeValue }
-- suggested naming attributes: Definition of the following
-- information object set may be augmented to meet local
-- requirements. Note that deleting members of the set may
-- prevent interoperability with conforming implementations.
-- presented in pairs: the AttributeType followed by the
-- type definition for the corresponding AttributeValue
--Arc for standard naming attributes
id-at OBJECT IDENTIFIER ::= { joint-iso-ccitt(2) ds(5) 4 }
-- Naming attributes of type X520name
id-at-name AttributeType ::= { id-at 41 }
id-at-surname AttributeType ::= { id-at 4 }
id-at-givenName AttributeType ::= { id-at 42 }
id-at-initials AttributeType ::= { id-at 43 }
id-at-generationQualifier AttributeType ::= { id-at 44 }
X520name ::= CHOICE {
teletexString TeletexString (SIZE (1..ub-name)),
printableString PrintableString (SIZE (1..ub-name)),
universalString UniversalString (SIZE (1..ub-name)),
utf8String UTF8String (SIZE (1..ub-name)),
bmpString BMPString (SIZE (1..ub-name)) }
-- Naming attributes of type X520CommonName
id-at-commonName AttributeType ::= { id-at 3 }
X520CommonName ::= CHOICE {
teletexString TeletexString (SIZE (1..ub-common-name)),
printableString PrintableString (SIZE (1..ub-common-name)),
universalString UniversalString (SIZE (1..ub-common-name)),
utf8String UTF8String (SIZE (1..ub-common-name)),
bmpString BMPString (SIZE (1..ub-common-name)) }
-- Naming attributes of type X520LocalityName
id-at-localityName AttributeType ::= { id-at 7 }
X520LocalityName ::= CHOICE {
teletexString TeletexString (SIZE (1..ub-locality-name)),
printableString PrintableString (SIZE (1..ub-locality-name)),
universalString UniversalString (SIZE (1..ub-locality-name)),
utf8String UTF8String (SIZE (1..ub-locality-name)),
bmpString BMPString (SIZE (1..ub-locality-name)) }
-- Naming attributes of type X520StateOrProvinceName
id-at-stateOrProvinceName AttributeType ::= { id-at 8 }
X520StateOrProvinceName ::= CHOICE {
teletexString TeletexString (SIZE (1..ub-state-name)),
printableString PrintableString (SIZE (1..ub-state-name)),
universalString UniversalString (SIZE (1..ub-state-name)),
utf8String UTF8String (SIZE (1..ub-state-name)),
bmpString BMPString (SIZE(1..ub-state-name)) }
-- Naming attributes of type X520OrganizationName
id-at-organizationName AttributeType ::= { id-at 10 }
X520OrganizationName ::= CHOICE {
teletexString TeletexString
(SIZE (1..ub-organization-name)),
printableString PrintableString
(SIZE (1..ub-organization-name)),
universalString UniversalString
(SIZE (1..ub-organization-name)),
utf8String UTF8String
(SIZE (1..ub-organization-name)),
bmpString BMPString
(SIZE (1..ub-organization-name)) }
-- Naming attributes of type X520OrganizationalUnitName
id-at-organizationalUnitName AttributeType ::= { id-at 11 }
X520OrganizationalUnitName ::= CHOICE {
teletexString TeletexString
(SIZE (1..ub-organizational-unit-name)),
printableString PrintableString
(SIZE (1..ub-organizational-unit-name)),
universalString UniversalString
(SIZE (1..ub-organizational-unit-name)),
utf8String UTF8String
(SIZE (1..ub-organizational-unit-name)),
bmpString BMPString
(SIZE (1..ub-organizational-unit-name)) }
-- Naming attributes of type X520Title
id-at-title AttributeType ::= { id-at 12 }
X520Title ::= CHOICE {
teletexString TeletexString (SIZE (1..ub-title)),
printableString PrintableString (SIZE (1..ub-title)),
universalString UniversalString (SIZE (1..ub-title)),
utf8String UTF8String (SIZE (1..ub-title)),
bmpString BMPString (SIZE (1..ub-title)) }
-- Naming attributes of type X520dnQualifier
id-at-dnQualifier AttributeType ::= { id-at 46 }
X520dnQualifier ::= PrintableString
-- Naming attributes of type X520countryName (digraph from IS 3166)
id-at-countryName AttributeType ::= { id-at 6 }
X520countryName ::= PrintableString (SIZE (2))
-- Naming attributes of type X520SerialNumber
id-at-serialNumber AttributeType ::= { id-at 5 }
X520SerialNumber ::= PrintableString (SIZE (1..ub-serial-number))
-- Naming attributes of type X520Pseudonym
id-at-pseudonym AttributeType ::= { id-at 65 }
X520Pseudonym ::= CHOICE {
teletexString TeletexString (SIZE (1..ub-pseudonym)),
printableString PrintableString (SIZE (1..ub-pseudonym)),
universalString UniversalString (SIZE (1..ub-pseudonym)),
utf8String UTF8String (SIZE (1..ub-pseudonym)),
bmpString BMPString (SIZE (1..ub-pseudonym)) }
-- Naming attributes of type DomainComponent (from RFC 2247)
id-domainComponent AttributeType ::=
{ 0 9 2342 19200300 100 1 25 }
DomainComponent ::= IA5String
-- Legacy attributes
pkcs-9 OBJECT IDENTIFIER ::=
{ iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 }
id-emailAddress AttributeType ::= { pkcs-9 1 }
EmailAddress ::= IA5String (SIZE (1..ub-emailaddress-length))
-- naming data types --
Name ::= CHOICE { -- only one possibility for now --
rdnSequence RDNSequence }
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
DistinguishedName ::= RDNSequence
RelativeDistinguishedName ::=
SET SIZE (1 .. MAX) OF AttributeTypeAndValue
-- Directory string type --
DirectoryString ::= CHOICE {
teletexString TeletexString (SIZE (1..MAX)),
printableString PrintableString (SIZE (1..MAX)),
universalString UniversalString (SIZE (1..MAX)),
utf8String UTF8String (SIZE (1..MAX)),
bmpString BMPString (SIZE (1..MAX)) }
-- certificate and CRL specific structures begin here
Certificate ::= SEQUENCE {
tbsCertificate TBSCertificate,
signatureAlgorithm AlgorithmIdentifier,
signature BIT STRING }
TBSCertificate ::= SEQUENCE {
version [0] Version DEFAULT v1,
serialNumber CertificateSerialNumber,
signature AlgorithmIdentifier,
issuer Name,
validity Validity,
subject Name,
subjectPublicKeyInfo SubjectPublicKeyInfo,
issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
-- If present, version MUST be v2 or v3
subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
-- If present, version MUST be v2 or v3
extensions [3] Extensions OPTIONAL
-- If present, version MUST be v3 -- }
Version ::= INTEGER { v1(0), v2(1), v3(2) }
CertificateSerialNumber ::= INTEGER
Validity ::= SEQUENCE {
notBefore Time,
notAfter Time }
Time ::= CHOICE {
utcTime UTCTime,
generalTime GeneralizedTime }
UniqueIdentifier ::= BIT STRING
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING }
Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
Extension ::= SEQUENCE {
extnID OBJECT IDENTIFIER,
critical BOOLEAN DEFAULT FALSE,
extnValue OCTET STRING }
-- CRL structures
CertificateList ::= SEQUENCE {
tbsCertList TBSCertList,
signatureAlgorithm AlgorithmIdentifier,
signature BIT STRING }
TBSCertList ::= SEQUENCE {
version Version OPTIONAL,
-- if present, MUST be v2
signature AlgorithmIdentifier,
issuer Name,
thisUpdate Time,
nextUpdate Time OPTIONAL,
revokedCertificates SEQUENCE OF SEQUENCE {
userCertificate CertificateSerialNumber,
revocationDate Time,
crlEntryExtensions Extensions OPTIONAL
-- if present, MUST be v2
} OPTIONAL,
crlExtensions [0] Extensions OPTIONAL }
-- if present, MUST be v2
-- Version, Time, CertificateSerialNumber, and Extensions were
-- defined earlier for use in the certificate structure
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL }
-- contains a value of the type
-- registered for use with the
-- algorithm object identifier value
-- X.400 address syntax starts here
ORAddress ::= SEQUENCE {
built-in-standard-attributes BuiltInStandardAttributes,
built-in-domain-defined-attributes
BuiltInDomainDefinedAttributes OPTIONAL,
-- see also teletex-domain-defined-attributes
extension-attributes ExtensionAttributes OPTIONAL }
-- Built-in Standard Attributes
BuiltInStandardAttributes ::= SEQUENCE {
country-name CountryName OPTIONAL,
administration-domain-name AdministrationDomainName OPTIONAL,
network-address [0] IMPLICIT NetworkAddress OPTIONAL,
-- see also extended-network-address
terminal-identifier [1] IMPLICIT TerminalIdentifier OPTIONAL,
private-domain-name [2] PrivateDomainName OPTIONAL,
organization-name [3] IMPLICIT OrganizationName OPTIONAL,
-- see also teletex-organization-name
numeric-user-identifier [4] IMPLICIT NumericUserIdentifier
OPTIONAL,
personal-name [5] IMPLICIT PersonalName OPTIONAL,
-- see also teletex-personal-name
organizational-unit-names [6] IMPLICIT OrganizationalUnitNames
OPTIONAL }
-- see also teletex-organizational-unit-names
CountryName ::= [APPLICATION 1] CHOICE {
x121-dcc-code NumericString
(SIZE (ub-country-name-numeric-length)),
iso-3166-alpha2-code PrintableString
(SIZE (ub-country-name-alpha-length)) }
AdministrationDomainName ::= [APPLICATION 2] CHOICE {
numeric NumericString (SIZE (0..ub-domain-name-length)),
printable PrintableString (SIZE (0..ub-domain-name-length)) }
NetworkAddress ::= X121Address -- see also extended-network-address
X121Address ::= NumericString (SIZE (1..ub-x121-address-length))
TerminalIdentifier ::= PrintableString (SIZE
(1..ub-terminal-id-length))
PrivateDomainName ::= CHOICE {
numeric NumericString (SIZE (1..ub-domain-name-length)),
printable PrintableString (SIZE (1..ub-domain-name-length)) }
OrganizationName ::= PrintableString
(SIZE (1..ub-organization-name-length))
-- see also teletex-organization-name
NumericUserIdentifier ::= NumericString
(SIZE (1..ub-numeric-user-id-length))
PersonalName ::= SET {
surname [0] IMPLICIT PrintableString
(SIZE (1..ub-surname-length)),
given-name [1] IMPLICIT PrintableString
(SIZE (1..ub-given-name-length)) OPTIONAL,
initials [2] IMPLICIT PrintableString
(SIZE (1..ub-initials-length)) OPTIONAL,
generation-qualifier [3] IMPLICIT PrintableString
(SIZE (1..ub-generation-qualifier-length))
OPTIONAL }
-- see also teletex-personal-name
OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units)
OF OrganizationalUnitName
-- see also teletex-organizational-unit-names
OrganizationalUnitName ::= PrintableString (SIZE
(1..ub-organizational-unit-name-length))
-- Built-in Domain-defined Attributes
BuiltInDomainDefinedAttributes ::= SEQUENCE SIZE
(1..ub-domain-defined-attributes) OF
BuiltInDomainDefinedAttribute
BuiltInDomainDefinedAttribute ::= SEQUENCE {
type PrintableString (SIZE
(1..ub-domain-defined-attribute-type-length)),
value PrintableString (SIZE
(1..ub-domain-defined-attribute-value-length)) }
-- Extension Attributes
ExtensionAttributes ::= SET SIZE (1..ub-extension-attributes) OF
ExtensionAttribute
ExtensionAttribute ::= SEQUENCE {
extension-attribute-type [0] IMPLICIT INTEGER
(0..ub-extension-attributes),
extension-attribute-value [1]
ANY DEFINED BY extension-attribute-type }
-- Extension types and attribute values
common-name INTEGER ::= 1
CommonName ::= PrintableString (SIZE (1..ub-common-name-length))
teletex-common-name INTEGER ::= 2
TeletexCommonName ::= TeletexString (SIZE (1..ub-common-name-length))
teletex-organization-name INTEGER ::= 3
TeletexOrganizationName ::=
TeletexString (SIZE (1..ub-organization-name-length))
teletex-personal-name INTEGER ::= 4
TeletexPersonalName ::= SET {
surname [0] IMPLICIT TeletexString
(SIZE (1..ub-surname-length)),
given-name [1] IMPLICIT TeletexString
(SIZE (1..ub-given-name-length)) OPTIONAL,
initials [2] IMPLICIT TeletexString
(SIZE (1..ub-initials-length)) OPTIONAL,
generation-qualifier [3] IMPLICIT TeletexString
(SIZE (1..ub-generation-qualifier-length))
OPTIONAL }
teletex-organizational-unit-names INTEGER ::= 5
TeletexOrganizationalUnitNames ::= SEQUENCE SIZE
(1..ub-organizational-units) OF TeletexOrganizationalUnitName
TeletexOrganizationalUnitName ::= TeletexString
(SIZE (1..ub-organizational-unit-name-length))
pds-name INTEGER ::= 7
PDSName ::= PrintableString (SIZE (1..ub-pds-name-length))
physical-delivery-country-name INTEGER ::= 8
PhysicalDeliveryCountryName ::= CHOICE {
x121-dcc-code NumericString (SIZE
(ub-country-name-numeric-length)),
iso-3166-alpha2-code PrintableString
(SIZE (ub-country-name-alpha-length)) }
postal-code INTEGER ::= 9
PostalCode ::= CHOICE {
numeric-code NumericString (SIZE (1..ub-postal-code-length)),
printable-code PrintableString (SIZE (1..ub-postal-code-length)) }
physical-delivery-office-name INTEGER ::= 10
PhysicalDeliveryOfficeName ::= PDSParameter
physical-delivery-office-number INTEGER ::= 11
PhysicalDeliveryOfficeNumber ::= PDSParameter
extension-OR-address-components INTEGER ::= 12
ExtensionORAddressComponents ::= PDSParameter
physical-delivery-personal-name INTEGER ::= 13
PhysicalDeliveryPersonalName ::= PDSParameter
physical-delivery-organization-name INTEGER ::= 14
PhysicalDeliveryOrganizationName ::= PDSParameter
extension-physical-delivery-address-components INTEGER ::= 15
ExtensionPhysicalDeliveryAddressComponents ::= PDSParameter
unformatted-postal-address INTEGER ::= 16
UnformattedPostalAddress ::= SET {
printable-address SEQUENCE SIZE (1..ub-pds-physical-address-lines)
OF PrintableString (SIZE (1..ub-pds-parameter-length))
OPTIONAL,
teletex-string TeletexString
(SIZE (1..ub-unformatted-address-length)) OPTIONAL }
street-address INTEGER ::= 17
StreetAddress ::= PDSParameter
post-office-box-address INTEGER ::= 18
PostOfficeBoxAddress ::= PDSParameter
poste-restante-address INTEGER ::= 19
PosteRestanteAddress ::= PDSParameter
unique-postal-name INTEGER ::= 20
UniquePostalName ::= PDSParameter
local-postal-attributes INTEGER ::= 21
LocalPostalAttributes ::= PDSParameter
PDSParameter ::= SET {
printable-string PrintableString
(SIZE(1..ub-pds-parameter-length)) OPTIONAL,
teletex-string TeletexString
(SIZE(1..ub-pds-parameter-length)) OPTIONAL }
extended-network-address INTEGER ::= 22
ExtendedNetworkAddress ::= CHOICE {
e163-4-address SEQUENCE {
number [0] IMPLICIT NumericString
(SIZE (1..ub-e163-4-number-length)),
sub-address [1] IMPLICIT NumericString
(SIZE (1..ub-e163-4-sub-address-length))
OPTIONAL },
psap-address [0] IMPLICIT PresentationAddress }
PresentationAddress ::= SEQUENCE {
pSelector [0] EXPLICIT OCTET STRING OPTIONAL,
sSelector [1] EXPLICIT OCTET STRING OPTIONAL,
tSelector [2] EXPLICIT OCTET STRING OPTIONAL,
nAddresses [3] EXPLICIT SET SIZE (1..MAX) OF OCTET STRING }
terminal-type INTEGER ::= 23
TerminalType ::= INTEGER {
telex (3),
teletex (4),
g3-facsimile (5),
g4-facsimile (6),
ia5-terminal (7),
videotex (8) }
-- Extension Domain-defined Attributes
teletex-domain-defined-attributes INTEGER ::= 6
TeletexDomainDefinedAttributes ::= SEQUENCE SIZE
(1..ub-domain-defined-attributes) OF TeletexDomainDefinedAttribute
TeletexDomainDefinedAttribute ::= SEQUENCE {
type TeletexString
(SIZE (1..ub-domain-defined-attribute-type-length)),
value TeletexString
(SIZE (1..ub-domain-defined-attribute-value-length)) }
-- specifications of Upper Bounds MUST be regarded as mandatory
-- from Annex B of ITU-T X.411 Reference Definition of MTS Parameter
-- Upper Bounds
-- Upper Bounds
ub-name INTEGER ::= 32768
ub-common-name INTEGER ::= 64
ub-locality-name INTEGER ::= 128
ub-state-name INTEGER ::= 128
ub-organization-name INTEGER ::= 64
ub-organizational-unit-name INTEGER ::= 64
ub-title INTEGER ::= 64
ub-serial-number INTEGER ::= 64
ub-match INTEGER ::= 128
ub-emailaddress-length INTEGER ::= 255
ub-common-name-length INTEGER ::= 64
ub-country-name-alpha-length INTEGER ::= 2
ub-country-name-numeric-length INTEGER ::= 3
ub-domain-defined-attributes INTEGER ::= 4
ub-domain-defined-attribute-type-length INTEGER ::= 8
ub-domain-defined-attribute-value-length INTEGER ::= 128
ub-domain-name-length INTEGER ::= 16
ub-extension-attributes INTEGER ::= 256
ub-e163-4-number-length INTEGER ::= 15
ub-e163-4-sub-address-length INTEGER ::= 40
ub-generation-qualifier-length INTEGER ::= 3
ub-given-name-length INTEGER ::= 16
ub-initials-length INTEGER ::= 5
ub-integer-options INTEGER ::= 256
ub-numeric-user-id-length INTEGER ::= 32
ub-organization-name-length INTEGER ::= 64
ub-organizational-unit-name-length INTEGER ::= 32
ub-organizational-units INTEGER ::= 4
ub-pds-name-length INTEGER ::= 16
ub-pds-parameter-length INTEGER ::= 30
ub-pds-physical-address-lines INTEGER ::= 6
ub-postal-code-length INTEGER ::= 16
ub-pseudonym INTEGER ::= 128
ub-surname-length INTEGER ::= 40
ub-terminal-id-length INTEGER ::= 24
ub-unformatted-address-length INTEGER ::= 180
ub-x121-address-length INTEGER ::= 16
-- Note - upper bounds on string types, such as TeletexString, are
-- measured in characters. Excepting PrintableString or IA5String, a
-- significantly greater number of octets will be required to hold
-- such a value. As a minimum, 16 octets, or twice the specified
-- upper bound, whichever is the larger, should be allowed for
-- TeletexString. For UTF8String or UniversalString at least four
-- times the upper bound should be allowed.
END

387
asn1/PKIXImplicit88.asn Normal file
View file

@ -0,0 +1,387 @@
--
-- ASN.1 module found by ./crfc2asn1.pl in rfc3280.txt at line 5850
--
PKIX1Implicit88 { iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0) id-pkix1-implicit(19) }
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
-- EXPORTS ALL --
IMPORTS
id-pe, id-kp, id-qt-unotice, id-qt-cps,
ORAddress, Name, RelativeDistinguishedName,
CertificateSerialNumber, Attribute, DirectoryString
FROM PKIX1Explicit88 { iso(1) identified-organization(3)
dod(6) internet(1) security(5) mechanisms(5) pkix(7)
id-mod(0) id-pkix1-explicit(18) };
-- ISO arc for standard certificate and CRL extensions
id-ce OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 29}
-- authority key identifier OID and syntax
id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 35 }
AuthorityKeyIdentifier ::= SEQUENCE {
keyIdentifier [0] KeyIdentifier OPTIONAL,
authorityCertIssuer [1] GeneralNames OPTIONAL,
authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
-- authorityCertIssuer and authorityCertSerialNumber MUST both
-- be present or both be absent
KeyIdentifier ::= OCTET STRING
-- subject key identifier OID and syntax
id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 }
SubjectKeyIdentifier ::= KeyIdentifier
-- key usage extension OID and syntax
id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 }
KeyUsage ::= BIT STRING {
digitalSignature (0),
nonRepudiation (1),
keyEncipherment (2),
dataEncipherment (3),
keyAgreement (4),
keyCertSign (5),
cRLSign (6),
encipherOnly (7),
decipherOnly (8) }
-- private key usage period extension OID and syntax
id-ce-privateKeyUsagePeriod OBJECT IDENTIFIER ::= { id-ce 16 }
PrivateKeyUsagePeriod ::= SEQUENCE {
notBefore [0] GeneralizedTime OPTIONAL,
notAfter [1] GeneralizedTime OPTIONAL }
-- either notBefore or notAfter MUST be present
-- certificate policies extension OID and syntax
id-ce-certificatePolicies OBJECT IDENTIFIER ::= { id-ce 32 }
anyPolicy OBJECT IDENTIFIER ::= { id-ce-certificatePolicies 0 }
CertificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
PolicyInformation ::= SEQUENCE {
policyIdentifier CertPolicyId,
policyQualifiers SEQUENCE SIZE (1..MAX) OF
PolicyQualifierInfo OPTIONAL }
CertPolicyId ::= OBJECT IDENTIFIER
PolicyQualifierInfo ::= SEQUENCE {
policyQualifierId PolicyQualifierId,
qualifier ANY DEFINED BY policyQualifierId }
-- Implementations that recognize additional policy qualifiers MUST
-- augment the following definition for PolicyQualifierId
PolicyQualifierId ::=
OBJECT IDENTIFIER -- ( id-qt-cps | id-qt-unotice )
-- CPS pointer qualifier
CPSuri ::= IA5String
-- user notice qualifier
UserNotice ::= SEQUENCE {
noticeRef NoticeReference OPTIONAL,
explicitText DisplayText OPTIONAL}
NoticeReference ::= SEQUENCE {
organization DisplayText,
noticeNumbers SEQUENCE OF INTEGER }
DisplayText ::= CHOICE {
ia5String IA5String (SIZE (1..200)),
visibleString VisibleString (SIZE (1..200)),
bmpString BMPString (SIZE (1..200)),
utf8String UTF8String (SIZE (1..200)) }
-- policy mapping extension OID and syntax
id-ce-policyMappings OBJECT IDENTIFIER ::= { id-ce 33 }
PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
issuerDomainPolicy CertPolicyId,
subjectDomainPolicy CertPolicyId }
-- subject alternative name extension OID and syntax
id-ce-subjectAltName OBJECT IDENTIFIER ::= { id-ce 17 }
SubjectAltName ::= GeneralNames
GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
GeneralName ::= CHOICE {
otherName [0] AnotherName,
rfc822Name [1] IA5String,
dNSName [2] IA5String,
x400Address [3] ORAddress,
directoryName [4] Name,
ediPartyName [5] EDIPartyName,
uniformResourceIdentifier [6] IA5String,
iPAddress [7] OCTET STRING,
registeredID [8] OBJECT IDENTIFIER }
-- AnotherName replaces OTHER-NAME ::= TYPE-IDENTIFIER, as
-- TYPE-IDENTIFIER is not supported in the '88 ASN.1 syntax
AnotherName ::= SEQUENCE {
type-id OBJECT IDENTIFIER,
value [0] EXPLICIT ANY DEFINED BY type-id }
EDIPartyName ::= SEQUENCE {
nameAssigner [0] DirectoryString OPTIONAL,
partyName [1] DirectoryString }
-- issuer alternative name extension OID and syntax
id-ce-issuerAltName OBJECT IDENTIFIER ::= { id-ce 18 }
IssuerAltName ::= GeneralNames
id-ce-subjectDirectoryAttributes OBJECT IDENTIFIER ::= { id-ce 9 }
SubjectDirectoryAttributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
-- basic constraints extension OID and syntax
id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 }
BasicConstraints ::= SEQUENCE {
cA BOOLEAN DEFAULT FALSE,
pathLenConstraint INTEGER (0..MAX) OPTIONAL }
-- name constraints extension OID and syntax
id-ce-nameConstraints OBJECT IDENTIFIER ::= { id-ce 30 }
NameConstraints ::= SEQUENCE {
permittedSubtrees [0] GeneralSubtrees OPTIONAL,
excludedSubtrees [1] GeneralSubtrees OPTIONAL }
GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
GeneralSubtree ::= SEQUENCE {
base GeneralName,
minimum [0] BaseDistance DEFAULT 0,
maximum [1] BaseDistance OPTIONAL }
BaseDistance ::= INTEGER (0..MAX)
-- policy constraints extension OID and syntax
id-ce-policyConstraints OBJECT IDENTIFIER ::= { id-ce 36 }
PolicyConstraints ::= SEQUENCE {
requireExplicitPolicy [0] SkipCerts OPTIONAL,
inhibitPolicyMapping [1] SkipCerts OPTIONAL }
SkipCerts ::= INTEGER (0..MAX)
-- CRL distribution points extension OID and syntax
id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::= {id-ce 31}
CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
DistributionPoint ::= SEQUENCE {
distributionPoint [0] DistributionPointName OPTIONAL,
reasons [1] ReasonFlags OPTIONAL,
cRLIssuer [2] GeneralNames OPTIONAL }
DistributionPointName ::= CHOICE {
fullName [0] GeneralNames,
nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
ReasonFlags ::= BIT STRING {
unused (0),
keyCompromise (1),
cACompromise (2),
affiliationChanged (3),
superseded (4),
cessationOfOperation (5),
certificateHold (6),
privilegeWithdrawn (7),
aACompromise (8) }
-- extended key usage extension OID and syntax
id-ce-extKeyUsage OBJECT IDENTIFIER ::= {id-ce 37}
ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
KeyPurposeId ::= OBJECT IDENTIFIER
-- permit unspecified key uses
anyExtendedKeyUsage OBJECT IDENTIFIER ::= { id-ce-extKeyUsage 0 }
-- extended key purpose OIDs
id-kp-serverAuth OBJECT IDENTIFIER ::= { id-kp 1 }
id-kp-clientAuth OBJECT IDENTIFIER ::= { id-kp 2 }
id-kp-codeSigning OBJECT IDENTIFIER ::= { id-kp 3 }
id-kp-emailProtection OBJECT IDENTIFIER ::= { id-kp 4 }
id-kp-timeStamping OBJECT IDENTIFIER ::= { id-kp 8 }
id-kp-OCSPSigning OBJECT IDENTIFIER ::= { id-kp 9 }
-- inhibit any policy OID and syntax
id-ce-inhibitAnyPolicy OBJECT IDENTIFIER ::= { id-ce 54 }
InhibitAnyPolicy ::= SkipCerts
-- freshest (delta)CRL extension OID and syntax
id-ce-freshestCRL OBJECT IDENTIFIER ::= { id-ce 46 }
FreshestCRL ::= CRLDistributionPoints
-- authority info access
id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
AuthorityInfoAccessSyntax ::=
SEQUENCE SIZE (1..MAX) OF AccessDescription
AccessDescription ::= SEQUENCE {
accessMethod OBJECT IDENTIFIER,
accessLocation GeneralName }
-- subject info access
id-pe-subjectInfoAccess OBJECT IDENTIFIER ::= { id-pe 11 }
SubjectInfoAccessSyntax ::=
SEQUENCE SIZE (1..MAX) OF AccessDescription
-- CRL number extension OID and syntax
id-ce-cRLNumber OBJECT IDENTIFIER ::= { id-ce 20 }
CRLNumber ::= INTEGER (0..MAX)
-- issuing distribution point extension OID and syntax
id-ce-issuingDistributionPoint OBJECT IDENTIFIER ::= { id-ce 28 }
IssuingDistributionPoint ::= SEQUENCE {
distributionPoint [0] DistributionPointName OPTIONAL,
onlyContainsUserCerts [1] BOOLEAN DEFAULT FALSE,
onlyContainsCACerts [2] BOOLEAN DEFAULT FALSE,
onlySomeReasons [3] ReasonFlags OPTIONAL,
indirectCRL [4] BOOLEAN DEFAULT FALSE,
onlyContainsAttributeCerts [5] BOOLEAN DEFAULT FALSE }
id-ce-deltaCRLIndicator OBJECT IDENTIFIER ::= { id-ce 27 }
BaseCRLNumber ::= CRLNumber
-- CRL reasons extension OID and syntax
id-ce-cRLReasons OBJECT IDENTIFIER ::= { id-ce 21 }
CRLReason ::= ENUMERATED {
unspecified (0),
keyCompromise (1),
cACompromise (2),
affiliationChanged (3),
superseded (4),
cessationOfOperation (5),
certificateHold (6),
removeFromCRL (8),
privilegeWithdrawn (9),
aACompromise (10) }
-- certificate issuer CRL entry extension OID and syntax
id-ce-certificateIssuer OBJECT IDENTIFIER ::= { id-ce 29 }
CertificateIssuer ::= GeneralNames
-- hold instruction extension OID and syntax
id-ce-holdInstructionCode OBJECT IDENTIFIER ::= { id-ce 23 }
HoldInstructionCode ::= OBJECT IDENTIFIER
-- ANSI x9 holdinstructions
-- ANSI x9 arc holdinstruction arc
holdInstruction OBJECT IDENTIFIER ::=
{joint-iso-itu-t(2) member-body(2) us(840) x9cm(10040) 2}
-- ANSI X9 holdinstructions referenced by this standard
id-holdinstruction-none OBJECT IDENTIFIER ::=
{holdInstruction 1} -- deprecated
id-holdinstruction-callissuer OBJECT IDENTIFIER ::=
{holdInstruction 2}
id-holdinstruction-reject OBJECT IDENTIFIER ::=
{holdInstruction 3}
-- invalidity date CRL entry extension OID and syntax
id-ce-invalidityDate OBJECT IDENTIFIER ::= { id-ce 24 }
InvalidityDate ::= GeneralizedTime
END

1
asn1/generate.txt Normal file
View file

@ -0,0 +1 @@
asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example asn1/PKIXExplicit88.asn asn1/PKIXImplicit88.asn asn1/rsp.asn

795
asn1/rsp.asn Normal file
View file

@ -0,0 +1,795 @@
RSPDefinitions {joint-iso-itu-t(2) international-organizations(23) gsma(146) rsp(1) spec-version(1) version-two(2)}
DEFINITIONS
AUTOMATIC TAGS
EXTENSIBILITY IMPLIED ::=
BEGIN
IMPORTS Certificate, CertificateList, Time FROM PKIX1Explicit88 {iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-pkix1-explicit(18)}
SubjectKeyIdentifier FROM PKIX1Implicit88 {iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-pkix1-implicit(19)};
id-rsp OBJECT IDENTIFIER ::= {joint-iso-itu-t(2) international-organizations(23) gsma(146) rsp(1)}
-- Basic types, for size constraints
Octet8 ::= OCTET STRING (SIZE(8))
Octet16 ::= OCTET STRING (SIZE(16))
OctetTo16 ::= OCTET STRING (SIZE(1..16))
Octet32 ::= OCTET STRING (SIZE(32))
Octet1 ::= OCTET STRING(SIZE(1))
Octet2 ::= OCTET STRING (SIZE(2))
VersionType ::= OCTET STRING(SIZE(3)) -- major/minor/revision version are coded as binary value on byte 1/2/3, e.g. '02 00 0C' for v2.0.12.
Iccid ::= [APPLICATION 26] OCTET STRING (SIZE(10)) -- ICCID as coded in EFiccid, corresponding tag is '5A'
RemoteOpId ::= [2] INTEGER {installBoundProfilePackage(1)}
TransactionId ::= OCTET STRING (SIZE(1..16))
-- Definition of EUICCInfo1 --------------------------
GetEuiccInfo1Request ::= [32] SEQUENCE { -- Tag 'BF20'
}
EUICCInfo1 ::= [32] SEQUENCE { -- Tag 'BF20'
svn [2] VersionType, -- GSMA SGP.22 version supported (SVN)
euiccCiPKIdListForVerification [9] SEQUENCE OF SubjectKeyIdentifier, -- List of CI Public Key Identifiers supported on the eUICC for signature verification
euiccCiPKIdListForSigning [10] SEQUENCE OF SubjectKeyIdentifier -- List of CI Public Key Identifier supported on the eUICC for signature creation
}
-- Definition of EUICCInfo2 --------------------------
GetEuiccInfo2Request ::= [34] SEQUENCE { -- Tag 'BF22'
}
EUICCInfo2 ::= [34] SEQUENCE { -- Tag 'BF22'
profileVersion [1] VersionType, -- SIMAlliance Profile package version supported
svn [2] VersionType, -- GSMA SGP.22 version supported (SVN)
euiccFirmwareVer [3] VersionType, -- eUICC Firmware version
extCardResource [4] OCTET STRING, -- Extended Card Resource Information according to ETSI TS 102 226
uiccCapability [5] UICCCapability,
javacardVersion [6] VersionType OPTIONAL,
globalplatformVersion [7] VersionType OPTIONAL,
rspCapability [8] RspCapability,
euiccCiPKIdListForVerification [9] SEQUENCE OF SubjectKeyIdentifier, -- List of CI Public Key Identifiers supported on the eUICC for signature verification
euiccCiPKIdListForSigning [10] SEQUENCE OF SubjectKeyIdentifier, -- List of CI Public Key Identifier supported on the eUICC for signature creation
euiccCategory [11] INTEGER {
other(0),
basicEuicc(1),
mediumEuicc(2),
contactlessEuicc(3)
} OPTIONAL,
forbiddenProfilePolicyRules [25] PprIds OPTIONAL, -- Tag '99'
ppVersion VersionType, -- Protection Profile version
sasAcreditationNumber UTF8String (SIZE(0..64)),
certificationDataObject [12] CertificationDataObject OPTIONAL
}
-- Definition of RspCapability
RspCapability ::= BIT STRING {
additionalProfile(0), -- at least one more Profile can be installed
crlSupport(1), -- CRL
rpmSupport(2), -- Remote Profile Management
testProfileSupport (3) -- support for test profile
}
-- Definition of CertificationDataObject
CertificationDataObject ::= SEQUENCE {
platformLabel UTF8String, -- Platform_Label as defined in GlobalPlatform DLOA specification [57]
discoveryBaseURL UTF8String -- Discovery Base URL of the SE default DLOA Registrar as defined in GlobalPlatform DLOA specification [57]
}
CertificateInfo ::= BIT STRING {
reserved(0), -- eUICC has a CERT.EUICC.ECDSA in GlobalPlatform format. The use of this bit is deprecated.
certSigningX509(1), -- eUICC has a CERT.EUICC.ECDSA in X.509 format
rfu2(2),
rfu3(3),
reserved2(4), -- Handling of Certificate in GlobalPlatform format. The use of this bit is deprecated.
certVerificationX509(5)-- Handling of Certificate in X.509 format
}
-- Definition of UICCCapability
UICCCapability ::= BIT STRING {
/* Sequence is derived from ServicesList[] defined in SIMalliance PEDefinitions*/
contactlessSupport(0), -- Contactless (SWP, HCI and associated APIs)
usimSupport(1), -- USIM as defined by 3GPP
isimSupport(2), -- ISIM as defined by 3GPP
csimSupport(3), -- CSIM as defined by 3GPP2
akaMilenage(4), -- Milenage as AKA algorithm
akaCave(5), -- CAVE as authentication algorithm
akaTuak128(6), -- TUAK as AKA algorithm with 128 bit key length
akaTuak256(7), -- TUAK as AKA algorithm with 256 bit key length
rfu1(8), -- reserved for further algorithms
rfu2(9), -- reserved for further algorithms
gbaAuthenUsim(10), -- GBA authentication in the context of USIM
gbaAuthenISim(11), -- GBA authentication in the context of ISIM
mbmsAuthenUsim(12), -- MBMS authentication in the context of USIM
eapClient(13), -- EAP client
javacard(14), -- Javacard support
multos(15), -- Multos support
multipleUsimSupport(16), -- Multiple USIM applications are supported within the same Profile
multipleIsimSupport(17), -- Multiple ISIM applications are supported within the same Profile
multipleCsimSupport(18) -- Multiple CSIM applications are supported within the same Profile
}
-- Definition of DeviceInfo
DeviceInfo ::= SEQUENCE {
tac Octet8,
deviceCapabilities DeviceCapabilities,
imei Octet8 OPTIONAL
}
DeviceCapabilities ::= SEQUENCE { -- Highest fully supported release for each definition
-- The device SHALL set all the capabilities it supports
gsmSupportedRelease VersionType OPTIONAL,
utranSupportedRelease VersionType OPTIONAL,
cdma2000onexSupportedRelease VersionType OPTIONAL,
cdma2000hrpdSupportedRelease VersionType OPTIONAL,
cdma2000ehrpdSupportedRelease VersionType OPTIONAL,
eutranSupportedRelease VersionType OPTIONAL,
contactlessSupportedRelease VersionType OPTIONAL,
rspCrlSupportedVersion VersionType OPTIONAL,
rspRpmSupportedVersion VersionType OPTIONAL
}
ProfileInfoListRequest ::= [45] SEQUENCE { -- Tag 'BF2D'
searchCriteria [0] CHOICE {
isdpAid [APPLICATION 15] OctetTo16, -- AID of the ISD-P, tag '4F'
iccid Iccid, -- ICCID, tag '5A'
profileClass [21] ProfileClass -- Tag '95'
} OPTIONAL,
tagList [APPLICATION 28] OCTET STRING OPTIONAL -- tag '5C'
}
-- Definition of ProfileInfoList
ProfileInfoListResponse ::= [45] CHOICE { -- Tag 'BF2D'
profileInfoListOk SEQUENCE OF ProfileInfo,
profileInfoListError ProfileInfoListError
}
ProfileInfo ::= [PRIVATE 3] SEQUENCE { -- Tag 'E3'
iccid Iccid OPTIONAL,
isdpAid [APPLICATION 15] OctetTo16 OPTIONAL, -- AID of the ISD-P containing the Profile, tag '4F'
profileState [112] ProfileState OPTIONAL, -- Tag '9F70'
profileNickname [16] UTF8String (SIZE(0..64)) OPTIONAL, -- Tag '90'
serviceProviderName [17] UTF8String (SIZE(0..32)) OPTIONAL, -- Tag '91'
profileName [18] UTF8String (SIZE(0..64)) OPTIONAL, -- Tag '92'
iconType [19] IconType OPTIONAL, -- Tag '93'
icon [20] OCTET STRING (SIZE(0..1024)) OPTIONAL, -- Tag '94', see condition in ES10c:GetProfilesInfo
profileClass [21] ProfileClass DEFAULT operational, -- Tag '95'
notificationConfigurationInfo [22] SEQUENCE OF NotificationConfigurationInformation OPTIONAL, -- Tag 'B6'
profileOwner [23] OperatorID OPTIONAL, -- Tag 'B7'
dpProprietaryData [24] DpProprietaryData OPTIONAL, -- Tag 'B8'
profilePolicyRules [25] PprIds OPTIONAL -- Tag '99'
}
PprIds ::= BIT STRING {-- Definition of Profile Policy Rules identifiers
pprUpdateControl(0), -- defines how to update PPRs via ES6
ppr1(1), -- Indicator for PPR1 'Disabling of this Profile is not allowed'
ppr2(2), -- Indicator for PPR2 'Deletion of this Profile is not allowed'
ppr3(3) -- Indicator for PPR3 'Deletion of this Profile is required upon its successful disabling'
}
OperatorID ::= SEQUENCE {
mccMnc OCTET STRING (SIZE(3)), -- MCC and MNC coded as defined in 3GPP TS 24.008 [32]
gid1 OCTET STRING OPTIONAL, -- referring to content of EF GID1 (file identifier '6F3E') as defined in 3GPP TS 31.102 [54]
gid2 OCTET STRING OPTIONAL -- referring to content of EF GID2 (file identifier '6F3F') as defined in 3GPP TS 31.102 [54]
}
ProfileInfoListError ::= INTEGER {incorrectInputValues(1), undefinedError(127)}
-- Definition of StoreMetadata request
StoreMetadataRequest ::= [37] SEQUENCE { -- Tag 'BF25'
iccid Iccid,
serviceProviderName [17] UTF8String (SIZE(0..32)), -- Tag '91'
profileName [18] UTF8String (SIZE(0..64)), -- Tag '92' (corresponds to 'Short Description' defined in SGP.21 [2])
iconType [19] IconType OPTIONAL, -- Tag '93' (JPG or PNG)
icon [20] OCTET STRING (SIZE(0..1024)) OPTIONAL, -- Tag '94'(Data of the icon. Size 64 x 64 pixel. This field SHALL only be present if iconType is present)
profileClass [21] ProfileClass OPTIONAL, -- Tag '95' (default if absent: 'operational')
notificationConfigurationInfo [22] SEQUENCE OF NotificationConfigurationInformation OPTIONAL,
profileOwner [23] OperatorID OPTIONAL, -- Tag 'B7'
profilePolicyRules [25] PprIds OPTIONAL -- Tag '99'
}
NotificationEvent ::= BIT STRING {
notificationInstall (0),
notificationEnable(1),
notificationDisable(2),
notificationDelete(3)
}
NotificationConfigurationInformation ::= SEQUENCE {
profileManagementOperation NotificationEvent,
notificationAddress UTF8String -- FQDN to forward the notification
}
IconType ::= INTEGER {jpg(0), png(1)}
ProfileState ::= INTEGER {disabled(0), enabled(1)}
ProfileClass ::= INTEGER {test(0), provisioning(1), operational(2)}
-- Definition of UpdateMetadata request
UpdateMetadataRequest ::= [42] SEQUENCE { -- Tag 'BF2A'
serviceProviderName [17] UTF8String (SIZE(0..32)) OPTIONAL, -- Tag '91'
profileName [18] UTF8String (SIZE(0..64)) OPTIONAL, -- Tag '92'
iconType [19] IconType OPTIONAL, -- Tag '93'
icon [20] OCTET STRING (SIZE(0..1024)) OPTIONAL, -- Tag '94'
profilePolicyRules [25] PprIds OPTIONAL -- Tag '99'
}
-- Definition of data objects for command PrepareDownload -------------------------
PrepareDownloadRequest ::= [33] SEQUENCE { -- Tag 'BF21'
smdpSigned2 SmdpSigned2, -- Signed information
smdpSignature2 [APPLICATION 55] OCTET STRING, -- DP_Sign1, tag '5F37'
hashCc Octet32 OPTIONAL, -- Hash of confirmation code
smdpCertificate Certificate -- CERT.DPpb.ECDSA
}
SmdpSigned2 ::= SEQUENCE {
transactionId [0] TransactionId, -- The TransactionID generated by the SM DP+
ccRequiredFlag BOOLEAN, --Indicates if the Confirmation Code is required
bppEuiccOtpk [APPLICATION 73] OCTET STRING OPTIONAL -- otPK.EUICC.ECKA already used for binding the BPP, tag '5F49'
}
PrepareDownloadResponse ::= [33] CHOICE { -- Tag 'BF21'
downloadResponseOk PrepareDownloadResponseOk,
downloadResponseError PrepareDownloadResponseError
}
PrepareDownloadResponseOk ::= SEQUENCE {
euiccSigned2 EUICCSigned2, -- Signed information
euiccSignature2 [APPLICATION 55] OCTET STRING -- tag '5F37'
}
EUICCSigned2 ::= SEQUENCE {
transactionId [0] TransactionId,
euiccOtpk [APPLICATION 73] OCTET STRING, -- otPK.EUICC.ECKA, tag '5F49'
hashCc Octet32 OPTIONAL -- Hash of confirmation code
}
PrepareDownloadResponseError ::= SEQUENCE {
transactionId [0] TransactionId,
downloadErrorCode DownloadErrorCode
}
DownloadErrorCode ::= INTEGER {invalidCertificate(1), invalidSignature(2), unsupportedCurve(3), noSessionContext(4), invalidTransactionId(5), undefinedError(127)}
-- Definition of data objects for command AuthenticateServer--------------------
AuthenticateServerRequest ::= [56] SEQUENCE { -- Tag 'BF38'
serverSigned1 ServerSigned1, -- Signed information
serverSignature1 [APPLICATION 55] OCTET STRING, -- tag ?5F37?
euiccCiPKIdToBeUsed SubjectKeyIdentifier, -- CI Public Key Identifier to be used
serverCertificate Certificate, -- RSP Server Certificate CERT.XXauth.ECDSA
ctxParams1 CtxParams1
}
ServerSigned1 ::= SEQUENCE {
transactionId [0] TransactionId, -- The Transaction ID generated by the RSP Server
euiccChallenge [1] Octet16, -- The eUICC Challenge
serverAddress [3] UTF8String, -- The RSP Server address
serverChallenge [4] Octet16 -- The RSP Server Challenge
}
CtxParams1 ::= CHOICE {
ctxParamsForCommonAuthentication CtxParamsForCommonAuthentication -- New contextual data objects may be defined for extensibility
}
CtxParamsForCommonAuthentication ::= SEQUENCE {
matchingId UTF8String OPTIONAL,-- The MatchingId could be the Activation code token or EventID or empty
deviceInfo DeviceInfo -- The Device information
}
AuthenticateServerResponse ::= [56] CHOICE { -- Tag 'BF38'
authenticateResponseOk AuthenticateResponseOk,
authenticateResponseError AuthenticateResponseError
}
AuthenticateResponseOk ::= SEQUENCE {
euiccSigned1 EuiccSigned1, -- Signed information
euiccSignature1 [APPLICATION 55] OCTET STRING, --EUICC_Sign1, tag 5F37
euiccCertificate Certificate, -- eUICC Certificate (CERT.EUICC.ECDSA) signed by the EUM
eumCertificate Certificate -- EUM Certificate (CERT.EUM.ECDSA) signed by the requested CI
}
EuiccSigned1 ::= SEQUENCE {
transactionId [0] TransactionId,
serverAddress [3] UTF8String,
serverChallenge [4] Octet16, -- The RSP Server Challenge
euiccInfo2 [34] EUICCInfo2,
ctxParams1 CtxParams1
}
AuthenticateResponseError ::= SEQUENCE {
transactionId [0] TransactionId,
authenticateErrorCode AuthenticateErrorCode
}
AuthenticateErrorCode ::= INTEGER {invalidCertificate(1), invalidSignature(2), unsupportedCurve(3), noSessionContext(4), invalidOid(5), euiccChallengeMismatch(6), ciPKUnknown(7), undefinedError(127)}
-- Definition of Cancel Session------------------------------
CancelSessionRequest ::= [65] SEQUENCE { -- Tag 'BF41'
transactionId TransactionId, -- The TransactionID generated by the RSP Server
reason CancelSessionReason
}
CancelSessionReason ::= INTEGER {endUserRejection(0), postponed(1), timeout(2), pprNotAllowed(3)}
CancelSessionResponse ::= [65] CHOICE { -- Tag 'BF41'
cancelSessionResponseOk CancelSessionResponseOk,
cancelSessionResponseError INTEGER {invalidTransactionId(5), undefinedError(127)}
}
CancelSessionResponseOk ::= SEQUENCE {
euiccCancelSessionSigned EuiccCancelSessionSigned, -- Signed information
euiccCancelSessionSignature [APPLICATION 55] OCTET STRING -- tag '5F37
}
EuiccCancelSessionSigned ::= SEQUENCE {
transactionId TransactionId,
smdpOid OBJECT IDENTIFIER, -- SM-DP+ OID as contained in CERT.DPauth.ECDSA
reason CancelSessionReason
}
-- asn1c caused some bug when process nested id, so workaround here
BoundProfilePackageTLV87 ::= [7] OCTET STRING
BoundProfilePackageTLV88 ::= [8] OCTET STRING
BoundProfilePackageTLV86 ::= [6] OCTET STRING
SeqBoundProfilePackageTLV87 ::= [0] SEQUENCE OF BoundProfilePackageTLV87
SeqBoundProfilePackageTLV88 ::= [1] SEQUENCE OF BoundProfilePackageTLV88
SeqSecondBoundProfilePackageTLV87 ::= [2] SEQUENCE OF BoundProfilePackageTLV87
SeqBoundProfilePackageTLV86 ::= [3] SEQUENCE OF BoundProfilePackageTLV86
-- Definition of Bound Profile Package --------------------------
BoundProfilePackage ::= [54] SEQUENCE { -- Tag 'BF36'
initialiseSecureChannelRequest [35] InitialiseSecureChannelRequest, -- Tag 'BF23'
firstSequenceOf87 SeqBoundProfilePackageTLV87, -- sequence of '87' TLVs
sequenceOf88 SeqBoundProfilePackageTLV88, -- sequence of '88' TLVs
secondSequenceOf87 SeqSecondBoundProfilePackageTLV87 OPTIONAL, -- sequence of '87' TLVs
sequenceOf86 SeqBoundProfilePackageTLV86 -- sequence of '86' TLVs
}
-- Definition of Get eUICC Challenge --------------------------
GetEuiccChallengeRequest ::= [46] SEQUENCE { -- Tag 'BF2E'
}
GetEuiccChallengeResponse ::= [46] SEQUENCE { -- Tag 'BF2E'
euiccChallenge Octet16 -- random eUICC challenge
}
-- Definition of Profile Installation Resulceipt
ProfileInstallationResult ::= [55] SEQUENCE { -- Tag 'BF37'
profileInstallationResultData [39] ProfileInstallationResultData,
euiccSignPIR EuiccSignPIR
}
ProfileInstallationResultData ::= [39] SEQUENCE { -- Tag 'BF27'
transactionId[0] TransactionId, -- The TransactionID generated by the SM-DP+
notificationMetadata[47] NotificationMetadata,
smdpOid OBJECT IDENTIFIER OPTIONAL, -- SM-DP+ OID (same value as in CERT.DPpb.ECDSA)
finalResult [2] CHOICE {
successResult SuccessResult,
errorResult ErrorResult
}
}
EuiccSignPIR ::= [APPLICATION 55] OCTET STRING -- Tag '5F37', eUICC?s signature
SuccessResult ::= SEQUENCE {
aid [APPLICATION 15] OCTET STRING (SIZE (5..16)), -- AID of ISD-P
simaResponse OCTET STRING -- contains (multiple) 'EUICCResponse' as defined in [5]
}
ErrorResult ::= SEQUENCE {
bppCommandId BppCommandId,
errorReason ErrorReason,
simaResponse OCTET STRING OPTIONAL -- contains (multiple) 'EUICCResponse' as defined in [5]
}
BppCommandId ::= INTEGER {initialiseSecureChannel(0), configureISDP(1), storeMetadata(2), storeMetadata2(3), replaceSessionKeys(4), loadProfileElements(5)}
ErrorReason ::= INTEGER {
incorrectInputValues(1),
invalidSignature(2),
invalidTransactionId(3),
unsupportedCrtValues(4),
unsupportedRemoteOperationType(5),
unsupportedProfileClass(6),
scp03tStructureError(7),
scp03tSecurityError(8),
installFailedDueToIccidAlreadyExistsOnEuicc(9), installFailedDueToInsufficientMemoryForProfile(10),
installFailedDueToInterruption(11),
installFailedDueToPEProcessingError (12),
installFailedDueToIccidMismatch(13),
testProfileInstallFailedDueToInvalidNaaKey(14),
pprNotAllowed(15),
installFailedDueToUnknownError(127)
}
ListNotificationRequest ::= [40] SEQUENCE { -- Tag 'BF28'
profileManagementOperation [1] NotificationEvent OPTIONAL
}
ListNotificationResponse ::= [40] CHOICE { -- Tag 'BF28'
notificationMetadataList SEQUENCE OF NotificationMetadata,
listNotificationsResultError INTEGER {undefinedError(127)}
}
NotificationMetadata ::= [47] SEQUENCE { -- Tag 'BF2F'
seqNumber [0] INTEGER,
profileManagementOperation [1] NotificationEvent, --Only one bit set to 1
notificationAddress UTF8String, -- FQDN to forward the notification
iccid Iccid OPTIONAL
}
-- Definition of Profile Nickname Information
SetNicknameRequest ::= [41] SEQUENCE { -- Tag 'BF29'
iccid Iccid,
profileNickname [16] UTF8String (SIZE(0..64))
}
SetNicknameResponse ::= [41] SEQUENCE { -- Tag 'BF29'
setNicknameResult INTEGER {ok(0), iccidNotFound (1), undefinedError(127)}
}
id-rsp-cert-objects OBJECT IDENTIFIER ::= { id-rsp cert-objects(2)}
id-rspExt OBJECT IDENTIFIER ::= {id-rsp-cert-objects 0}
id-rspRole OBJECT IDENTIFIER ::= {id-rsp-cert-objects 1}
-- Definition of OIDs for role identification
id-rspRole-ci OBJECT IDENTIFIER ::= {id-rspRole 0}
id-rspRole-euicc OBJECT IDENTIFIER ::= {id-rspRole 1}
id-rspRole-eum OBJECT IDENTIFIER ::= {id-rspRole 2}
id-rspRole-dp-tls OBJECT IDENTIFIER ::= {id-rspRole 3}
id-rspRole-dp-auth OBJECT IDENTIFIER ::= {id-rspRole 4}
id-rspRole-dp-pb OBJECT IDENTIFIER ::= {id-rspRole 5}
id-rspRole-ds-tls OBJECT IDENTIFIER ::= {id-rspRole 6}
id-rspRole-ds-auth OBJECT IDENTIFIER ::= {id-rspRole 7}
--Definition of data objects for InitialiseSecureChannel Request
InitialiseSecureChannelRequest ::= [35] SEQUENCE { -- Tag 'BF23'
remoteOpId RemoteOpId, -- Remote Operation Type Identifier (value SHALL be set to installBoundProfilePackage)
transactionId [0] TransactionId, -- The TransactionID generated by the SM-DP+
controlRefTemplate[6] IMPLICIT ControlRefTemplate, -- Control Reference Template (Key Agreement). Current specification considers a subset of CRT specified in GlobalPlatform Card Specification [8], section 6.4.2.3 for the Mutual Authentication Data Field
smdpOtpk [APPLICATION 73] OCTET STRING, ---otPK.DP.ECKA as specified in GlobalPlatform Card Specification [8] section 6.4.2.3 for ePK.OCE.ECKA, tag '5F49'
smdpSign [APPLICATION 55] OCTET STRING -- SM-DP's signature, tag '5F37'
}
ControlRefTemplate ::= SEQUENCE {
keyType[0] Octet1, -- Key type according to GlobalPlatform Card Specification [8] Table 11-16, AES= '88', Tag '80'
keyLen[1] Octet1, --Key length in number of bytes. For current specification key length SHALL by 0x10 bytes, Tag '81'
hostId[4] OctetTo16 -- Host ID value , Tag '84'
}
--Definition of data objects for ConfigureISDPRequest
ConfigureISDPRequest ::= [36] SEQUENCE { -- Tag 'BF24'
dpProprietaryData [24] DpProprietaryData OPTIONAL -- Tag 'B8'
}
DpProprietaryData ::= SEQUENCE { -- maximum size including tag and length field: 128 bytes
dpOid OBJECT IDENTIFIER -- OID in the tree of the SM-DP+ that created the Profile
-- additional data objects defined by the SM-DP+ MAY follow
}
-- Definition of request message for command ReplaceSessionKeys
ReplaceSessionKeysRequest ::= [38] SEQUENCE { -- tag 'BF26'
/*The new initial MAC chaining value*/
initialMacChainingValue OCTET STRING,
/*New session key value for encryption/decryption (PPK-ENC)*/
ppkEnc OCTET STRING,
/*New session key value of the session key C-MAC computation/verification (PPK-MAC)*/
ppkCmac OCTET STRING
}
-- Definition of data objects for RetrieveNotificationsList
RetrieveNotificationsListRequest ::= [43] SEQUENCE { -- Tag 'BF2B'
searchCriteria CHOICE {
seqNumber [0] INTEGER,
profileManagementOperation [1] NotificationEvent
} OPTIONAL
}
RetrieveNotificationsListResponse ::= [43] CHOICE { -- Tag 'BF2B'
notificationList SEQUENCE OF PendingNotification,
notificationsListResultError INTEGER {noResultAvailable(1), undefinedError(127)}
}
PendingNotification ::= CHOICE {
profileInstallationResult [55] ProfileInstallationResult, -- tag 'BF37'
otherSignedNotification OtherSignedNotification
}
OtherSignedNotification ::= SEQUENCE {
tbsOtherNotification NotificationMetadata,
euiccNotificationSignature [APPLICATION 55] OCTET STRING, -- eUICC signature of tbsOtherNotification, Tag '5F37'
euiccCertificate Certificate, -- eUICC Certificate (CERT.EUICC.ECDSA) signed by the EUM
eumCertificate Certificate -- EUM Certificate (CERT.EUM.ECDSA) signed by the requested CI
}
-- Definition of notificationSent
NotificationSentRequest ::= [48] SEQUENCE { -- Tag 'BF30'
seqNumber [0] INTEGER
}
NotificationSentResponse ::= [48] SEQUENCE { -- Tag 'BF30'
deleteNotificationStatus INTEGER {ok(0), nothingToDelete(1), undefinedError(127)}
}
-- Definition of Enable Profile --------------------------
EnableProfileRequest ::= [49] SEQUENCE { -- Tag 'BF31'
profileIdentifier CHOICE {
isdpAid [APPLICATION 15] OctetTo16, -- AID, tag '4F'
iccid Iccid -- ICCID, tag '5A'
},
refreshFlag BOOLEAN -- indicating whether REFRESH is required
}
EnableProfileResponse ::= [49] SEQUENCE { -- Tag 'BF31'
enableResult INTEGER {ok(0), iccidOrAidNotFound (1), profileNotInDisabledState(2), disallowedByPolicy(3), wrongProfileReenabling(4), undefinedError(127)}
}
-- Definition of Disable Profile --------------------------
DisableProfileRequest ::= [50] SEQUENCE { -- Tag 'BF32'
profileIdentifier CHOICE {
isdpAid [APPLICATION 15] OctetTo16, -- AID, tag '4F'
iccid Iccid -- ICCID, tag '5A'
},
refreshFlag BOOLEAN -- indicating whether REFRESH is required
}
DisableProfileResponse ::= [50] SEQUENCE { -- Tag 'BF32'
disableResult INTEGER {ok(0), iccidOrAidNotFound (1), profileNotInEnabledState(2), disallowedByPolicy(3), undefinedError(127)}
}
-- Definition of Delete Profile --------------------------
DeleteProfileRequest ::= [51] CHOICE { -- Tag 'BF33'
isdpAid [APPLICATION 15] OctetTo16, -- AID, tag '4F'
iccid Iccid -- ICCID, tag '5A'
}
DeleteProfileResponse ::= [51] SEQUENCE { -- Tag 'BF33'
deleteResult INTEGER {ok(0), iccidOrAidNotFound (1), profileNotInDisabledState(2), disallowedByPolicy(3), undefinedError(127)}
}
-- Definition of Memory Reset --------------------------
EuiccMemoryResetRequest ::= [52] SEQUENCE { -- Tag 'BF34'
resetOptions [2] BIT STRING {
deleteOperationalProfiles(0),
deleteFieldLoadedTestProfiles(1),
resetDefaultSmdpAddress(2)}
}
EuiccMemoryResetResponse ::= [52] SEQUENCE { -- Tag 'BF34'
resetResult INTEGER {ok(0), nothingToDelete(1), undefinedError(127)}
}
-- Definition of Get EID --------------------------
GetEuiccDataRequest ::= [62] SEQUENCE { -- Tag 'BF3E'
tagList [APPLICATION 28] Octet1 -- tag '5C', the value SHALL be set to '5A'
}
GetEuiccDataResponse ::= [62] SEQUENCE { -- Tag 'BF3E'
eidValue [APPLICATION 26] Octet16 -- tag '5A'
}
-- Definition of Get Rat
GetRatRequest ::= [67] SEQUENCE { -- Tag ' BF43'
-- No input data
}
GetRatResponse ::= [67] SEQUENCE { -- Tag 'BF43'
rat RulesAuthorisationTable
}
RulesAuthorisationTable ::= SEQUENCE OF ProfilePolicyAuthorisationRule
ProfilePolicyAuthorisationRule ::= SEQUENCE {
pprIds PprIds,
allowedOperators SEQUENCE OF OperatorID,
pprFlags BIT STRING {consentRequired(0)}
}
-- Definition of data structure command for loading a CRL
LoadCRLRequest ::= [53] SEQUENCE { -- Tag 'BF35'
-- A CRL-A
crl CertificateList
}
-- Definition of data structure response for loading a CRL
LoadCRLResponse ::= [53] CHOICE { -- Tag 'BF35'
loadCRLResponseOk LoadCRLResponseOk,
loadCRLResponseError LoadCRLResponseError
}
LoadCRLResponseOk ::= SEQUENCE {
missingParts SEQUENCE OF SEQUENCE {
number INTEGER (0..MAX)
} OPTIONAL
}
LoadCRLResponseError ::= INTEGER {invalidSignature(1), invalidCRLFormat(2), notEnoughMemorySpace(3), verificationKeyNotFound(4), undefinedError(127)}
-- Definition of the extension for Certificate Expiration Date
id-rsp-expDate OBJECT IDENTIFIER ::= {id-rspExt 1}
ExpirationDate ::= Time
-- Definition of the extension id for total partial-CRL number
id-rsp-totalPartialCrlNumber OBJECT IDENTIFIER ::= {id-rspExt 2}
TotalPartialCrlNumber ::= INTEGER
-- Definition of the extension id for the partial-CRL number
id-rsp-partialCrlNumber OBJECT IDENTIFIER ::= {id-rspExt 3}
PartialCrlNumber ::= INTEGER
-- Definition for ES9+ ASN.1 Binding --------------------------
RemoteProfileProvisioningRequest ::= [2] CHOICE { -- Tag 'A2'
initiateAuthenticationRequest [57] InitiateAuthenticationRequest, -- Tag 'BF39'
authenticateClientRequest [59] AuthenticateClientRequest, -- Tag 'BF3B'
getBoundProfilePackageRequest [58] GetBoundProfilePackageRequest, -- Tag 'BF3A'
cancelSessionRequestEs9 [65] CancelSessionRequestEs9, -- Tag 'BF41'
handleNotification [61] HandleNotification -- tag 'BF3D'
}
RemoteProfileProvisioningResponse ::= [2] CHOICE { -- Tag 'A2'
initiateAuthenticationResponse [57] InitiateAuthenticationResponse, -- Tag 'BF39'
authenticateClientResponseEs9 [59] AuthenticateClientResponseEs9, -- Tag 'BF3B'
getBoundProfilePackageResponse [58] GetBoundProfilePackageResponse, -- Tag 'BF3A'
cancelSessionResponseEs9 [65] CancelSessionResponseEs9, -- Tag 'BF41'
authenticateClientResponseEs11 [64] AuthenticateClientResponseEs11 -- Tag 'BF40'
}
InitiateAuthenticationRequest ::= [57] SEQUENCE { -- Tag 'BF39'
euiccChallenge [1] Octet16, -- random eUICC challenge
smdpAddress [3] UTF8String,
euiccInfo1 EUICCInfo1
}
InitiateAuthenticationResponse ::= [57] CHOICE { -- Tag 'BF39'
initiateAuthenticationOk InitiateAuthenticationOkEs9,
initiateAuthenticationError INTEGER {
invalidDpAddress(1),
euiccVersionNotSupportedByDp(2),
ciPKNotSupported(3)
}
}
InitiateAuthenticationOkEs9 ::= SEQUENCE {
transactionId [0] TransactionId, -- The TransactionID generated by the SM-DP+
serverSigned1 ServerSigned1, -- Signed information
serverSignature1 [APPLICATION 55] OCTET STRING, -- Server_Sign1, tag '5F37'
euiccCiPKIdToBeUsed SubjectKeyIdentifier, -- The curve CI Public Key to be used as required by ES10b.AuthenticateServer
serverCertificate Certificate
}
AuthenticateClientRequest ::= [59] SEQUENCE { -- Tag 'BF3B'
transactionId [0] TransactionId,
authenticateServerResponse [56] AuthenticateServerResponse -- This is the response from ES10b.AuthenticateServer
}
AuthenticateClientResponseEs9 ::= [59] CHOICE { -- Tag 'BF3B'
authenticateClientOk AuthenticateClientOk,
authenticateClientError INTEGER {
eumCertificateInvalid(1),
eumCertificateExpired(2),
euiccCertificateInvalid(3),
euiccCertificateExpired(4),
euiccSignatureInvalid(5),
matchingIdRefused(6),
eidMismatch(7),
noEligibleProfile(8),
ciPKUnknown(9),
invalidTransactionId(10),
undefinedError(127)
}
}
AuthenticateClientOk ::= SEQUENCE {
transactionId [0] TransactionId,
profileMetaData [37] StoreMetadataRequest,
prepareDownloadRequest [33] PrepareDownloadRequest
}
GetBoundProfilePackageRequest ::= [58] SEQUENCE { -- Tag 'BF3A'
transactionId [0] TransactionId,
prepareDownloadResponse [33] PrepareDownloadResponse
}
GetBoundProfilePackageResponse ::= [58] CHOICE { -- Tag 'BF3A'
getBoundProfilePackageOk GetBoundProfilePackageOk,
getBoundProfilePackageError INTEGER {
euiccSignatureInvalid(1),
confirmationCodeMissing(2),
confirmationCodeRefused(3),
confirmationCodeRetriesExceeded(4),
invalidTransactionId(95),
undefinedError(127)
}
}
GetBoundProfilePackageOk ::= SEQUENCE {
transactionId [0] TransactionId,
boundProfilePackage [54] BoundProfilePackage
}
HandleNotification ::= [61] SEQUENCE { -- Tag 'BF3D'
pendingNotification PendingNotification
}
CancelSessionRequestEs9 ::= [65] SEQUENCE { -- Tag 'BF41'
transactionId TransactionId,
cancelSessionResponse CancelSessionResponse -- data structure defined for ES10b.CancelSession function
}
CancelSessionResponseEs9 ::= [65] CHOICE { -- Tag 'BF41'
cancelSessionOk CancelSessionOk,
cancelSessionError INTEGER {
invalidTransactionId(1),
euiccSignatureInvalid(2),
undefinedError(127)
}
}
CancelSessionOk ::= SEQUENCE { -- This function has no output data
}
EuiccConfiguredAddressesRequest ::= [60] SEQUENCE { -- Tag 'BF3C'
}
EuiccConfiguredAddressesResponse ::= [60] SEQUENCE { -- Tag 'BF3C'
defaultDpAddress UTF8String OPTIONAL, -- Default SM-DP+ address as an FQDN
rootDsAddress UTF8String -- Root SM-DS address as an FQDN
}
ISDRProprietaryApplicationTemplate ::= [PRIVATE 0] SEQUENCE { -- Tag 'E0'
svn [2] VersionType, -- GSMA SGP.22 version supported (SVN)
lpaeSupport BIT STRING {
lpaeUsingCat(0), -- LPA in the eUICC using Card Application Toolkit
lpaeUsingScws(1) -- LPA in the eUICC using Smartcard Web Server
} OPTIONAL
}
LpaeActivationRequest ::= [66] SEQUENCE { -- Tag 'BF42'
lpaeOption BIT STRING {
activateCatBasedLpae(0), -- LPAe with LUIe based on CAT
activateScwsBasedLpae(1) -- LPAe with LUIe based on SCWS
}
}
LpaeActivationResponse ::= [66] SEQUENCE { -- Tag 'BF42'
lpaeActivationResult INTEGER {ok(0), notSupported(1)}
}
SetDefaultDpAddressRequest ::= [63] SEQUENCE { -- Tag 'BF3F'
defaultDpAddress UTF8String -- Default SM-DP+ address as an FQDN
}
SetDefaultDpAddressResponse ::= [63] SEQUENCE { -- Tag 'BF3F'
setDefaultDpAddressResult INTEGER { ok (0), undefinedError (127)}
}
AuthenticateClientResponseEs11 ::= [64] CHOICE { -- Tag 'BF40'
authenticateClientOk AuthenticateClientOkEs11,
authenticateClientError INTEGER {
eumCertificateInvalid(1),
eumCertificateExpired(2),
euiccCertificateInvalid(3),
euiccCertificateExpired(4),
euiccSignatureInvalid(5),
eventIdUnknown(6),
invalidTransactionId(7),
undefinedError(127)
}
}
AuthenticateClientOkEs11 ::= SEQUENCE {
transactionId TransactionId,
eventEntries SEQUENCE OF EventEntries
}
EventEntries ::= SEQUENCE {
eventId UTF8String,
rspServerAddress UTF8String
}
END

3
cjson/CMakeLists.txt Normal file
View file

@ -0,0 +1,3 @@
include_directories(.)
aux_source_directory(. LIB_CJSON_SRCS)
add_library (cjson-static STATIC ${LIB_CJSON_SRCS})

3119
cjson/cJSON.c Normal file

File diff suppressed because it is too large Load diff

300
cjson/cJSON.h Normal file
View file

@ -0,0 +1,300 @@
/*
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef cJSON__h
#define cJSON__h
#ifdef __cplusplus
extern "C"
{
#endif
#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
#define __WINDOWS__
#endif
#ifdef __WINDOWS__
/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 3 define options:
CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols
CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default)
CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol
For *nix builds that support visibility attribute, you can define similar behavior by
setting default visibility to hidden by adding
-fvisibility=hidden (for gcc)
or
-xldscope=hidden (for sun cc)
to CFLAGS
then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does
*/
#define CJSON_CDECL __cdecl
#define CJSON_STDCALL __stdcall
/* export symbols by default, this is necessary for copy pasting the C and header file */
#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS)
#define CJSON_EXPORT_SYMBOLS
#endif
#if defined(CJSON_HIDE_SYMBOLS)
#define CJSON_PUBLIC(type) type CJSON_STDCALL
#elif defined(CJSON_EXPORT_SYMBOLS)
#define CJSON_PUBLIC(type) __declspec(dllexport) type CJSON_STDCALL
#elif defined(CJSON_IMPORT_SYMBOLS)
#define CJSON_PUBLIC(type) __declspec(dllimport) type CJSON_STDCALL
#endif
#else /* !__WINDOWS__ */
#define CJSON_CDECL
#define CJSON_STDCALL
#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY)
#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type
#else
#define CJSON_PUBLIC(type) type
#endif
#endif
/* project version */
#define CJSON_VERSION_MAJOR 1
#define CJSON_VERSION_MINOR 7
#define CJSON_VERSION_PATCH 16
#include <stddef.h>
/* cJSON Types: */
#define cJSON_Invalid (0)
#define cJSON_False (1 << 0)
#define cJSON_True (1 << 1)
#define cJSON_NULL (1 << 2)
#define cJSON_Number (1 << 3)
#define cJSON_String (1 << 4)
#define cJSON_Array (1 << 5)
#define cJSON_Object (1 << 6)
#define cJSON_Raw (1 << 7) /* raw json */
#define cJSON_IsReference 256
#define cJSON_StringIsConst 512
/* The cJSON structure: */
typedef struct cJSON
{
/* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *next;
struct cJSON *prev;
/* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
struct cJSON *child;
/* The type of the item, as above. */
int type;
/* The item's string, if type==cJSON_String and type == cJSON_Raw */
char *valuestring;
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
int valueint;
/* The item's number, if type==cJSON_Number */
double valuedouble;
/* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
char *string;
} cJSON;
typedef struct cJSON_Hooks
{
/* malloc/free are CDECL on Windows regardless of the default calling convention of the compiler, so ensure the hooks allow passing those functions directly. */
void *(CJSON_CDECL *malloc_fn)(size_t sz);
void (CJSON_CDECL *free_fn)(void *ptr);
} cJSON_Hooks;
typedef int cJSON_bool;
/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them.
* This is to prevent stack overflows. */
#ifndef CJSON_NESTING_LIMIT
#define CJSON_NESTING_LIMIT 1000
#endif
/* returns the version of cJSON as a string */
CJSON_PUBLIC(const char*) cJSON_Version(void);
/* Supply malloc, realloc and free functions to cJSON */
CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks);
/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */
CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value);
CJSON_PUBLIC(cJSON *) cJSON_ParseWithLength(const char *value, size_t buffer_length);
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */
CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated);
CJSON_PUBLIC(cJSON *) cJSON_ParseWithLengthOpts(const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated);
/* Render a cJSON entity to text for transfer/storage. */
CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. */
CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item);
/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt);
/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */
/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */
CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format);
/* Delete a cJSON entity and all subentities. */
CJSON_PUBLIC(void) cJSON_Delete(cJSON *item);
/* Returns the number of items in an array (or object). */
CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array);
/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */
CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index);
/* Get item "string" from object. Case insensitive. */
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string);
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string);
CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string);
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
/* Check item type and return its value */
CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item);
CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item);
/* These functions check the type of an item */
CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item);
CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item);
/* These calls create a cJSON item of the appropriate type. */
CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean);
CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num);
CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string);
/* raw json */
CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw);
CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void);
CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void);
/* Create a string where valuestring references a string so
* it will not be freed by cJSON_Delete */
CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string);
/* Create an object/array that only references it's elements so
* they will not be freed by cJSON_Delete */
CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child);
CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child);
/* These utilities create an Array of count items.
* The parameter count cannot be greater than the number of elements in the number array, otherwise array access will be out of bounds.*/
CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count);
CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count);
/* Append item to the specified array/object. */
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToArray(cJSON *array, cJSON *item);
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item);
/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object.
* WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before
* writing to `item->string` */
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item);
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item);
/* Remove/Detach items from Arrays/Objects. */
CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which);
CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string);
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string);
CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string);
CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string);
/* Update array items. */
CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement);
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem);
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem);
/* Duplicate a cJSON item */
CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse);
/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
* need to be released. With recurse!=0, it will duplicate any children connected to the item.
* The item->next and ->prev pointers are always zero on return from Duplicate. */
/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal.
* case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */
CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive);
/* Minify a strings, remove blank characters(such as ' ', '\t', '\r', '\n') from strings.
* The input pointer json cannot point to a read-only address area, such as a string constant,
* but should point to a readable and writable address area. */
CJSON_PUBLIC(void) cJSON_Minify(char *json);
/* Helper functions for creating and adding items to an object at the same time.
* They return the added item or NULL on failure. */
CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean);
CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number);
CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string);
CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw);
CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name);
CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name);
/* When assigning an integer value, it needs to be propagated to valuedouble too. */
#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number))
/* helper for the cJSON_SetNumberValue macro */
CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number);
#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number))
/* Change the valuestring of a cJSON_String object, only takes effect when type of object is cJSON_String */
CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring);
/* If the object is not a boolean type this does nothing and returns cJSON_Invalid else it returns the new type*/
#define cJSON_SetBoolValue(object, boolValue) ( \
(object != NULL && ((object)->type & (cJSON_False|cJSON_True))) ? \
(object)->type=((object)->type &(~(cJSON_False|cJSON_True)))|((boolValue)?cJSON_True:cJSON_False) : \
cJSON_Invalid\
)
/* Macro for iterating over an array or object */
#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next)
/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */
CJSON_PUBLIC(void *) cJSON_malloc(size_t size);
CJSON_PUBLIC(void) cJSON_free(void *object);
#ifdef __cplusplus
}
#endif
#endif

7
euicc/CMakeLists.txt Normal file
View file

@ -0,0 +1,7 @@
add_subdirectory(asn1c)
include_directories(asn1c)
include_directories(asn1c/asn1)
aux_source_directory(. LIB_EUICC_SRCS)
add_library (euicc STATIC ${LIB_EUICC_SRCS})
target_link_libraries(euicc euiccasn1)
target_link_libraries(euicc cjson-static)

View file

@ -0,0 +1,11 @@
include_directories(.)
include_directories(asn1)
aux_source_directory(asn1 LIB_EUICC_ASN1_SRCS)
add_library (euiccasn1 STATIC ${LIB_EUICC_ASN1_SRCS})
target_compile_definitions(euiccasn1 PRIVATE HAVE_CONFIG_H)
option(LINUX_MINGW32 "Build for windows on Linux" OFF)
if(LINUX_MINGW32)
add_subdirectory(mingw32)
target_link_libraries(euiccasn1 euiccasn1mingw32)
endif()

277
euicc/asn1c/asn1/ANY.c Normal file
View file

@ -0,0 +1,277 @@
/*
* Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <ANY.h>
#include <errno.h>
asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = {
sizeof(ANY_t),
offsetof(ANY_t, _asn_ctx),
ASN_OSUBV_ANY
};
asn_TYPE_operation_t asn_OP_ANY = {
OCTET_STRING_free,
OCTET_STRING_print,
OCTET_STRING_compare,
OCTET_STRING_decode_ber,
OCTET_STRING_encode_der,
OCTET_STRING_decode_xer_hex,
ANY_encode_xer,
#ifdef ASN_DISABLE_OER_SUPPORT
0,
0,
#else
0,
0,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0, 0,
#else
ANY_decode_uper,
ANY_encode_uper,
#endif /* ASN_DISABLE_PER_SUPPORT */
0, /* Random fill is not defined for ANY type */
0 /* Use generic outmost tag fetcher */
};
asn_TYPE_descriptor_t asn_DEF_ANY = {
"ANY",
"ANY",
&asn_OP_ANY,
0, 0, 0, 0,
{ 0, 0, asn_generic_no_constraint }, /* No constraints */
0, 0, /* No members */
&asn_SPC_ANY_specs,
};
#undef RETURN
#define RETURN(_code) \
do { \
asn_dec_rval_t tmprval; \
tmprval.code = _code; \
tmprval.consumed = consumed_myself; \
return tmprval; \
} while(0)
asn_enc_rval_t
ANY_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
void *app_key) {
if(flags & XER_F_CANONICAL) {
/*
* Canonical XER-encoding of ANY type is not supported.
*/
ASN__ENCODE_FAILED;
}
/* Dump as binary */
return OCTET_STRING_encode_xer(td, sptr, ilevel, flags, cb, app_key);
}
struct _callback_arg {
uint8_t *buffer;
size_t offset;
size_t size;
};
static int ANY__consume_bytes(const void *buffer, size_t size, void *key);
int
ANY_fromType(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
struct _callback_arg arg;
asn_enc_rval_t erval;
if(!st || !td) {
errno = EINVAL;
return -1;
}
if(!sptr) {
if(st->buf) FREEMEM(st->buf);
st->size = 0;
return 0;
}
arg.offset = arg.size = 0;
arg.buffer = 0;
erval = der_encode(td, sptr, ANY__consume_bytes, &arg);
if(erval.encoded == -1) {
if(arg.buffer) FREEMEM(arg.buffer);
return -1;
}
assert((size_t)erval.encoded == arg.offset);
if(st->buf) FREEMEM(st->buf);
st->buf = arg.buffer;
st->size = arg.offset;
return 0;
}
ANY_t *
ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) {
ANY_t tmp;
ANY_t *st;
if(!td || !sptr) {
errno = EINVAL;
return 0;
}
memset(&tmp, 0, sizeof(tmp));
if(ANY_fromType(&tmp, td, sptr)) return 0;
st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
if(st) {
*st = tmp;
return st;
} else {
FREEMEM(tmp.buf);
return 0;
}
}
int
ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
asn_dec_rval_t rval;
void *newst = 0;
if(!st || !td || !struct_ptr) {
errno = EINVAL;
return -1;
}
if(st->buf == 0) {
/* Nothing to convert, make it empty. */
*struct_ptr = (void *)0;
return 0;
}
rval = ber_decode(0, td, (void **)&newst, st->buf, st->size);
if(rval.code == RC_OK) {
*struct_ptr = newst;
return 0;
} else {
/* Remove possibly partially decoded data. */
ASN_STRUCT_FREE(*td, newst);
return -1;
}
}
static int ANY__consume_bytes(const void *buffer, size_t size, void *key) {
struct _callback_arg *arg = (struct _callback_arg *)key;
if((arg->offset + size) >= arg->size) {
size_t nsize = (arg->size ? arg->size << 2 : 16) + size;
void *p = REALLOC(arg->buffer, nsize);
if(!p) return -1;
arg->buffer = (uint8_t *)p;
arg->size = nsize;
}
memcpy(arg->buffer + arg->offset, buffer, size);
arg->offset += size;
assert(arg->offset < arg->size);
return 0;
}
#ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t
ANY_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_ANY_specs;
size_t consumed_myself = 0;
int repeat;
ANY_t *st = (ANY_t *)*sptr;
(void)opt_codec_ctx;
(void)constraints;
/*
* Allocate the structure.
*/
if(!st) {
st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) RETURN(RC_FAIL);
}
ASN_DEBUG("PER Decoding ANY type");
st->size = 0;
do {
ssize_t raw_len;
ssize_t len_bytes;
ssize_t len_bits;
void *p;
int ret;
/* Get the PER length */
raw_len = uper_get_length(pd, -1, 0, &repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
repeat ? "repeat" : "once", td->name);
len_bytes = raw_len;
len_bits = len_bytes * 8;
p = REALLOC(st->buf, st->size + len_bytes + 1);
if(!p) RETURN(RC_FAIL);
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
if(ret < 0) RETURN(RC_WMORE);
consumed_myself += len_bits;
st->size += len_bytes;
} while(repeat);
st->buf[st->size] = 0; /* nul-terminate */
RETURN(RC_OK);
}
asn_enc_rval_t
ANY_encode_uper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, const void *sptr,
asn_per_outp_t *po) {
const ANY_t *st = (const ANY_t *)sptr;
asn_enc_rval_t er = {0, 0, 0};
const uint8_t *buf;
size_t size;
int ret;
(void)constraints;
if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
buf = st->buf;
size = st->size;
do {
int need_eom = 0;
ssize_t may_save = uper_put_length(po, size, &need_eom);
if(may_save < 0) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, buf, may_save * 8);
if(ret) ASN__ENCODE_FAILED;
buf += may_save;
size -= may_save;
assert(!(may_save & 0x07) || !size);
if(need_eom && uper_put_length(po, 0, 0))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size);
ASN__ENCODED_OK(er);
}
#endif /* ASN_DISABLE_PER_SUPPORT */

60
euicc/asn1c/asn1/ANY.h Normal file
View file

@ -0,0 +1,60 @@
/*-
* Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef ASN_TYPE_ANY_H
#define ASN_TYPE_ANY_H
#include <OCTET_STRING.h> /* Implemented via OCTET STRING type */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ANY {
uint8_t *buf; /* BER-encoded ANY contents */
int size; /* Size of the above buffer */
asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
} ANY_t;
extern asn_TYPE_descriptor_t asn_DEF_ANY;
extern asn_TYPE_operation_t asn_OP_ANY;
extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;
asn_struct_free_f ANY_free;
asn_struct_print_f ANY_print;
ber_type_decoder_f ANY_decode_ber;
der_type_encoder_f ANY_encode_der;
xer_type_encoder_f ANY_encode_xer;
per_type_decoder_f ANY_decode_uper;
per_type_encoder_f ANY_encode_uper;
#define ANY_free OCTET_STRING_free
#define ANY_print OCTET_STRING_print
#define ANY_compare OCTET_STRING_compare
#define ANY_constraint asn_generic_no_constraint
#define ANY_decode_ber OCTET_STRING_decode_ber
#define ANY_encode_der OCTET_STRING_encode_der
#define ANY_decode_xer OCTET_STRING_decode_xer_hex
/******************************
* Handy conversion routines. *
******************************/
/* Convert another ASN.1 type into the ANY. This implies DER encoding. */
int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
/* Convert the contents of the ANY type into the specified type. */
int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \
&asn_DEF_ANY, (buf), (size))
#ifdef __cplusplus
}
#endif
#endif /* ASN_TYPE_ANY_H */

View file

@ -0,0 +1,68 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AccessDescription.h"
asn_TYPE_member_t asn_MBR_AccessDescription_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AccessDescription, accessMethod),
(ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
0,
&asn_DEF_OBJECT_IDENTIFIER,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"accessMethod"
},
{ ATF_NOFLAGS, 0, offsetof(struct AccessDescription, accessLocation),
-1 /* Ambiguous tag (CHOICE?) */,
0,
&asn_DEF_GeneralName,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"accessLocation"
},
};
static const ber_tlv_tag_t asn_DEF_AccessDescription_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AccessDescription_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 0, 0, 0 }, /* accessMethod */
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* otherName */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* rfc822Name */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* dNSName */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 }, /* x400Address */
{ (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 1, 0, 0 }, /* directoryName */
{ (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 1, 0, 0 }, /* ediPartyName */
{ (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 1, 0, 0 }, /* uniformResourceIdentifier */
{ (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 1, 0, 0 }, /* iPAddress */
{ (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 1, 0, 0 } /* registeredID */
};
asn_SEQUENCE_specifics_t asn_SPC_AccessDescription_specs_1 = {
sizeof(struct AccessDescription),
offsetof(struct AccessDescription, _asn_ctx),
asn_MAP_AccessDescription_tag2el_1,
10, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AccessDescription = {
"AccessDescription",
"AccessDescription",
&asn_OP_SEQUENCE,
asn_DEF_AccessDescription_tags_1,
sizeof(asn_DEF_AccessDescription_tags_1)
/sizeof(asn_DEF_AccessDescription_tags_1[0]), /* 1 */
asn_DEF_AccessDescription_tags_1, /* Same as above */
sizeof(asn_DEF_AccessDescription_tags_1)
/sizeof(asn_DEF_AccessDescription_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AccessDescription_1,
2, /* Elements count */
&asn_SPC_AccessDescription_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,42 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AccessDescription_H_
#define _AccessDescription_H_
#include "asn_application.h"
/* Including external dependencies */
#include "OBJECT_IDENTIFIER.h"
#include "GeneralName.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AccessDescription */
typedef struct AccessDescription {
OBJECT_IDENTIFIER_t accessMethod;
GeneralName_t accessLocation;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AccessDescription_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AccessDescription;
extern asn_SEQUENCE_specifics_t asn_SPC_AccessDescription_specs_1;
extern asn_TYPE_member_t asn_MBR_AccessDescription_1[2];
#ifdef __cplusplus
}
#endif
#endif /* _AccessDescription_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,218 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AdministrationDomainName.h"
static const int permitted_alphabet_table_2[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* . */
2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
};
static const int permitted_alphabet_code2value_2[11] = {
32,48,49,50,51,52,53,54,55,56,57,};
static int check_permitted_alphabet_2(const void *sptr) {
const int *table = permitted_alphabet_table_2;
/* The underlying type is NumericString */
const NumericString_t *st = (const NumericString_t *)sptr;
const uint8_t *ch = st->buf;
const uint8_t *end = ch + st->size;
for(; ch < end; ch++) {
uint8_t cv = *ch;
if(!table[cv]) return -1;
}
return 0;
}
static const int permitted_alphabet_table_3[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9, /* . '() +,-./ */
10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22, /* 0123456789: = ? */
0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37, /* ABCDEFGHIJKLMNO */
38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, /* abcdefghijklmno */
64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
};
static const int permitted_alphabet_code2value_3[74] = {
32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
113,114,115,116,117,118,119,120,121,122,};
static int check_permitted_alphabet_3(const void *sptr) {
const int *table = permitted_alphabet_table_3;
/* The underlying type is PrintableString */
const PrintableString_t *st = (const PrintableString_t *)sptr;
const uint8_t *ch = st->buf;
const uint8_t *end = ch + st->size;
for(; ch < end; ch++) {
uint8_t cv = *ch;
if(!table[cv]) return -1;
}
return 0;
}
static int
memb_numeric_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const NumericString_t *st = (const NumericString_t *)sptr;
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
size = st->size;
if((size <= 16)
&& !check_permitted_alphabet_2(st)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int asn_PER_MAP_numeric_2_v2c(unsigned int value) {
if(value >= sizeof(permitted_alphabet_table_2)/sizeof(permitted_alphabet_table_2[0]))
return -1;
return permitted_alphabet_table_2[value] - 1;
}
static int asn_PER_MAP_numeric_2_c2v(unsigned int code) {
if(code >= sizeof(permitted_alphabet_code2value_2)/sizeof(permitted_alphabet_code2value_2[0]))
return -1;
return permitted_alphabet_code2value_2[code];
}
static int
memb_printable_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const PrintableString_t *st = (const PrintableString_t *)sptr;
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
size = st->size;
if((size <= 16)
&& !check_permitted_alphabet_3(st)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int asn_PER_MAP_printable_3_v2c(unsigned int value) {
if(value >= sizeof(permitted_alphabet_table_3)/sizeof(permitted_alphabet_table_3[0]))
return -1;
return permitted_alphabet_table_3[value] - 1;
}
static int asn_PER_MAP_printable_3_c2v(unsigned int code) {
if(code >= sizeof(permitted_alphabet_code2value_3)/sizeof(permitted_alphabet_code2value_3[0]))
return -1;
return permitted_alphabet_code2value_3[code];
}
static asn_oer_constraints_t asn_OER_memb_numeric_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(0..16)) */};
static asn_per_constraints_t asn_PER_memb_numeric_constr_2 CC_NOTUSED = {
{ APC_CONSTRAINED, 4, 4, 32, 57 } /* (32..57) */,
{ APC_CONSTRAINED, 5, 5, 0, 16 } /* (SIZE(0..16)) */,
asn_PER_MAP_numeric_2_v2c, /* Value to PER code map */
asn_PER_MAP_numeric_2_c2v /* PER code to value map */
};
static asn_oer_constraints_t asn_OER_memb_printable_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(0..16)) */};
static asn_per_constraints_t asn_PER_memb_printable_constr_3 CC_NOTUSED = {
{ APC_CONSTRAINED, 7, 7, 32, 122 } /* (32..122) */,
{ APC_CONSTRAINED, 5, 5, 0, 16 } /* (SIZE(0..16)) */,
asn_PER_MAP_printable_3_v2c, /* Value to PER code map */
asn_PER_MAP_printable_3_c2v /* PER code to value map */
};
static asn_oer_constraints_t asn_OER_type_AdministrationDomainName_constr_1 CC_NOTUSED = {
{ 0, 0 },
-1};
asn_per_constraints_t asn_PER_type_AdministrationDomainName_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_AdministrationDomainName_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AdministrationDomainName, choice.numeric),
(ASN_TAG_CLASS_UNIVERSAL | (18 << 2)),
0,
&asn_DEF_NumericString,
0,
{ &asn_OER_memb_numeric_constr_2, &asn_PER_memb_numeric_constr_2, memb_numeric_constraint_1 },
0, 0, /* No default value */
"numeric"
},
{ ATF_NOFLAGS, 0, offsetof(struct AdministrationDomainName, choice.printable),
(ASN_TAG_CLASS_UNIVERSAL | (19 << 2)),
0,
&asn_DEF_PrintableString,
0,
{ &asn_OER_memb_printable_constr_3, &asn_PER_memb_printable_constr_3, memb_printable_constraint_1 },
0, 0, /* No default value */
"printable"
},
};
static const ber_tlv_tag_t asn_DEF_AdministrationDomainName_tags_1[] = {
(ASN_TAG_CLASS_APPLICATION | (2 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AdministrationDomainName_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (18 << 2)), 0, 0, 0 }, /* numeric */
{ (ASN_TAG_CLASS_UNIVERSAL | (19 << 2)), 1, 0, 0 } /* printable */
};
asn_CHOICE_specifics_t asn_SPC_AdministrationDomainName_specs_1 = {
sizeof(struct AdministrationDomainName),
offsetof(struct AdministrationDomainName, _asn_ctx),
offsetof(struct AdministrationDomainName, present),
sizeof(((struct AdministrationDomainName *)0)->present),
asn_MAP_AdministrationDomainName_tag2el_1,
2, /* Count of tags in the map */
0, 0,
-1 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_AdministrationDomainName = {
"AdministrationDomainName",
"AdministrationDomainName",
&asn_OP_CHOICE,
asn_DEF_AdministrationDomainName_tags_1,
sizeof(asn_DEF_AdministrationDomainName_tags_1)
/sizeof(asn_DEF_AdministrationDomainName_tags_1[0]), /* 1 */
asn_DEF_AdministrationDomainName_tags_1, /* Same as above */
sizeof(asn_DEF_AdministrationDomainName_tags_1)
/sizeof(asn_DEF_AdministrationDomainName_tags_1[0]), /* 1 */
{ &asn_OER_type_AdministrationDomainName_constr_1, &asn_PER_type_AdministrationDomainName_constr_1, CHOICE_constraint },
asn_MBR_AdministrationDomainName_1,
2, /* Elements count */
&asn_SPC_AdministrationDomainName_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,53 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AdministrationDomainName_H_
#define _AdministrationDomainName_H_
#include "asn_application.h"
/* Including external dependencies */
#include "NumericString.h"
#include "PrintableString.h"
#include "constr_CHOICE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum AdministrationDomainName_PR {
AdministrationDomainName_PR_NOTHING, /* No components present */
AdministrationDomainName_PR_numeric,
AdministrationDomainName_PR_printable
} AdministrationDomainName_PR;
/* AdministrationDomainName */
typedef struct AdministrationDomainName {
AdministrationDomainName_PR present;
union AdministrationDomainName_u {
NumericString_t numeric;
PrintableString_t printable;
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AdministrationDomainName_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AdministrationDomainName;
extern asn_CHOICE_specifics_t asn_SPC_AdministrationDomainName_specs_1;
extern asn_TYPE_member_t asn_MBR_AdministrationDomainName_1[2];
extern asn_per_constraints_t asn_PER_type_AdministrationDomainName_constr_1;
#ifdef __cplusplus
}
#endif
#endif /* _AdministrationDomainName_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,61 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AlgorithmIdentifier.h"
asn_TYPE_member_t asn_MBR_AlgorithmIdentifier_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AlgorithmIdentifier, algorithm),
(ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
0,
&asn_DEF_OBJECT_IDENTIFIER,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"algorithm"
},
{ ATF_ANY_TYPE | ATF_POINTER, 1, offsetof(struct AlgorithmIdentifier, parameters),
-1 /* Ambiguous tag (ANY?) */,
0,
&asn_DEF_ANY,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"parameters"
},
};
static const int asn_MAP_AlgorithmIdentifier_oms_1[] = { 1 };
static const ber_tlv_tag_t asn_DEF_AlgorithmIdentifier_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AlgorithmIdentifier_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 0, 0, 0 } /* algorithm */
};
asn_SEQUENCE_specifics_t asn_SPC_AlgorithmIdentifier_specs_1 = {
sizeof(struct AlgorithmIdentifier),
offsetof(struct AlgorithmIdentifier, _asn_ctx),
asn_MAP_AlgorithmIdentifier_tag2el_1,
1, /* Count of tags in the map */
asn_MAP_AlgorithmIdentifier_oms_1, /* Optional members */
1, 0, /* Root/Additions */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AlgorithmIdentifier = {
"AlgorithmIdentifier",
"AlgorithmIdentifier",
&asn_OP_SEQUENCE,
asn_DEF_AlgorithmIdentifier_tags_1,
sizeof(asn_DEF_AlgorithmIdentifier_tags_1)
/sizeof(asn_DEF_AlgorithmIdentifier_tags_1[0]), /* 1 */
asn_DEF_AlgorithmIdentifier_tags_1, /* Same as above */
sizeof(asn_DEF_AlgorithmIdentifier_tags_1)
/sizeof(asn_DEF_AlgorithmIdentifier_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AlgorithmIdentifier_1,
2, /* Elements count */
&asn_SPC_AlgorithmIdentifier_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,42 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AlgorithmIdentifier_H_
#define _AlgorithmIdentifier_H_
#include "asn_application.h"
/* Including external dependencies */
#include "OBJECT_IDENTIFIER.h"
#include "ANY.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AlgorithmIdentifier */
typedef struct AlgorithmIdentifier {
OBJECT_IDENTIFIER_t algorithm;
ANY_t *parameters /* OPTIONAL */;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AlgorithmIdentifier_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AlgorithmIdentifier;
extern asn_SEQUENCE_specifics_t asn_SPC_AlgorithmIdentifier_specs_1;
extern asn_TYPE_member_t asn_MBR_AlgorithmIdentifier_1[2];
#ifdef __cplusplus
}
#endif
#endif /* _AlgorithmIdentifier_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,60 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AnotherName.h"
asn_TYPE_member_t asn_MBR_AnotherName_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AnotherName, type_id),
(ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
0,
&asn_DEF_OBJECT_IDENTIFIER,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"type-id"
},
{ ATF_NOFLAGS, 0, offsetof(struct AnotherName, value),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+1, /* EXPLICIT tag at current level */
&asn_DEF_ANY,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"value"
},
};
static const ber_tlv_tag_t asn_DEF_AnotherName_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AnotherName_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 0, 0, 0 }, /* type-id */
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* value */
};
asn_SEQUENCE_specifics_t asn_SPC_AnotherName_specs_1 = {
sizeof(struct AnotherName),
offsetof(struct AnotherName, _asn_ctx),
asn_MAP_AnotherName_tag2el_1,
2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AnotherName = {
"AnotherName",
"AnotherName",
&asn_OP_SEQUENCE,
asn_DEF_AnotherName_tags_1,
sizeof(asn_DEF_AnotherName_tags_1)
/sizeof(asn_DEF_AnotherName_tags_1[0]), /* 1 */
asn_DEF_AnotherName_tags_1, /* Same as above */
sizeof(asn_DEF_AnotherName_tags_1)
/sizeof(asn_DEF_AnotherName_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AnotherName_1,
2, /* Elements count */
&asn_SPC_AnotherName_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,42 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AnotherName_H_
#define _AnotherName_H_
#include "asn_application.h"
/* Including external dependencies */
#include "OBJECT_IDENTIFIER.h"
#include "ANY.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AnotherName */
typedef struct AnotherName {
OBJECT_IDENTIFIER_t type_id;
ANY_t value;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AnotherName_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AnotherName;
extern asn_SEQUENCE_specifics_t asn_SPC_AnotherName_specs_1;
extern asn_TYPE_member_t asn_MBR_AnotherName_1[2];
#ifdef __cplusplus
}
#endif
#endif /* _AnotherName_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,96 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "Attribute.h"
static asn_TYPE_member_t asn_MBR_values_3[] = {
{ ATF_ANY_TYPE | ATF_POINTER, 0, 0,
-1 /* Ambiguous tag (ANY?) */,
0,
&asn_DEF_AttributeValue,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_values_tags_3[] = {
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_values_specs_3 = {
sizeof(struct Attribute__values),
offsetof(struct Attribute__values, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_values_3 = {
"values",
"values",
&asn_OP_SET_OF,
asn_DEF_values_tags_3,
sizeof(asn_DEF_values_tags_3)
/sizeof(asn_DEF_values_tags_3[0]), /* 1 */
asn_DEF_values_tags_3, /* Same as above */
sizeof(asn_DEF_values_tags_3)
/sizeof(asn_DEF_values_tags_3[0]), /* 1 */
{ 0, 0, SET_OF_constraint },
asn_MBR_values_3,
1, /* Single element */
&asn_SPC_values_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_Attribute_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Attribute, type),
(ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
0,
&asn_DEF_AttributeType,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"type"
},
{ ATF_NOFLAGS, 0, offsetof(struct Attribute, values),
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
0,
&asn_DEF_values_3,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"values"
},
};
static const ber_tlv_tag_t asn_DEF_Attribute_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_Attribute_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 0, 0, 0 }, /* type */
{ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* values */
};
asn_SEQUENCE_specifics_t asn_SPC_Attribute_specs_1 = {
sizeof(struct Attribute),
offsetof(struct Attribute, _asn_ctx),
asn_MAP_Attribute_tag2el_1,
2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_Attribute = {
"Attribute",
"Attribute",
&asn_OP_SEQUENCE,
asn_DEF_Attribute_tags_1,
sizeof(asn_DEF_Attribute_tags_1)
/sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
asn_DEF_Attribute_tags_1, /* Same as above */
sizeof(asn_DEF_Attribute_tags_1)
/sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_Attribute_1,
2, /* Elements count */
&asn_SPC_Attribute_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,49 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _Attribute_H_
#define _Attribute_H_
#include "asn_application.h"
/* Including external dependencies */
#include "AttributeType.h"
#include "AttributeValue.h"
#include "asn_SET_OF.h"
#include "constr_SET_OF.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Attribute */
typedef struct Attribute {
AttributeType_t type;
struct Attribute__values {
A_SET_OF(AttributeValue_t) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} values;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Attribute_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_Attribute;
extern asn_SEQUENCE_specifics_t asn_SPC_Attribute_specs_1;
extern asn_TYPE_member_t asn_MBR_Attribute_1[2];
#ifdef __cplusplus
}
#endif
#endif /* _Attribute_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,31 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AttributeType.h"
/*
* This type is implemented using OBJECT_IDENTIFIER,
* so here we adjust the DEF accordingly.
*/
static const ber_tlv_tag_t asn_DEF_AttributeType_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (6 << 2))
};
asn_TYPE_descriptor_t asn_DEF_AttributeType = {
"AttributeType",
"AttributeType",
&asn_OP_OBJECT_IDENTIFIER,
asn_DEF_AttributeType_tags_1,
sizeof(asn_DEF_AttributeType_tags_1)
/sizeof(asn_DEF_AttributeType_tags_1[0]), /* 1 */
asn_DEF_AttributeType_tags_1, /* Same as above */
sizeof(asn_DEF_AttributeType_tags_1)
/sizeof(asn_DEF_AttributeType_tags_1[0]), /* 1 */
{ 0, 0, OBJECT_IDENTIFIER_constraint },
0, 0, /* No members */
0 /* No specifics */
};

View file

@ -0,0 +1,43 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AttributeType_H_
#define _AttributeType_H_
#include "asn_application.h"
/* Including external dependencies */
#include "OBJECT_IDENTIFIER.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AttributeType */
typedef OBJECT_IDENTIFIER_t AttributeType_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AttributeType;
asn_struct_free_f AttributeType_free;
asn_struct_print_f AttributeType_print;
asn_constr_check_f AttributeType_constraint;
ber_type_decoder_f AttributeType_decode_ber;
der_type_encoder_f AttributeType_encode_der;
xer_type_decoder_f AttributeType_decode_xer;
xer_type_encoder_f AttributeType_encode_xer;
oer_type_decoder_f AttributeType_decode_oer;
oer_type_encoder_f AttributeType_encode_oer;
per_type_decoder_f AttributeType_decode_uper;
per_type_encoder_f AttributeType_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _AttributeType_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,59 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AttributeTypeAndValue.h"
asn_TYPE_member_t asn_MBR_AttributeTypeAndValue_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AttributeTypeAndValue, type),
(ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
0,
&asn_DEF_AttributeType,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"type"
},
{ ATF_ANY_TYPE | ATF_NOFLAGS, 0, offsetof(struct AttributeTypeAndValue, value),
-1 /* Ambiguous tag (ANY?) */,
0,
&asn_DEF_AttributeValue,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"value"
},
};
static const ber_tlv_tag_t asn_DEF_AttributeTypeAndValue_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AttributeTypeAndValue_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 0, 0, 0 } /* type */
};
asn_SEQUENCE_specifics_t asn_SPC_AttributeTypeAndValue_specs_1 = {
sizeof(struct AttributeTypeAndValue),
offsetof(struct AttributeTypeAndValue, _asn_ctx),
asn_MAP_AttributeTypeAndValue_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AttributeTypeAndValue = {
"AttributeTypeAndValue",
"AttributeTypeAndValue",
&asn_OP_SEQUENCE,
asn_DEF_AttributeTypeAndValue_tags_1,
sizeof(asn_DEF_AttributeTypeAndValue_tags_1)
/sizeof(asn_DEF_AttributeTypeAndValue_tags_1[0]), /* 1 */
asn_DEF_AttributeTypeAndValue_tags_1, /* Same as above */
sizeof(asn_DEF_AttributeTypeAndValue_tags_1)
/sizeof(asn_DEF_AttributeTypeAndValue_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AttributeTypeAndValue_1,
2, /* Elements count */
&asn_SPC_AttributeTypeAndValue_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,42 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AttributeTypeAndValue_H_
#define _AttributeTypeAndValue_H_
#include "asn_application.h"
/* Including external dependencies */
#include "AttributeType.h"
#include "AttributeValue.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AttributeTypeAndValue */
typedef struct AttributeTypeAndValue {
AttributeType_t type;
AttributeValue_t value;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AttributeTypeAndValue_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AttributeTypeAndValue;
extern asn_SEQUENCE_specifics_t asn_SPC_AttributeTypeAndValue_specs_1;
extern asn_TYPE_member_t asn_MBR_AttributeTypeAndValue_1[2];
#ifdef __cplusplus
}
#endif
#endif /* _AttributeTypeAndValue_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,26 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AttributeValue.h"
/*
* This type is implemented using ANY,
* so here we adjust the DEF accordingly.
*/
asn_TYPE_descriptor_t asn_DEF_AttributeValue = {
"AttributeValue",
"AttributeValue",
&asn_OP_ANY,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
{ 0, 0, ANY_constraint },
0, 0, /* No members */
&asn_SPC_ANY_specs /* Additional specs */
};

View file

@ -0,0 +1,43 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AttributeValue_H_
#define _AttributeValue_H_
#include "asn_application.h"
/* Including external dependencies */
#include "ANY.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AttributeValue */
typedef ANY_t AttributeValue_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AttributeValue;
asn_struct_free_f AttributeValue_free;
asn_struct_print_f AttributeValue_print;
asn_constr_check_f AttributeValue_constraint;
ber_type_decoder_f AttributeValue_decode_ber;
der_type_encoder_f AttributeValue_encode_der;
xer_type_decoder_f AttributeValue_decode_xer;
xer_type_encoder_f AttributeValue_encode_xer;
oer_type_decoder_f AttributeValue_decode_oer;
oer_type_encoder_f AttributeValue_encode_oer;
per_type_decoder_f AttributeValue_decode_uper;
per_type_encoder_f AttributeValue_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _AttributeValue_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,70 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateClientOk.h"
asn_TYPE_member_t asn_MBR_AuthenticateClientOk_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientOk, transactionId),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_TransactionId,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"transactionId"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientOk, profileMetaData),
(ASN_TAG_CLASS_CONTEXT | (37 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_StoreMetadataRequest,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"profileMetaData"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientOk, prepareDownloadRequest),
(ASN_TAG_CLASS_CONTEXT | (33 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_PrepareDownloadRequest,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"prepareDownloadRequest"
},
};
static const ber_tlv_tag_t asn_DEF_AuthenticateClientOk_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthenticateClientOk_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* transactionId */
{ (ASN_TAG_CLASS_CONTEXT | (33 << 2)), 2, 0, 0 }, /* prepareDownloadRequest */
{ (ASN_TAG_CLASS_CONTEXT | (37 << 2)), 1, 0, 0 } /* profileMetaData */
};
asn_SEQUENCE_specifics_t asn_SPC_AuthenticateClientOk_specs_1 = {
sizeof(struct AuthenticateClientOk),
offsetof(struct AuthenticateClientOk, _asn_ctx),
asn_MAP_AuthenticateClientOk_tag2el_1,
3, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
3, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateClientOk = {
"AuthenticateClientOk",
"AuthenticateClientOk",
&asn_OP_SEQUENCE,
asn_DEF_AuthenticateClientOk_tags_1,
sizeof(asn_DEF_AuthenticateClientOk_tags_1)
/sizeof(asn_DEF_AuthenticateClientOk_tags_1[0]), /* 1 */
asn_DEF_AuthenticateClientOk_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateClientOk_tags_1)
/sizeof(asn_DEF_AuthenticateClientOk_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AuthenticateClientOk_1,
3, /* Elements count */
&asn_SPC_AuthenticateClientOk_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,48 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateClientOk_H_
#define _AuthenticateClientOk_H_
#include "asn_application.h"
/* Including external dependencies */
#include "TransactionId.h"
#include "StoreMetadataRequest.h"
#include "PrepareDownloadRequest.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AuthenticateClientOk */
typedef struct AuthenticateClientOk {
TransactionId_t transactionId;
StoreMetadataRequest_t profileMetaData;
PrepareDownloadRequest_t prepareDownloadRequest;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthenticateClientOk_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateClientOk;
extern asn_SEQUENCE_specifics_t asn_SPC_AuthenticateClientOk_specs_1;
extern asn_TYPE_member_t asn_MBR_AuthenticateClientOk_1[3];
#ifdef __cplusplus
}
#endif
#endif /* _AuthenticateClientOk_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,97 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateClientOkEs11.h"
static asn_TYPE_member_t asn_MBR_eventEntries_3[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_EventEntries,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_eventEntries_tags_3[] = {
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_eventEntries_specs_3 = {
sizeof(struct AuthenticateClientOkEs11__eventEntries),
offsetof(struct AuthenticateClientOkEs11__eventEntries, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_eventEntries_3 = {
"eventEntries",
"eventEntries",
&asn_OP_SEQUENCE_OF,
asn_DEF_eventEntries_tags_3,
sizeof(asn_DEF_eventEntries_tags_3)
/sizeof(asn_DEF_eventEntries_tags_3[0]) - 1, /* 1 */
asn_DEF_eventEntries_tags_3, /* Same as above */
sizeof(asn_DEF_eventEntries_tags_3)
/sizeof(asn_DEF_eventEntries_tags_3[0]), /* 2 */
{ 0, 0, SEQUENCE_OF_constraint },
asn_MBR_eventEntries_3,
1, /* Single element */
&asn_SPC_eventEntries_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_AuthenticateClientOkEs11_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientOkEs11, transactionId),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_TransactionId,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"transactionId"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientOkEs11, eventEntries),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
0,
&asn_DEF_eventEntries_3,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"eventEntries"
},
};
static const ber_tlv_tag_t asn_DEF_AuthenticateClientOkEs11_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthenticateClientOkEs11_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* transactionId */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* eventEntries */
};
asn_SEQUENCE_specifics_t asn_SPC_AuthenticateClientOkEs11_specs_1 = {
sizeof(struct AuthenticateClientOkEs11),
offsetof(struct AuthenticateClientOkEs11, _asn_ctx),
asn_MAP_AuthenticateClientOkEs11_tag2el_1,
2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
2, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateClientOkEs11 = {
"AuthenticateClientOkEs11",
"AuthenticateClientOkEs11",
&asn_OP_SEQUENCE,
asn_DEF_AuthenticateClientOkEs11_tags_1,
sizeof(asn_DEF_AuthenticateClientOkEs11_tags_1)
/sizeof(asn_DEF_AuthenticateClientOkEs11_tags_1[0]), /* 1 */
asn_DEF_AuthenticateClientOkEs11_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateClientOkEs11_tags_1)
/sizeof(asn_DEF_AuthenticateClientOkEs11_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AuthenticateClientOkEs11_1,
2, /* Elements count */
&asn_SPC_AuthenticateClientOkEs11_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,58 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateClientOkEs11_H_
#define _AuthenticateClientOkEs11_H_
#include "asn_application.h"
/* Including external dependencies */
#include "TransactionId.h"
#include "asn_SEQUENCE_OF.h"
#include "constr_SEQUENCE_OF.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct EventEntries;
/* AuthenticateClientOkEs11 */
typedef struct AuthenticateClientOkEs11 {
TransactionId_t transactionId;
struct AuthenticateClientOkEs11__eventEntries {
A_SEQUENCE_OF(struct EventEntries) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} eventEntries;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthenticateClientOkEs11_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateClientOkEs11;
extern asn_SEQUENCE_specifics_t asn_SPC_AuthenticateClientOkEs11_specs_1;
extern asn_TYPE_member_t asn_MBR_AuthenticateClientOkEs11_1[2];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "EventEntries.h"
#endif /* _AuthenticateClientOkEs11_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,61 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateClientRequest.h"
asn_TYPE_member_t asn_MBR_AuthenticateClientRequest_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientRequest, transactionId),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_TransactionId,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"transactionId"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientRequest, authenticateServerResponse),
(ASN_TAG_CLASS_CONTEXT | (56 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_AuthenticateServerResponse,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authenticateServerResponse"
},
};
static const ber_tlv_tag_t asn_DEF_AuthenticateClientRequest_tags_1[] = {
(ASN_TAG_CLASS_CONTEXT | (59 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthenticateClientRequest_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* transactionId */
{ (ASN_TAG_CLASS_CONTEXT | (56 << 2)), 1, 0, 0 } /* authenticateServerResponse */
};
asn_SEQUENCE_specifics_t asn_SPC_AuthenticateClientRequest_specs_1 = {
sizeof(struct AuthenticateClientRequest),
offsetof(struct AuthenticateClientRequest, _asn_ctx),
asn_MAP_AuthenticateClientRequest_tag2el_1,
2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
2, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateClientRequest = {
"AuthenticateClientRequest",
"AuthenticateClientRequest",
&asn_OP_SEQUENCE,
asn_DEF_AuthenticateClientRequest_tags_1,
sizeof(asn_DEF_AuthenticateClientRequest_tags_1)
/sizeof(asn_DEF_AuthenticateClientRequest_tags_1[0]) - 1, /* 1 */
asn_DEF_AuthenticateClientRequest_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateClientRequest_tags_1)
/sizeof(asn_DEF_AuthenticateClientRequest_tags_1[0]), /* 2 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AuthenticateClientRequest_1,
2, /* Elements count */
&asn_SPC_AuthenticateClientRequest_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,46 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateClientRequest_H_
#define _AuthenticateClientRequest_H_
#include "asn_application.h"
/* Including external dependencies */
#include "TransactionId.h"
#include "AuthenticateServerResponse.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AuthenticateClientRequest */
typedef struct AuthenticateClientRequest {
TransactionId_t transactionId;
AuthenticateServerResponse_t authenticateServerResponse;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthenticateClientRequest_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateClientRequest;
extern asn_SEQUENCE_specifics_t asn_SPC_AuthenticateClientRequest_specs_1;
extern asn_TYPE_member_t asn_MBR_AuthenticateClientRequest_1[2];
#ifdef __cplusplus
}
#endif
#endif /* _AuthenticateClientRequest_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,70 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateClientResponseEs11.h"
static asn_oer_constraints_t asn_OER_type_AuthenticateClientResponseEs11_constr_1 CC_NOTUSED = {
{ 0, 0 },
-1};
asn_per_constraints_t asn_PER_type_AuthenticateClientResponseEs11_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_AuthenticateClientResponseEs11_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientResponseEs11, choice.authenticateClientOk),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_AuthenticateClientOkEs11,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authenticateClientOk"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientResponseEs11, choice.authenticateClientError),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_INTEGER,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authenticateClientError"
},
};
static const ber_tlv_tag_t asn_DEF_AuthenticateClientResponseEs11_tags_1[] = {
(ASN_TAG_CLASS_CONTEXT | (64 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthenticateClientResponseEs11_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* authenticateClientOk */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* authenticateClientError */
};
asn_CHOICE_specifics_t asn_SPC_AuthenticateClientResponseEs11_specs_1 = {
sizeof(struct AuthenticateClientResponseEs11),
offsetof(struct AuthenticateClientResponseEs11, _asn_ctx),
offsetof(struct AuthenticateClientResponseEs11, present),
sizeof(((struct AuthenticateClientResponseEs11 *)0)->present),
asn_MAP_AuthenticateClientResponseEs11_tag2el_1,
2, /* Count of tags in the map */
0, 0,
2 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateClientResponseEs11 = {
"AuthenticateClientResponseEs11",
"AuthenticateClientResponseEs11",
&asn_OP_CHOICE,
asn_DEF_AuthenticateClientResponseEs11_tags_1,
sizeof(asn_DEF_AuthenticateClientResponseEs11_tags_1)
/sizeof(asn_DEF_AuthenticateClientResponseEs11_tags_1[0]), /* 1 */
asn_DEF_AuthenticateClientResponseEs11_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateClientResponseEs11_tags_1)
/sizeof(asn_DEF_AuthenticateClientResponseEs11_tags_1[0]), /* 1 */
{ &asn_OER_type_AuthenticateClientResponseEs11_constr_1, &asn_PER_type_AuthenticateClientResponseEs11_constr_1, CHOICE_constraint },
asn_MBR_AuthenticateClientResponseEs11_1,
2, /* Elements count */
&asn_SPC_AuthenticateClientResponseEs11_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,69 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateClientResponseEs11_H_
#define _AuthenticateClientResponseEs11_H_
#include "asn_application.h"
/* Including external dependencies */
#include "AuthenticateClientOkEs11.h"
#include "INTEGER.h"
#include "constr_CHOICE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum AuthenticateClientResponseEs11_PR {
AuthenticateClientResponseEs11_PR_NOTHING, /* No components present */
AuthenticateClientResponseEs11_PR_authenticateClientOk,
AuthenticateClientResponseEs11_PR_authenticateClientError
/* Extensions may appear below */
} AuthenticateClientResponseEs11_PR;
typedef enum AuthenticateClientResponseEs11__authenticateClientError {
AuthenticateClientResponseEs11__authenticateClientError_eumCertificateInvalid = 1,
AuthenticateClientResponseEs11__authenticateClientError_eumCertificateExpired = 2,
AuthenticateClientResponseEs11__authenticateClientError_euiccCertificateInvalid = 3,
AuthenticateClientResponseEs11__authenticateClientError_euiccCertificateExpired = 4,
AuthenticateClientResponseEs11__authenticateClientError_euiccSignatureInvalid = 5,
AuthenticateClientResponseEs11__authenticateClientError_eventIdUnknown = 6,
AuthenticateClientResponseEs11__authenticateClientError_invalidTransactionId = 7,
AuthenticateClientResponseEs11__authenticateClientError_undefinedError = 127
} e_AuthenticateClientResponseEs11__authenticateClientError;
/* AuthenticateClientResponseEs11 */
typedef struct AuthenticateClientResponseEs11 {
AuthenticateClientResponseEs11_PR present;
union AuthenticateClientResponseEs11_u {
AuthenticateClientOkEs11_t authenticateClientOk;
INTEGER_t authenticateClientError;
/*
* This type is extensible,
* possible extensions are below.
*/
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthenticateClientResponseEs11_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateClientResponseEs11;
extern asn_CHOICE_specifics_t asn_SPC_AuthenticateClientResponseEs11_specs_1;
extern asn_TYPE_member_t asn_MBR_AuthenticateClientResponseEs11_1[2];
extern asn_per_constraints_t asn_PER_type_AuthenticateClientResponseEs11_constr_1;
#ifdef __cplusplus
}
#endif
#endif /* _AuthenticateClientResponseEs11_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,70 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateClientResponseEs9.h"
static asn_oer_constraints_t asn_OER_type_AuthenticateClientResponseEs9_constr_1 CC_NOTUSED = {
{ 0, 0 },
-1};
asn_per_constraints_t asn_PER_type_AuthenticateClientResponseEs9_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_AuthenticateClientResponseEs9_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientResponseEs9, choice.authenticateClientOk),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_AuthenticateClientOk,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authenticateClientOk"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateClientResponseEs9, choice.authenticateClientError),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_INTEGER,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authenticateClientError"
},
};
static const ber_tlv_tag_t asn_DEF_AuthenticateClientResponseEs9_tags_1[] = {
(ASN_TAG_CLASS_CONTEXT | (59 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthenticateClientResponseEs9_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* authenticateClientOk */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* authenticateClientError */
};
asn_CHOICE_specifics_t asn_SPC_AuthenticateClientResponseEs9_specs_1 = {
sizeof(struct AuthenticateClientResponseEs9),
offsetof(struct AuthenticateClientResponseEs9, _asn_ctx),
offsetof(struct AuthenticateClientResponseEs9, present),
sizeof(((struct AuthenticateClientResponseEs9 *)0)->present),
asn_MAP_AuthenticateClientResponseEs9_tag2el_1,
2, /* Count of tags in the map */
0, 0,
2 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateClientResponseEs9 = {
"AuthenticateClientResponseEs9",
"AuthenticateClientResponseEs9",
&asn_OP_CHOICE,
asn_DEF_AuthenticateClientResponseEs9_tags_1,
sizeof(asn_DEF_AuthenticateClientResponseEs9_tags_1)
/sizeof(asn_DEF_AuthenticateClientResponseEs9_tags_1[0]), /* 1 */
asn_DEF_AuthenticateClientResponseEs9_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateClientResponseEs9_tags_1)
/sizeof(asn_DEF_AuthenticateClientResponseEs9_tags_1[0]), /* 1 */
{ &asn_OER_type_AuthenticateClientResponseEs9_constr_1, &asn_PER_type_AuthenticateClientResponseEs9_constr_1, CHOICE_constraint },
asn_MBR_AuthenticateClientResponseEs9_1,
2, /* Elements count */
&asn_SPC_AuthenticateClientResponseEs9_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,72 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateClientResponseEs9_H_
#define _AuthenticateClientResponseEs9_H_
#include "asn_application.h"
/* Including external dependencies */
#include "AuthenticateClientOk.h"
#include "INTEGER.h"
#include "constr_CHOICE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum AuthenticateClientResponseEs9_PR {
AuthenticateClientResponseEs9_PR_NOTHING, /* No components present */
AuthenticateClientResponseEs9_PR_authenticateClientOk,
AuthenticateClientResponseEs9_PR_authenticateClientError
/* Extensions may appear below */
} AuthenticateClientResponseEs9_PR;
typedef enum AuthenticateClientResponseEs9__authenticateClientError {
AuthenticateClientResponseEs9__authenticateClientError_eumCertificateInvalid = 1,
AuthenticateClientResponseEs9__authenticateClientError_eumCertificateExpired = 2,
AuthenticateClientResponseEs9__authenticateClientError_euiccCertificateInvalid = 3,
AuthenticateClientResponseEs9__authenticateClientError_euiccCertificateExpired = 4,
AuthenticateClientResponseEs9__authenticateClientError_euiccSignatureInvalid = 5,
AuthenticateClientResponseEs9__authenticateClientError_matchingIdRefused = 6,
AuthenticateClientResponseEs9__authenticateClientError_eidMismatch = 7,
AuthenticateClientResponseEs9__authenticateClientError_noEligibleProfile = 8,
AuthenticateClientResponseEs9__authenticateClientError_ciPKUnknown = 9,
AuthenticateClientResponseEs9__authenticateClientError_invalidTransactionId = 10,
AuthenticateClientResponseEs9__authenticateClientError_undefinedError = 127
} e_AuthenticateClientResponseEs9__authenticateClientError;
/* AuthenticateClientResponseEs9 */
typedef struct AuthenticateClientResponseEs9 {
AuthenticateClientResponseEs9_PR present;
union AuthenticateClientResponseEs9_u {
AuthenticateClientOk_t authenticateClientOk;
INTEGER_t authenticateClientError;
/*
* This type is extensible,
* possible extensions are below.
*/
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthenticateClientResponseEs9_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateClientResponseEs9;
extern asn_CHOICE_specifics_t asn_SPC_AuthenticateClientResponseEs9_specs_1;
extern asn_TYPE_member_t asn_MBR_AuthenticateClientResponseEs9_1[2];
extern asn_per_constraints_t asn_PER_type_AuthenticateClientResponseEs9_constr_1;
#ifdef __cplusplus
}
#endif
#endif /* _AuthenticateClientResponseEs9_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,31 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateErrorCode.h"
/*
* This type is implemented using INTEGER,
* so here we adjust the DEF accordingly.
*/
static const ber_tlv_tag_t asn_DEF_AuthenticateErrorCode_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateErrorCode = {
"AuthenticateErrorCode",
"AuthenticateErrorCode",
&asn_OP_INTEGER,
asn_DEF_AuthenticateErrorCode_tags_1,
sizeof(asn_DEF_AuthenticateErrorCode_tags_1)
/sizeof(asn_DEF_AuthenticateErrorCode_tags_1[0]), /* 1 */
asn_DEF_AuthenticateErrorCode_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateErrorCode_tags_1)
/sizeof(asn_DEF_AuthenticateErrorCode_tags_1[0]), /* 1 */
{ 0, 0, INTEGER_constraint },
0, 0, /* Defined elsewhere */
0 /* No specifics */
};

View file

@ -0,0 +1,55 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateErrorCode_H_
#define _AuthenticateErrorCode_H_
#include "asn_application.h"
/* Including external dependencies */
#include "INTEGER.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum AuthenticateErrorCode {
AuthenticateErrorCode_invalidCertificate = 1,
AuthenticateErrorCode_invalidSignature = 2,
AuthenticateErrorCode_unsupportedCurve = 3,
AuthenticateErrorCode_noSessionContext = 4,
AuthenticateErrorCode_invalidOid = 5,
AuthenticateErrorCode_euiccChallengeMismatch = 6,
AuthenticateErrorCode_ciPKUnknown = 7,
AuthenticateErrorCode_undefinedError = 127
} e_AuthenticateErrorCode;
/* AuthenticateErrorCode */
typedef INTEGER_t AuthenticateErrorCode_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateErrorCode;
asn_struct_free_f AuthenticateErrorCode_free;
asn_struct_print_f AuthenticateErrorCode_print;
asn_constr_check_f AuthenticateErrorCode_constraint;
ber_type_decoder_f AuthenticateErrorCode_decode_ber;
der_type_encoder_f AuthenticateErrorCode_encode_der;
xer_type_decoder_f AuthenticateErrorCode_decode_xer;
xer_type_encoder_f AuthenticateErrorCode_encode_xer;
oer_type_decoder_f AuthenticateErrorCode_decode_oer;
oer_type_encoder_f AuthenticateErrorCode_encode_oer;
per_type_decoder_f AuthenticateErrorCode_decode_uper;
per_type_encoder_f AuthenticateErrorCode_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _AuthenticateErrorCode_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,60 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateResponseError.h"
asn_TYPE_member_t asn_MBR_AuthenticateResponseError_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateResponseError, transactionId),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_TransactionId,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"transactionId"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateResponseError, authenticateErrorCode),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_AuthenticateErrorCode,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authenticateErrorCode"
},
};
static const ber_tlv_tag_t asn_DEF_AuthenticateResponseError_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthenticateResponseError_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* authenticateErrorCode */
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* transactionId */
};
asn_SEQUENCE_specifics_t asn_SPC_AuthenticateResponseError_specs_1 = {
sizeof(struct AuthenticateResponseError),
offsetof(struct AuthenticateResponseError, _asn_ctx),
asn_MAP_AuthenticateResponseError_tag2el_1,
2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
2, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateResponseError = {
"AuthenticateResponseError",
"AuthenticateResponseError",
&asn_OP_SEQUENCE,
asn_DEF_AuthenticateResponseError_tags_1,
sizeof(asn_DEF_AuthenticateResponseError_tags_1)
/sizeof(asn_DEF_AuthenticateResponseError_tags_1[0]), /* 1 */
asn_DEF_AuthenticateResponseError_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateResponseError_tags_1)
/sizeof(asn_DEF_AuthenticateResponseError_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AuthenticateResponseError_1,
2, /* Elements count */
&asn_SPC_AuthenticateResponseError_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,46 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateResponseError_H_
#define _AuthenticateResponseError_H_
#include "asn_application.h"
/* Including external dependencies */
#include "TransactionId.h"
#include "AuthenticateErrorCode.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AuthenticateResponseError */
typedef struct AuthenticateResponseError {
TransactionId_t transactionId;
AuthenticateErrorCode_t authenticateErrorCode;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthenticateResponseError_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateResponseError;
extern asn_SEQUENCE_specifics_t asn_SPC_AuthenticateResponseError_specs_1;
extern asn_TYPE_member_t asn_MBR_AuthenticateResponseError_1[2];
#ifdef __cplusplus
}
#endif
#endif /* _AuthenticateResponseError_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,80 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateResponseOk.h"
asn_TYPE_member_t asn_MBR_AuthenticateResponseOk_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateResponseOk, euiccSigned1),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_EuiccSigned1,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"euiccSigned1"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateResponseOk, euiccSignature1),
(ASN_TAG_CLASS_APPLICATION | (55 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_OCTET_STRING,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"euiccSignature1"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateResponseOk, euiccCertificate),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_Certificate,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"euiccCertificate"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateResponseOk, eumCertificate),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_Certificate,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"eumCertificate"
},
};
static const ber_tlv_tag_t asn_DEF_AuthenticateResponseOk_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthenticateResponseOk_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* euiccSigned1 */
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -1, 1 }, /* euiccCertificate */
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -2, 0 }, /* eumCertificate */
{ (ASN_TAG_CLASS_APPLICATION | (55 << 2)), 1, 0, 0 } /* euiccSignature1 */
};
asn_SEQUENCE_specifics_t asn_SPC_AuthenticateResponseOk_specs_1 = {
sizeof(struct AuthenticateResponseOk),
offsetof(struct AuthenticateResponseOk, _asn_ctx),
asn_MAP_AuthenticateResponseOk_tag2el_1,
4, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
4, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateResponseOk = {
"AuthenticateResponseOk",
"AuthenticateResponseOk",
&asn_OP_SEQUENCE,
asn_DEF_AuthenticateResponseOk_tags_1,
sizeof(asn_DEF_AuthenticateResponseOk_tags_1)
/sizeof(asn_DEF_AuthenticateResponseOk_tags_1[0]), /* 1 */
asn_DEF_AuthenticateResponseOk_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateResponseOk_tags_1)
/sizeof(asn_DEF_AuthenticateResponseOk_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AuthenticateResponseOk_1,
4, /* Elements count */
&asn_SPC_AuthenticateResponseOk_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,49 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateResponseOk_H_
#define _AuthenticateResponseOk_H_
#include "asn_application.h"
/* Including external dependencies */
#include "EuiccSigned1.h"
#include "OCTET_STRING.h"
#include "Certificate.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AuthenticateResponseOk */
typedef struct AuthenticateResponseOk {
EuiccSigned1_t euiccSigned1;
OCTET_STRING_t euiccSignature1;
Certificate_t euiccCertificate;
Certificate_t eumCertificate;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthenticateResponseOk_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateResponseOk;
extern asn_SEQUENCE_specifics_t asn_SPC_AuthenticateResponseOk_specs_1;
extern asn_TYPE_member_t asn_MBR_AuthenticateResponseOk_1[4];
#ifdef __cplusplus
}
#endif
#endif /* _AuthenticateResponseOk_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,91 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateServerRequest.h"
static asn_TYPE_member_t asn_MBR_AuthenticateServerRequest_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateServerRequest, serverSigned1),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_ServerSigned1,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"serverSigned1"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateServerRequest, serverSignature1),
(ASN_TAG_CLASS_APPLICATION | (55 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_OCTET_STRING,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"serverSignature1"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateServerRequest, euiccCiPKIdToBeUsed),
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
0,
&asn_DEF_SubjectKeyIdentifier,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"euiccCiPKIdToBeUsed"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateServerRequest, serverCertificate),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_Certificate,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"serverCertificate"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateServerRequest, ctxParams1),
-1 /* Ambiguous tag (CHOICE?) */,
0,
&asn_DEF_CtxParams1,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"ctxParams1"
},
};
static const ber_tlv_tag_t asn_DEF_AuthenticateServerRequest_tags_1[] = {
(ASN_TAG_CLASS_CONTEXT | (56 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthenticateServerRequest_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 0 }, /* euiccCiPKIdToBeUsed */
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* serverSigned1 */
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -1, 0 }, /* serverCertificate */
{ (ASN_TAG_CLASS_APPLICATION | (55 << 2)), 1, 0, 0 }, /* serverSignature1 */
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 4, 0, 0 } /* ctxParamsForCommonAuthentication */
};
static asn_SEQUENCE_specifics_t asn_SPC_AuthenticateServerRequest_specs_1 = {
sizeof(struct AuthenticateServerRequest),
offsetof(struct AuthenticateServerRequest, _asn_ctx),
asn_MAP_AuthenticateServerRequest_tag2el_1,
5, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
5, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateServerRequest = {
"AuthenticateServerRequest",
"AuthenticateServerRequest",
&asn_OP_SEQUENCE,
asn_DEF_AuthenticateServerRequest_tags_1,
sizeof(asn_DEF_AuthenticateServerRequest_tags_1)
/sizeof(asn_DEF_AuthenticateServerRequest_tags_1[0]) - 1, /* 1 */
asn_DEF_AuthenticateServerRequest_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateServerRequest_tags_1)
/sizeof(asn_DEF_AuthenticateServerRequest_tags_1[0]), /* 2 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AuthenticateServerRequest_1,
5, /* Elements count */
&asn_SPC_AuthenticateServerRequest_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,50 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateServerRequest_H_
#define _AuthenticateServerRequest_H_
#include "asn_application.h"
/* Including external dependencies */
#include "ServerSigned1.h"
#include "OCTET_STRING.h"
#include "SubjectKeyIdentifier.h"
#include "Certificate.h"
#include "CtxParams1.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* AuthenticateServerRequest */
typedef struct AuthenticateServerRequest {
ServerSigned1_t serverSigned1;
OCTET_STRING_t serverSignature1;
SubjectKeyIdentifier_t euiccCiPKIdToBeUsed;
Certificate_t serverCertificate;
CtxParams1_t ctxParams1;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthenticateServerRequest_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateServerRequest;
#ifdef __cplusplus
}
#endif
#endif /* _AuthenticateServerRequest_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,70 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthenticateServerResponse.h"
static asn_oer_constraints_t asn_OER_type_AuthenticateServerResponse_constr_1 CC_NOTUSED = {
{ 0, 0 },
-1};
asn_per_constraints_t asn_PER_type_AuthenticateServerResponse_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_AuthenticateServerResponse_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateServerResponse, choice.authenticateResponseOk),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_AuthenticateResponseOk,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authenticateResponseOk"
},
{ ATF_NOFLAGS, 0, offsetof(struct AuthenticateServerResponse, choice.authenticateResponseError),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_AuthenticateResponseError,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authenticateResponseError"
},
};
static const ber_tlv_tag_t asn_DEF_AuthenticateServerResponse_tags_1[] = {
(ASN_TAG_CLASS_CONTEXT | (56 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthenticateServerResponse_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* authenticateResponseOk */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* authenticateResponseError */
};
asn_CHOICE_specifics_t asn_SPC_AuthenticateServerResponse_specs_1 = {
sizeof(struct AuthenticateServerResponse),
offsetof(struct AuthenticateServerResponse, _asn_ctx),
offsetof(struct AuthenticateServerResponse, present),
sizeof(((struct AuthenticateServerResponse *)0)->present),
asn_MAP_AuthenticateServerResponse_tag2el_1,
2, /* Count of tags in the map */
0, 0,
2 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_AuthenticateServerResponse = {
"AuthenticateServerResponse",
"AuthenticateServerResponse",
&asn_OP_CHOICE,
asn_DEF_AuthenticateServerResponse_tags_1,
sizeof(asn_DEF_AuthenticateServerResponse_tags_1)
/sizeof(asn_DEF_AuthenticateServerResponse_tags_1[0]), /* 1 */
asn_DEF_AuthenticateServerResponse_tags_1, /* Same as above */
sizeof(asn_DEF_AuthenticateServerResponse_tags_1)
/sizeof(asn_DEF_AuthenticateServerResponse_tags_1[0]), /* 1 */
{ &asn_OER_type_AuthenticateServerResponse_constr_1, &asn_PER_type_AuthenticateServerResponse_constr_1, CHOICE_constraint },
asn_MBR_AuthenticateServerResponse_1,
2, /* Elements count */
&asn_SPC_AuthenticateServerResponse_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,59 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthenticateServerResponse_H_
#define _AuthenticateServerResponse_H_
#include "asn_application.h"
/* Including external dependencies */
#include "AuthenticateResponseOk.h"
#include "AuthenticateResponseError.h"
#include "constr_CHOICE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum AuthenticateServerResponse_PR {
AuthenticateServerResponse_PR_NOTHING, /* No components present */
AuthenticateServerResponse_PR_authenticateResponseOk,
AuthenticateServerResponse_PR_authenticateResponseError
/* Extensions may appear below */
} AuthenticateServerResponse_PR;
/* AuthenticateServerResponse */
typedef struct AuthenticateServerResponse {
AuthenticateServerResponse_PR present;
union AuthenticateServerResponse_u {
AuthenticateResponseOk_t authenticateResponseOk;
AuthenticateResponseError_t authenticateResponseError;
/*
* This type is extensible,
* possible extensions are below.
*/
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthenticateServerResponse_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthenticateServerResponse;
extern asn_CHOICE_specifics_t asn_SPC_AuthenticateServerResponse_specs_1;
extern asn_TYPE_member_t asn_MBR_AuthenticateServerResponse_1[2];
extern asn_per_constraints_t asn_PER_type_AuthenticateServerResponse_constr_1;
#ifdef __cplusplus
}
#endif
#endif /* _AuthenticateServerResponse_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,52 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthorityInfoAccessSyntax.h"
static asn_oer_constraints_t asn_OER_type_AuthorityInfoAccessSyntax_constr_1 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..MAX)) */};
static asn_per_constraints_t asn_PER_type_AuthorityInfoAccessSyntax_constr_1 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_SEMI_CONSTRAINED, -1, -1, 1, 0 } /* (SIZE(1..MAX)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_AuthorityInfoAccessSyntax_1[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_AccessDescription,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_AuthorityInfoAccessSyntax_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_AuthorityInfoAccessSyntax_specs_1 = {
sizeof(struct AuthorityInfoAccessSyntax),
offsetof(struct AuthorityInfoAccessSyntax, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
asn_TYPE_descriptor_t asn_DEF_AuthorityInfoAccessSyntax = {
"AuthorityInfoAccessSyntax",
"AuthorityInfoAccessSyntax",
&asn_OP_SEQUENCE_OF,
asn_DEF_AuthorityInfoAccessSyntax_tags_1,
sizeof(asn_DEF_AuthorityInfoAccessSyntax_tags_1)
/sizeof(asn_DEF_AuthorityInfoAccessSyntax_tags_1[0]), /* 1 */
asn_DEF_AuthorityInfoAccessSyntax_tags_1, /* Same as above */
sizeof(asn_DEF_AuthorityInfoAccessSyntax_tags_1)
/sizeof(asn_DEF_AuthorityInfoAccessSyntax_tags_1[0]), /* 1 */
{ &asn_OER_type_AuthorityInfoAccessSyntax_constr_1, &asn_PER_type_AuthorityInfoAccessSyntax_constr_1, SEQUENCE_OF_constraint },
asn_MBR_AuthorityInfoAccessSyntax_1,
1, /* Single element */
&asn_SPC_AuthorityInfoAccessSyntax_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,44 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthorityInfoAccessSyntax_H_
#define _AuthorityInfoAccessSyntax_H_
#include "asn_application.h"
/* Including external dependencies */
#include "asn_SEQUENCE_OF.h"
#include "constr_SEQUENCE_OF.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct AccessDescription;
/* AuthorityInfoAccessSyntax */
typedef struct AuthorityInfoAccessSyntax {
A_SEQUENCE_OF(struct AccessDescription) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthorityInfoAccessSyntax_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthorityInfoAccessSyntax;
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "AccessDescription.h"
#endif /* _AuthorityInfoAccessSyntax_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,72 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "AuthorityKeyIdentifier.h"
static asn_TYPE_member_t asn_MBR_AuthorityKeyIdentifier_1[] = {
{ ATF_POINTER, 3, offsetof(struct AuthorityKeyIdentifier, keyIdentifier),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_KeyIdentifier,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"keyIdentifier"
},
{ ATF_POINTER, 2, offsetof(struct AuthorityKeyIdentifier, authorityCertIssuer),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_GeneralNames,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authorityCertIssuer"
},
{ ATF_POINTER, 1, offsetof(struct AuthorityKeyIdentifier, authorityCertSerialNumber),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_CertificateSerialNumber,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"authorityCertSerialNumber"
},
};
static const int asn_MAP_AuthorityKeyIdentifier_oms_1[] = { 0, 1, 2 };
static const ber_tlv_tag_t asn_DEF_AuthorityKeyIdentifier_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AuthorityKeyIdentifier_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* keyIdentifier */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* authorityCertIssuer */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* authorityCertSerialNumber */
};
static asn_SEQUENCE_specifics_t asn_SPC_AuthorityKeyIdentifier_specs_1 = {
sizeof(struct AuthorityKeyIdentifier),
offsetof(struct AuthorityKeyIdentifier, _asn_ctx),
asn_MAP_AuthorityKeyIdentifier_tag2el_1,
3, /* Count of tags in the map */
asn_MAP_AuthorityKeyIdentifier_oms_1, /* Optional members */
3, 0, /* Root/Additions */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AuthorityKeyIdentifier = {
"AuthorityKeyIdentifier",
"AuthorityKeyIdentifier",
&asn_OP_SEQUENCE,
asn_DEF_AuthorityKeyIdentifier_tags_1,
sizeof(asn_DEF_AuthorityKeyIdentifier_tags_1)
/sizeof(asn_DEF_AuthorityKeyIdentifier_tags_1[0]), /* 1 */
asn_DEF_AuthorityKeyIdentifier_tags_1, /* Same as above */
sizeof(asn_DEF_AuthorityKeyIdentifier_tags_1)
/sizeof(asn_DEF_AuthorityKeyIdentifier_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_AuthorityKeyIdentifier_1,
3, /* Elements count */
&asn_SPC_AuthorityKeyIdentifier_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,47 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _AuthorityKeyIdentifier_H_
#define _AuthorityKeyIdentifier_H_
#include "asn_application.h"
/* Including external dependencies */
#include "KeyIdentifier.h"
#include "CertificateSerialNumber.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct GeneralNames;
/* AuthorityKeyIdentifier */
typedef struct AuthorityKeyIdentifier {
KeyIdentifier_t *keyIdentifier /* OPTIONAL */;
struct GeneralNames *authorityCertIssuer /* OPTIONAL */;
CertificateSerialNumber_t *authorityCertSerialNumber /* OPTIONAL */;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AuthorityKeyIdentifier_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AuthorityKeyIdentifier;
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "GeneralNames.h"
#endif /* _AuthorityKeyIdentifier_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,652 @@
/*-
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <BIT_STRING.h>
#include <asn_internal.h>
/*
* BIT STRING basic type description.
*/
static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
};
asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = {
sizeof(BIT_STRING_t),
offsetof(BIT_STRING_t, _asn_ctx),
ASN_OSUBV_BIT
};
asn_TYPE_operation_t asn_OP_BIT_STRING = {
OCTET_STRING_free, /* Implemented in terms of OCTET STRING */
BIT_STRING_print,
BIT_STRING_compare,
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */
OCTET_STRING_decode_xer_binary,
BIT_STRING_encode_xer,
#ifdef ASN_DISABLE_OER_SUPPORT
0,
0,
#else
BIT_STRING_decode_oer,
BIT_STRING_encode_oer,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0,
0,
#else
BIT_STRING_decode_uper, /* Unaligned PER decoder */
BIT_STRING_encode_uper, /* Unaligned PER encoder */
#endif /* ASN_DISABLE_PER_SUPPORT */
BIT_STRING_random_fill,
0 /* Use generic outmost tag fetcher */
};
asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
"BIT STRING",
"BIT_STRING",
&asn_OP_BIT_STRING,
asn_DEF_BIT_STRING_tags,
sizeof(asn_DEF_BIT_STRING_tags)
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
asn_DEF_BIT_STRING_tags, /* Same as above */
sizeof(asn_DEF_BIT_STRING_tags)
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
{ 0, 0, BIT_STRING_constraint },
0, 0, /* No members */
&asn_SPC_BIT_STRING_specs
};
/*
* BIT STRING generic constraint.
*/
int
BIT_STRING_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
if(st && st->buf) {
if((st->size == 0 && st->bits_unused)
|| st->bits_unused < 0 || st->bits_unused > 7) {
ASN__CTFAIL(app_key, td, sptr,
"%s: invalid padding byte (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
return 0;
}
static const char *_bit_pattern[16] = {
"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",
"1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"
};
asn_enc_rval_t
BIT_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er;
char scratch[128];
char *p = scratch;
char *scend = scratch + (sizeof(scratch) - 10);
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
int xcan = (flags & XER_F_CANONICAL);
uint8_t *buf;
uint8_t *end;
if(!st || !st->buf)
ASN__ENCODE_FAILED;
er.encoded = 0;
buf = st->buf;
end = buf + st->size - 1; /* Last byte is special */
/*
* Binary dump
*/
for(; buf < end; buf++) {
int v = *buf;
int nline = xcan?0:(((buf - st->buf) % 8) == 0);
if(p >= scend || nline) {
ASN__CALLBACK(scratch, p - scratch);
p = scratch;
if(nline) ASN__TEXT_INDENT(1, ilevel);
}
memcpy(p + 0, _bit_pattern[v >> 4], 4);
memcpy(p + 4, _bit_pattern[v & 0x0f], 4);
p += 8;
}
if(!xcan && ((buf - st->buf) % 8) == 0)
ASN__TEXT_INDENT(1, ilevel);
ASN__CALLBACK(scratch, p - scratch);
p = scratch;
if(buf == end) {
int v = *buf;
int ubits = st->bits_unused;
int i;
for(i = 7; i >= ubits; i--)
*p++ = (v & (1 << i)) ? 0x31 : 0x30;
ASN__CALLBACK(scratch, p - scratch);
}
if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
ASN__ENCODED_OK(er);
cb_failed:
ASN__ENCODE_FAILED;
}
/*
* BIT STRING specific contents printer.
*/
int
BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
asn_app_consume_bytes_f *cb, void *app_key) {
const char * const h2c = "0123456789ABCDEF";
char scratch[64];
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
uint8_t *buf;
uint8_t *end;
char *p = scratch;
(void)td; /* Unused argument */
if(!st || !st->buf)
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
ilevel++;
buf = st->buf;
end = buf + st->size;
/*
* Hexadecimal dump.
*/
for(; buf < end; buf++) {
if((buf - st->buf) % 16 == 0 && (st->size > 16)
&& buf != st->buf) {
_i_INDENT(1);
/* Dump the string */
if(cb(scratch, p - scratch, app_key) < 0) return -1;
p = scratch;
}
*p++ = h2c[*buf >> 4];
*p++ = h2c[*buf & 0x0F];
*p++ = 0x20;
}
if(p > scratch) {
p--; /* Eat the tailing space */
if((st->size > 16)) {
_i_INDENT(1);
}
/* Dump the incomplete 16-bytes row */
if(cb(scratch, p - scratch, app_key) < 0)
return -1;
}
if(st->bits_unused) {
int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)",
st->bits_unused, st->bits_unused == 1 ? "" : "s");
assert(ret > 0 && ret < (ssize_t)sizeof(scratch));
if(ret > 0 && ret < (ssize_t)sizeof(scratch)
&& cb(scratch, ret, app_key) < 0)
return -1;
}
return 0;
}
/*
* Non-destructively remove the trailing 0-bits from the given bit string.
*/
static const BIT_STRING_t *
BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) {
const uint8_t *b;
union {
const uint8_t *c_buf;
uint8_t *nc_buf;
} unconst;
if(st->size == 0) {
assert(st->bits_unused == 0);
return st;
} else {
for(b = &st->buf[st->size - 1]; b > st->buf && *b == 0; b--) {
;
}
/* b points to the last byte which may contain data */
if(*b) {
int unused = 7;
uint8_t v = *b;
v &= -(int8_t)v;
if(v & 0x0F) unused -= 4;
if(v & 0x33) unused -= 2;
if(v & 0x55) unused -= 1;
tmp->size = b-st->buf + 1;
tmp->bits_unused = unused;
} else {
tmp->size = b-st->buf;
tmp->bits_unused = 0;
}
assert(b >= st->buf);
}
unconst.c_buf = st->buf;
tmp->buf = unconst.nc_buf;
return tmp;
}
/*
* Lexicographically compare the common prefix of both strings,
* and if it is the same return -1 for the smallest string.
*/
int
BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
const void *bptr) {
/*
* Remove information about trailing bits, since
* X.680 (08/2015) #22.7 "ensure that different semantics are not"
* "associated with [values that differ only in] the trailing 0 bits."
*/
BIT_STRING_t compact_a, compact_b;
const BIT_STRING_t *a = BIT_STRING__compactify(aptr, &compact_a);
const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b);
const asn_OCTET_STRING_specifics_t *specs = td->specifics;
assert(specs && specs->subvariant == ASN_OSUBV_BIT);
if(a && b) {
size_t common_prefix_size = a->size <= b->size ? a->size : b->size;
int ret = memcmp(a->buf, b->buf, common_prefix_size);
if(ret == 0) {
/* Figure out which string with equal prefixes is longer. */
if(a->size < b->size) {
return -1;
} else if(a->size > b->size) {
return 1;
} else {
/* Figure out how many unused bits */
if(a->bits_unused > b->bits_unused) {
return -1;
} else if(a->bits_unused < b->bits_unused) {
return 1;
} else {
return 0;
}
}
} else {
return ret;
}
} else if(!a && !b) {
return 0;
} else if(!a) {
return -1;
} else {
return 1;
}
}
#ifndef ASN_DISABLE_PER_SUPPORT
#undef RETURN
#define RETURN(_code) \
do { \
asn_dec_rval_t tmprval; \
tmprval.code = _code; \
tmprval.consumed = consumed_myself; \
return tmprval; \
} while(0)
static asn_per_constraint_t asn_DEF_BIT_STRING_constraint_size = {
APC_SEMI_CONSTRAINED, -1, -1, 0, 0};
asn_dec_rval_t
BIT_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
const asn_per_constraints_t *pc =
constraints ? constraints : td->encoding_constraints.per_constraints;
const asn_per_constraint_t *csiz;
asn_dec_rval_t rval = { RC_OK, 0 };
BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
ssize_t consumed_myself = 0;
int repeat;
(void)opt_codec_ctx;
if(pc) {
csiz = &pc->size;
} else {
csiz = &asn_DEF_BIT_STRING_constraint_size;
}
if(specs->subvariant != ASN_OSUBV_BIT) {
ASN_DEBUG("Subvariant %d is not BIT OSUBV_BIT", specs->subvariant);
RETURN(RC_FAIL);
}
/*
* Allocate the string.
*/
if(!st) {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) RETURN(RC_FAIL);
}
ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
if(csiz->flags & APC_EXTENSIBLE) {
int inext = per_get_few_bits(pd, 1);
if(inext < 0) RETURN(RC_WMORE);
if(inext) {
csiz = &asn_DEF_BIT_STRING_constraint_size;
}
}
if(csiz->effective_bits >= 0) {
FREEMEM(st->buf);
st->size = (csiz->upper_bound + 7) >> 3;
st->buf = (uint8_t *)MALLOC(st->size + 1);
if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
}
/* X.691, #16.5: zero-length encoding */
/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
if(csiz->effective_bits == 0) {
int ret;
ASN_DEBUG("Encoding BIT STRING size %ld", csiz->upper_bound);
ret = per_get_many_bits(pd, st->buf, 0, csiz->upper_bound);
if(ret < 0) RETURN(RC_WMORE);
consumed_myself += csiz->upper_bound;
st->buf[st->size] = 0;
st->bits_unused = (8 - (csiz->upper_bound & 0x7)) & 0x7;
RETURN(RC_OK);
}
st->size = 0;
do {
ssize_t raw_len;
ssize_t len_bytes;
ssize_t len_bits;
void *p;
int ret;
/* Get the PER length */
raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
&repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
(long)csiz->effective_bits, (long)raw_len,
repeat ? "repeat" : "once", td->name);
len_bits = raw_len;
len_bytes = (len_bits + 7) >> 3;
if(len_bits & 0x7) st->bits_unused = 8 - (len_bits & 0x7);
/* len_bits be multiple of 16K if repeat is set */
p = REALLOC(st->buf, st->size + len_bytes + 1);
if(!p) RETURN(RC_FAIL);
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
if(ret < 0) RETURN(RC_WMORE);
st->size += len_bytes;
} while(repeat);
st->buf[st->size] = 0; /* nul-terminate */
return rval;
}
asn_enc_rval_t
BIT_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints,
const void *sptr, asn_per_outp_t *po) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
const asn_per_constraints_t *pc =
constraints ? constraints : td->encoding_constraints.per_constraints;
const asn_per_constraint_t *csiz;
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
BIT_STRING_t compact_bstr; /* Do not modify this directly! */
asn_enc_rval_t er = { 0, 0, 0 };
int inext = 0; /* Lies not within extension root */
size_t size_in_bits;
const uint8_t *buf;
int ret;
int ct_extensible;
if(!st || (!st->buf && st->size))
ASN__ENCODE_FAILED;
if(specs->subvariant == ASN_OSUBV_BIT) {
if((st->size == 0 && st->bits_unused) || (st->bits_unused & ~7))
ASN__ENCODE_FAILED;
} else {
ASN__ENCODE_FAILED;
}
if(pc) {
csiz = &pc->size;
} else {
csiz = &asn_DEF_BIT_STRING_constraint_size;
}
ct_extensible = csiz->flags & APC_EXTENSIBLE;
/* Figure out the size without the trailing bits */
st = BIT_STRING__compactify(st, &compact_bstr);
size_in_bits = 8 * st->size - st->bits_unused;
ASN_DEBUG(
"Encoding %s into %" ASN_PRI_SIZE " bits"
" (%ld..%ld, effective %d)%s",
td->name, size_in_bits, csiz->lower_bound, csiz->upper_bound,
csiz->effective_bits, ct_extensible ? " EXT" : "");
/* Figure out whether size lies within PER visible constraint */
if(csiz->effective_bits >= 0) {
if((ssize_t)size_in_bits > csiz->upper_bound) {
if(ct_extensible) {
csiz = &asn_DEF_BIT_STRING_constraint_size;
inext = 1;
} else {
ASN__ENCODE_FAILED;
}
}
} else {
inext = 0;
}
if(ct_extensible) {
/* Declare whether length is [not] within extension root */
if(per_put_few_bits(po, inext, 1))
ASN__ENCODE_FAILED;
}
if(csiz->effective_bits >= 0 && !inext) {
int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound;
ASN_DEBUG(
"Encoding %" ASN_PRI_SIZE " bytes (%ld), length (in %d bits) trailer %d; actual "
"value %" ASN_PRI_SSIZE "",
st->size, size_in_bits - csiz->lower_bound, csiz->effective_bits,
add_trailer,
add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound);
ret = per_put_few_bits(
po, add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound,
csiz->effective_bits);
if(ret) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, st->buf, size_in_bits);
if(ret) ASN__ENCODE_FAILED;
if(add_trailer) {
static const uint8_t zeros[16];
size_t trailing_zero_bits = csiz->lower_bound - size_in_bits;
while(trailing_zero_bits > 0) {
if(trailing_zero_bits > 8 * sizeof(zeros)) {
ret = per_put_many_bits(po, zeros, 8 * sizeof(zeros));
trailing_zero_bits -= 8 * sizeof(zeros);
} else {
ret = per_put_many_bits(po, zeros, trailing_zero_bits);
trailing_zero_bits = 0;
}
if(ret) ASN__ENCODE_FAILED;
}
}
ASN__ENCODED_OK(er);
}
ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
buf = st->buf;
do {
int need_eom = 0;
ssize_t maySave = uper_put_length(po, size_in_bits, &need_eom);
if(maySave < 0) ASN__ENCODE_FAILED;
ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "", maySave, size_in_bits);
ret = per_put_many_bits(po, buf, maySave);
if(ret) ASN__ENCODE_FAILED;
buf += maySave >> 3;
size_in_bits -= maySave;
assert(!(maySave & 0x07) || !size_in_bits);
if(need_eom && uper_put_length(po, 0, 0))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size_in_bits);
ASN__ENCODED_OK(er);
}
#endif /* ASN_DISABLE_PER_SUPPORT */
asn_random_fill_result_t
BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
const asn_encoding_constraints_t *constraints,
size_t max_length) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
static unsigned lengths[] = {0, 1, 2, 3, 4, 8,
126, 127, 128, 16383, 16384, 16385,
65534, 65535, 65536, 65537};
uint8_t *buf;
uint8_t *bend;
uint8_t *b;
size_t rnd_bits, rnd_len;
BIT_STRING_t *st;
if(max_length == 0) return result_skipped;
switch(specs->subvariant) {
case ASN_OSUBV_ANY:
return result_failed;
case ASN_OSUBV_BIT:
break;
default:
break;
}
/* Figure out how far we should go */
rnd_bits = lengths[asn_random_between(
0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
if(!constraints || !constraints->per_constraints)
constraints = &td->encoding_constraints;
if(constraints->per_constraints) {
const asn_per_constraint_t *pc = &constraints->per_constraints->size;
if(pc->flags & APC_CONSTRAINED) {
long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
? pc->upper_bound
: (ssize_t)max_length;
if(max_length < (size_t)pc->lower_bound) {
return result_skipped;
}
if(pc->flags & APC_EXTENSIBLE) {
switch(asn_random_between(0, 5)) {
case 0:
if(pc->lower_bound > 0) {
rnd_bits = pc->lower_bound - 1;
break;
}
/* Fall through */
case 1:
rnd_bits = pc->upper_bound + 1;
break;
case 2:
/* Keep rnd_bits from the table */
if(rnd_bits < max_length) {
break;
}
/* Fall through */
default:
rnd_bits = asn_random_between(pc->lower_bound,
suggested_upper_bound);
}
} else {
rnd_bits =
asn_random_between(pc->lower_bound, suggested_upper_bound);
}
} else {
rnd_bits = asn_random_between(0, max_length - 1);
}
} else if(rnd_bits >= max_length) {
rnd_bits = asn_random_between(0, max_length - 1);
}
rnd_len = (rnd_bits + 7) / 8;
buf = CALLOC(1, rnd_len + 1);
if(!buf) return result_failed;
bend = &buf[rnd_len];
for(b = buf; b < bend; b++) {
*(uint8_t *)b = asn_random_between(0, 255);
}
*b = 0; /* Zero-terminate just in case. */
if(*sptr) {
st = *sptr;
FREEMEM(st->buf);
} else {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) {
FREEMEM(buf);
return result_failed;
}
}
st->buf = buf;
st->size = rnd_len;
st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7;
if(st->bits_unused) {
assert(st->size > 0);
st->buf[st->size-1] &= 0xff << st->bits_unused;
}
result_ok.length = st->size;
return result_ok;
}

View file

@ -0,0 +1,46 @@
/*-
* Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _BIT_STRING_H_
#define _BIT_STRING_H_
#include <OCTET_STRING.h> /* Some help from OCTET STRING */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct BIT_STRING_s {
uint8_t *buf; /* BIT STRING body */
size_t size; /* Size of the above buffer */
int bits_unused;/* Unused trailing bits in the last octet (0..7) */
asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
} BIT_STRING_t;
extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
extern asn_TYPE_operation_t asn_OP_BIT_STRING;
extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
asn_struct_print_f BIT_STRING_print; /* Human-readable output */
asn_struct_compare_f BIT_STRING_compare;
asn_constr_check_f BIT_STRING_constraint;
xer_type_encoder_f BIT_STRING_encode_xer;
oer_type_decoder_f BIT_STRING_decode_oer;
oer_type_encoder_f BIT_STRING_encode_oer;
per_type_decoder_f BIT_STRING_decode_uper;
per_type_encoder_f BIT_STRING_encode_uper;
asn_random_fill_f BIT_STRING_random_fill;
#define BIT_STRING_free OCTET_STRING_free
#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
#define BIT_STRING_encode_der OCTET_STRING_encode_der
#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
#ifdef __cplusplus
}
#endif
#endif /* _BIT_STRING_H_ */

View file

@ -0,0 +1,174 @@
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef ASN_DISABLE_OER_SUPPORT
#include <asn_internal.h>
#include <BIT_STRING.h>
#include <errno.h>
asn_dec_rval_t
BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) {
BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
const asn_oer_constraints_t *cts =
constraints ? constraints : td->encoding_constraints.oer_constraints;
ssize_t ct_size = cts ? cts->size : -1;
asn_dec_rval_t rval = {RC_OK, 0};
size_t expected_length = 0;
(void)opt_codec_ctx;
if(!st) {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, sizeof(*st)));
if(!st) ASN__DECODE_FAILED;
}
if(ct_size >= 0) {
expected_length = (ct_size + 7) >> 3;
st->bits_unused = (8 - (ct_size & 7)) & 7;
} else {
/*
* X.696 (08/2015) #13.3.1
* Encode length determinant as _number of octets_, but only
* if upper bound is not equal to lower bound.
*/
ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
if(len_len > 0) {
ptr = (const char *)ptr + len_len;
size -= len_len;
} else if(len_len == 0) {
ASN__DECODE_STARVED;
} else if(len_len < 0) {
ASN__DECODE_FAILED;
}
if(expected_length < 1) {
ASN__DECODE_FAILED;
} else if(expected_length > size) {
ASN__DECODE_STARVED;
}
st->bits_unused = ((const uint8_t *)ptr)[0];
if(st->bits_unused & ~7) {
ASN_DEBUG("%s: unused bits outside of 0..7 range", td->name);
ASN__DECODE_FAILED;
}
ptr = (const char *)ptr + 1;
size--;
expected_length--;
rval.consumed = len_len + 1;
}
if(size < expected_length) {
ASN__DECODE_STARVED;
} else {
uint8_t *buf = MALLOC(expected_length + 1);
if(buf == NULL) {
ASN__DECODE_FAILED;
} else {
memcpy(buf, ptr, expected_length);
buf[expected_length] = '\0';
}
FREEMEM(st->buf);
st->buf = buf;
st->size = expected_length;
if(expected_length > 0) {
buf[expected_length - 1] &= (0xff << st->bits_unused);
}
rval.consumed += expected_length;
return rval;
}
}
/*
* Encode as Canonical OER.
*/
asn_enc_rval_t
BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints,
const void *sptr, asn_app_consume_bytes_f *cb,
void *app_key) {
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
asn_enc_rval_t erval = {0, 0, 0};
const asn_oer_constraints_t *cts =
constraints ? constraints : td->encoding_constraints.oer_constraints;
ssize_t ct_size = cts ? cts->size : -1;
size_t trailing_zeros = 0;
int fix_last_byte = 0;
if(!st) ASN__ENCODE_FAILED;
if(st->bits_unused & ~7) {
ASN_DEBUG("BIT STRING unused bits %d out of 0..7 range",
st->bits_unused);
ASN__ENCODE_FAILED;
}
if(st->bits_unused && !(st->size && st->buf)) {
ASN_DEBUG("BIT STRING %s size 0 can't support unused bits %d", td->name,
st->bits_unused);
ASN__ENCODE_FAILED;
}
if(ct_size >= 0) {
size_t ct_bytes = (ct_size + 7) >> 3;
if(st->size > ct_bytes) {
ASN_DEBUG("More bits in BIT STRING %s (%" ASN_PRI_SSIZE ") than constrained %" ASN_PRI_SSIZE "",
td->name, 8 * st->size - st->bits_unused, ct_size);
ASN__ENCODE_FAILED;
}
trailing_zeros = ct_bytes - st->size; /* Allow larger constraint */
} else {
uint8_t ub = st->bits_unused & 7;
ssize_t len_len = oer_serialize_length(1 + st->size, cb, app_key);
if(len_len < 0) ASN__ENCODE_FAILED;
if(cb(&ub, 1, app_key) < 0) {
ASN__ENCODE_FAILED;
}
erval.encoded += len_len + 1;
}
if(st->bits_unused) {
if(st->buf[st->size - 1] & (0xff << st->bits_unused)) {
fix_last_byte = 1;
}
}
if(cb(st->buf, st->size - fix_last_byte, app_key) < 0) {
ASN__ENCODE_FAILED;
}
if(fix_last_byte) {
uint8_t b = st->buf[st->size - 1] & (0xff << st->bits_unused);
if(cb(&b, 1, app_key) < 0) {
ASN__ENCODE_FAILED;
}
}
erval.encoded += st->size;
if(trailing_zeros) {
static uint8_t zeros[16];
while(trailing_zeros > 0) {
int ret;
if(trailing_zeros < sizeof(zeros)) {
ret = cb(zeros, trailing_zeros, app_key);
erval.encoded += trailing_zeros;
} else {
ret = cb(zeros, sizeof(zeros), app_key);
erval.encoded += sizeof(zeros);
}
if(ret < 0) ASN__ENCODE_FAILED;
}
}
return erval;
}
#endif /* ASN_DISABLE_OER_SUPPORT */

View file

@ -0,0 +1,229 @@
/*-
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <BMPString.h>
#include <UTF8String.h>
/*
* BMPString basic type description.
*/
static const ber_tlv_tag_t asn_DEF_BMPString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (30 << 2)), /* [UNIVERSAL 30] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn_OCTET_STRING_specifics_t asn_SPC_BMPString_specs = {
sizeof(BMPString_t),
offsetof(BMPString_t, _asn_ctx),
ASN_OSUBV_U16 /* 16-bits character */
};
static asn_per_constraints_t asn_DEF_BMPString_per_constraints = {
{ APC_CONSTRAINED, 16, 16, 0, 65535 },
{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 },
0, 0
};
asn_TYPE_operation_t asn_OP_BMPString = {
OCTET_STRING_free, /* Implemented in terms of OCTET STRING */
BMPString_print,
OCTET_STRING_compare,
OCTET_STRING_decode_ber,
OCTET_STRING_encode_der,
BMPString_decode_xer, /* Convert from UTF-8 */
BMPString_encode_xer, /* Convert to UTF-8 */
#ifdef ASN_DISABLE_OER_SUPPORT
0,
0,
#else
OCTET_STRING_decode_oer,
OCTET_STRING_encode_oer,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0,
0,
#else
OCTET_STRING_decode_uper,
OCTET_STRING_encode_uper,
#endif /* ASN_DISABLE_PER_SUPPORT */
OCTET_STRING_random_fill,
0 /* Use generic outmost tag fetcher */
};
asn_TYPE_descriptor_t asn_DEF_BMPString = {
"BMPString",
"BMPString",
&asn_OP_BMPString,
asn_DEF_BMPString_tags,
sizeof(asn_DEF_BMPString_tags)
/ sizeof(asn_DEF_BMPString_tags[0]) - 1,
asn_DEF_BMPString_tags,
sizeof(asn_DEF_BMPString_tags)
/ sizeof(asn_DEF_BMPString_tags[0]),
{ 0, &asn_DEF_BMPString_per_constraints, BMPString_constraint },
0, 0, /* No members */
&asn_SPC_BMPString_specs
};
int
BMPString_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const BMPString_t *st = (const BMPString_t *)sptr;
if(st && st->buf) {
if(st->size & 1) {
ASN__CTFAIL(app_key, td, sptr,
"%s: invalid size %" ASN_PRI_SIZE " not divisible by 2 (%s:%d)",
td->name, st->size, __FILE__, __LINE__);
return -1;
}
} else {
ASN__CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name,
__FILE__, __LINE__);
return -1;
}
return 0;
}
/*
* BMPString specific contents printer.
*/
static ssize_t
BMPString__dump(const BMPString_t *st,
asn_app_consume_bytes_f *cb, void *app_key) {
char scratch[128]; /* Scratchpad buffer */
char *p = scratch;
ssize_t wrote = 0;
uint8_t *ch;
uint8_t *end;
ch = st->buf;
end = (st->buf + st->size);
for(end--; ch < end; ch += 2) {
uint16_t wc = (ch[0] << 8) | ch[1]; /* 2 bytes */
if(sizeof(scratch) - (p - scratch) < 3) {
wrote += p - scratch;
if(cb(scratch, p - scratch, app_key) < 0)
return -1;
p = scratch;
}
if(wc < 0x80) {
*p++ = (char)wc;
} else if(wc < 0x800) {
*p++ = 0xc0 | ((wc >> 6));
*p++ = 0x80 | ((wc & 0x3f));
} else {
*p++ = 0xe0 | ((wc >> 12));
*p++ = 0x80 | ((wc >> 6) & 0x3f);
*p++ = 0x80 | ((wc & 0x3f));
}
}
wrote += p - scratch;
if(cb(scratch, p - scratch, app_key) < 0)
return -1;
return wrote;
}
asn_dec_rval_t
BMPString_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) {
asn_dec_rval_t rc;
rc = OCTET_STRING_decode_xer_utf8(opt_codec_ctx, td, sptr, opt_mname,
buf_ptr, size);
if(rc.code == RC_OK) {
/*
* Now we have a whole string in UTF-8 format.
* Convert it into UCS-2.
*/
uint32_t *wcs;
size_t wcs_len;
UTF8String_t *st;
assert(*sptr);
st = (UTF8String_t *)*sptr;
assert(st->buf);
wcs_len = UTF8String_to_wcs(st, 0, 0);
wcs = (uint32_t *)MALLOC(4 * (wcs_len + 1));
if(wcs == 0 || UTF8String_to_wcs(st, wcs, wcs_len) != wcs_len) {
rc.code = RC_FAIL;
rc.consumed = 0;
return rc;
} else {
wcs[wcs_len] = 0; /* nul-terminate */
}
if(1) {
/* Swap byte order and trim encoding to 2 bytes */
uint32_t *wc = wcs;
uint32_t *wc_end = wcs + wcs_len;
uint16_t *dstwc = (uint16_t *)wcs;
for(; wc < wc_end; wc++, dstwc++) {
uint32_t wch = *wc;
if(wch > 0xffff) {
FREEMEM(wcs);
rc.code = RC_FAIL;
rc.consumed = 0;
return rc;
}
*((uint8_t *)dstwc + 0) = wch >> 8;
*((uint8_t *)dstwc + 1) = wch;
}
dstwc = (uint16_t *)REALLOC(wcs, 2 * (wcs_len + 1));
if(!dstwc) {
FREEMEM(wcs);
rc.code = RC_FAIL;
rc.consumed = 0;
return rc;
} else {
dstwc[wcs_len] = 0; /* nul-terminate */
wcs = (uint32_t *)(void *)dstwc; /* Alignment OK */
}
}
FREEMEM(st->buf);
st->buf = (uint8_t *)wcs;
st->size = 2 * wcs_len;
}
return rc;
}
asn_enc_rval_t
BMPString_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
const BMPString_t *st = (const BMPString_t *)sptr;
asn_enc_rval_t er;
(void)ilevel;
(void)flags;
if(!st || !st->buf)
ASN__ENCODE_FAILED;
er.encoded = BMPString__dump(st, cb, app_key);
if(er.encoded < 0) ASN__ENCODE_FAILED;
ASN__ENCODED_OK(er);
}
int
BMPString_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
asn_app_consume_bytes_f *cb, void *app_key) {
const BMPString_t *st = (const BMPString_t *)sptr;
(void)td; /* Unused argument */
(void)ilevel; /* Unused argument */
if(!st || !st->buf)
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
if(BMPString__dump(st, cb, app_key) < 0)
return -1;
return 0;
}

View file

@ -0,0 +1,37 @@
/*-
* Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _BMPString_H_
#define _BMPString_H_
#include <OCTET_STRING.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef OCTET_STRING_t BMPString_t; /* Implemented via OCTET STRING */
extern asn_TYPE_descriptor_t asn_DEF_BMPString;
extern asn_TYPE_operation_t asn_OP_BMPString;
extern asn_OCTET_STRING_specifics_t asn_SPC_BMPString_specs;
asn_struct_print_f BMPString_print; /* Human-readable output */
asn_constr_check_f BMPString_constraint;
xer_type_decoder_f BMPString_decode_xer;
xer_type_encoder_f BMPString_encode_xer;
#define BMPString_free OCTET_STRING_free
#define BMPString_print BMPString_print
#define BMPString_compare OCTET_STRING_compare
#define BMPString_decode_ber OCTET_STRING_decode_ber
#define BMPString_encode_der OCTET_STRING_encode_der
#define BMPString_decode_uper OCTET_STRING_decode_uper
#define BMPString_encode_uper OCTET_STRING_encode_uper
#ifdef __cplusplus
}
#endif
#endif /* _BMPString_H_ */

434
euicc/asn1c/asn1/BOOLEAN.c Normal file
View file

@ -0,0 +1,434 @@
/*-
* Copyright (c) 2003, 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <asn_codecs_prim.h>
#include <BOOLEAN.h>
/*
* BOOLEAN basic type description.
*/
static const ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (1 << 2))
};
asn_TYPE_operation_t asn_OP_BOOLEAN = {
BOOLEAN_free,
BOOLEAN_print,
BOOLEAN_compare,
BOOLEAN_decode_ber,
BOOLEAN_encode_der,
BOOLEAN_decode_xer,
BOOLEAN_encode_xer,
#ifdef ASN_DISABLE_OER_SUPPORT
0,
0,
#else
BOOLEAN_decode_oer,
BOOLEAN_encode_oer,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0,
0,
#else
BOOLEAN_decode_uper, /* Unaligned PER decoder */
BOOLEAN_encode_uper, /* Unaligned PER encoder */
#endif /* ASN_DISABLE_PER_SUPPORT */
BOOLEAN_random_fill,
0 /* Use generic outmost tag fetcher */
};
asn_TYPE_descriptor_t asn_DEF_BOOLEAN = {
"BOOLEAN",
"BOOLEAN",
&asn_OP_BOOLEAN,
asn_DEF_BOOLEAN_tags,
sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
asn_DEF_BOOLEAN_tags, /* Same as above */
sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
{ 0, 0, asn_generic_no_constraint },
0, 0, /* No members */
0 /* No specifics */
};
/*
* Decode BOOLEAN type.
*/
asn_dec_rval_t
BOOLEAN_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **bool_value,
const void *buf_ptr, size_t size, int tag_mode) {
BOOLEAN_t *st = (BOOLEAN_t *)*bool_value;
asn_dec_rval_t rval;
ber_tlv_len_t length;
ber_tlv_len_t lidx;
if(st == NULL) {
st = (BOOLEAN_t *)(*bool_value = CALLOC(1, sizeof(*st)));
if(st == NULL) {
rval.code = RC_FAIL;
rval.consumed = 0;
return rval;
}
}
ASN_DEBUG("Decoding %s as BOOLEAN (tm=%d)",
td->name, tag_mode);
/*
* Check tags.
*/
rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
tag_mode, 0, &length, 0);
if(rval.code != RC_OK)
return rval;
ASN_DEBUG("Boolean length is %d bytes", (int)length);
buf_ptr = ((const char *)buf_ptr) + rval.consumed;
size -= rval.consumed;
if(length > (ber_tlv_len_t)size) {
rval.code = RC_WMORE;
rval.consumed = 0;
return rval;
}
/*
* Compute boolean value.
*/
for(*st = 0, lidx = 0;
(lidx < length) && *st == 0; lidx++) {
/*
* Very simple approach: read bytes until the end or
* value is already TRUE.
* BOOLEAN is not supposed to contain meaningful data anyway.
*/
*st |= ((const uint8_t *)buf_ptr)[lidx];
}
rval.code = RC_OK;
rval.consumed += length;
ASN_DEBUG("Took %ld/%ld bytes to encode %s, value=%d",
(long)rval.consumed, (long)length,
td->name, *st);
return rval;
}
asn_enc_rval_t
BOOLEAN_encode_der(const asn_TYPE_descriptor_t *td, const void *sptr,
int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb,
void *app_key) {
asn_enc_rval_t erval;
const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
erval.encoded = der_write_tags(td, 1, tag_mode, 0, tag, cb, app_key);
if(erval.encoded == -1) {
erval.failed_type = td;
erval.structure_ptr = sptr;
return erval;
}
if(cb) {
uint8_t bool_value;
bool_value = *st ? 0xff : 0; /* 0xff mandated by DER */
if(cb(&bool_value, 1, app_key) < 0) {
erval.encoded = -1;
erval.failed_type = td;
erval.structure_ptr = sptr;
return erval;
}
}
erval.encoded += 1;
ASN__ENCODED_OK(erval);
}
/*
* Decode the chunk of XML text encoding INTEGER.
*/
static enum xer_pbd_rval
BOOLEAN__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
const void *chunk_buf, size_t chunk_size) {
BOOLEAN_t *st = (BOOLEAN_t *)sptr;
const char *p = (const char *)chunk_buf;
(void)td;
if(chunk_size && p[0] == 0x3c /* '<' */) {
switch(xer_check_tag(chunk_buf, chunk_size, "false")) {
case XCT_BOTH:
/* "<false/>" */
*st = 0;
break;
case XCT_UNKNOWN_BO:
if(xer_check_tag(chunk_buf, chunk_size, "true")
!= XCT_BOTH)
return XPBD_BROKEN_ENCODING;
/* "<true/>" */
*st = 1; /* Or 0xff as in DER?.. */
break;
default:
return XPBD_BROKEN_ENCODING;
}
return XPBD_BODY_CONSUMED;
} else {
return XPBD_BROKEN_ENCODING;
}
}
asn_dec_rval_t
BOOLEAN_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) {
return xer_decode_primitive(opt_codec_ctx, td,
sptr, sizeof(BOOLEAN_t), opt_mname, buf_ptr, size,
BOOLEAN__xer_body_decode);
}
asn_enc_rval_t
BOOLEAN_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
asn_enc_rval_t er = {0, 0, 0};
(void)ilevel;
(void)flags;
if(!st) ASN__ENCODE_FAILED;
if(*st) {
ASN__CALLBACK("<true/>", 7);
} else {
ASN__CALLBACK("<false/>", 8);
}
ASN__ENCODED_OK(er);
cb_failed:
ASN__ENCODE_FAILED;
}
int
BOOLEAN_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
asn_app_consume_bytes_f *cb, void *app_key) {
const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
const char *buf;
size_t buflen;
(void)td; /* Unused argument */
(void)ilevel; /* Unused argument */
if(st) {
if(*st) {
buf = "TRUE";
buflen = 4;
} else {
buf = "FALSE";
buflen = 5;
}
} else {
buf = "<absent>";
buflen = 8;
}
return (cb(buf, buflen, app_key) < 0) ? -1 : 0;
}
void
BOOLEAN_free(const asn_TYPE_descriptor_t *td, void *ptr,
enum asn_struct_free_method method) {
if(td && ptr) {
switch(method) {
case ASFM_FREE_EVERYTHING:
FREEMEM(ptr);
break;
case ASFM_FREE_UNDERLYING:
break;
case ASFM_FREE_UNDERLYING_AND_RESET:
memset(ptr, 0, sizeof(BOOLEAN_t));
break;
}
}
}
#ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t
BOOLEAN_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
asn_dec_rval_t rv;
BOOLEAN_t *st = (BOOLEAN_t *)*sptr;
(void)opt_codec_ctx;
(void)td;
(void)constraints;
if(!st) {
st = (BOOLEAN_t *)(*sptr = MALLOC(sizeof(*st)));
if(!st) ASN__DECODE_FAILED;
}
/*
* Extract a single bit
*/
switch(per_get_few_bits(pd, 1)) {
case 1: *st = 1; break;
case 0: *st = 0; break;
case -1: default: ASN__DECODE_STARVED;
}
ASN_DEBUG("%s decoded as %s", td->name, *st ? "TRUE" : "FALSE");
rv.code = RC_OK;
rv.consumed = 1;
return rv;
}
asn_enc_rval_t
BOOLEAN_encode_uper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, const void *sptr,
asn_per_outp_t *po) {
const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
asn_enc_rval_t er = { 0, 0, 0 };
(void)constraints;
if(!st) ASN__ENCODE_FAILED;
if(per_put_few_bits(po, *st ? 1 : 0, 1))
ASN__ENCODE_FAILED;
ASN__ENCODED_OK(er);
}
#endif /* ASN_DISABLE_PER_SUPPORT */
#ifndef ASN_DISABLE_OER_SUPPORT
/*
* Encode as Canonical OER.
*/
asn_enc_rval_t
BOOLEAN_encode_oer(const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, const void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er = { 1, 0, 0 };
const BOOLEAN_t *st = sptr;
uint8_t bool_value = *st ? 0xff : 0; /* 0xff mandated by OER */
(void)td;
(void)constraints; /* Constraints are unused in OER */
if(cb(&bool_value, 1, app_key) < 0) {
ASN__ENCODE_FAILED;
} else {
ASN__ENCODED_OK(er);
}
}
asn_dec_rval_t
BOOLEAN_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) {
asn_dec_rval_t ok = {RC_OK, 1};
BOOLEAN_t *st;
(void)opt_codec_ctx;
(void)td;
(void)constraints; /* Constraints are unused in OER */
if(size < 1) {
ASN__DECODE_STARVED;
}
if(!(st = *sptr)) {
st = (BOOLEAN_t *)(*sptr = CALLOC(1, sizeof(*st)));
if(!st) ASN__DECODE_FAILED;
}
*st = *(const uint8_t *)ptr;
return ok;
}
#endif
int
BOOLEAN_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
const void *bptr) {
const BOOLEAN_t *a = aptr;
const BOOLEAN_t *b = bptr;
(void)td;
if(a && b) {
if(!*a == !*b) { /* TRUE can be encoded by any non-zero byte. */
return 0;
} else if(!*a) {
return -1;
} else {
return 1;
}
} else if(!a) {
return -1;
} else {
return 1;
}
}
asn_random_fill_result_t
BOOLEAN_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
const asn_encoding_constraints_t *constraints,
size_t max_length) {
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
BOOLEAN_t *st = *sptr;
if(max_length == 0) return result_skipped;
if(st == NULL) {
st = (BOOLEAN_t *)(*sptr = CALLOC(1, sizeof(*st)));
if(st == NULL) {
return result_failed;
}
}
if(!constraints || !constraints->per_constraints)
constraints = &td->encoding_constraints;
if(constraints->per_constraints) {
const asn_per_constraint_t *pc = &constraints->per_constraints->value;
if(pc->flags & APC_CONSTRAINED) {
*st = asn_random_between(pc->lower_bound, pc->upper_bound);
return result_ok;
}
}
/* Simulate booleans that are sloppily set and biased. */
switch(asn_random_between(0, 7)) {
case 0:
case 1:
case 2:
*st = 0; break;
case 3: *st = -1; break;
case 4: *st = 1; break;
case 5: *st = INT_MIN; break;
case 6: *st = INT_MAX; break;
default:
*st = asn_random_between(INT_MIN, INT_MAX);
break;
}
return result_ok;
}

View file

@ -0,0 +1,43 @@
/*-
* Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _BOOLEAN_H_
#define _BOOLEAN_H_
#include <asn_application.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* The underlying integer may contain various values, but everything
* non-zero is capped to 0xff by the DER encoder. The BER decoder may
* yield non-zero values different from 1, beware.
*/
typedef int BOOLEAN_t;
extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN;
extern asn_TYPE_operation_t asn_OP_BOOLEAN;
asn_struct_free_f BOOLEAN_free;
asn_struct_print_f BOOLEAN_print;
asn_struct_compare_f BOOLEAN_compare;
ber_type_decoder_f BOOLEAN_decode_ber;
der_type_encoder_f BOOLEAN_encode_der;
oer_type_decoder_f BOOLEAN_decode_oer;
oer_type_encoder_f BOOLEAN_encode_oer;
per_type_decoder_f BOOLEAN_decode_uper;
per_type_encoder_f BOOLEAN_encode_uper;
xer_type_decoder_f BOOLEAN_decode_xer;
xer_type_encoder_f BOOLEAN_encode_xer;
asn_random_fill_f BOOLEAN_random_fill;
#define BOOLEAN_constraint asn_generic_no_constraint
#ifdef __cplusplus
}
#endif
#endif /* _BOOLEAN_H_ */

View file

@ -0,0 +1,66 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BaseCRLNumber.h"
int
BaseCRLNumber_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const CRLNumber_t *st = (const CRLNumber_t *)sptr;
long value;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Check if the sign bit is present */
value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
if((value >= 0)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
/*
* This type is implemented using CRLNumber,
* so here we adjust the DEF accordingly.
*/
static asn_oer_constraints_t asn_OER_type_BaseCRLNumber_constr_1 CC_NOTUSED = {
{ 0, 1 } /* (0..MAX) */,
-1};
static asn_per_constraints_t asn_PER_type_BaseCRLNumber_constr_1 CC_NOTUSED = {
{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static const ber_tlv_tag_t asn_DEF_BaseCRLNumber_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn_TYPE_descriptor_t asn_DEF_BaseCRLNumber = {
"BaseCRLNumber",
"BaseCRLNumber",
&asn_OP_INTEGER,
asn_DEF_BaseCRLNumber_tags_1,
sizeof(asn_DEF_BaseCRLNumber_tags_1)
/sizeof(asn_DEF_BaseCRLNumber_tags_1[0]), /* 1 */
asn_DEF_BaseCRLNumber_tags_1, /* Same as above */
sizeof(asn_DEF_BaseCRLNumber_tags_1)
/sizeof(asn_DEF_BaseCRLNumber_tags_1[0]), /* 1 */
{ &asn_OER_type_BaseCRLNumber_constr_1, &asn_PER_type_BaseCRLNumber_constr_1, BaseCRLNumber_constraint },
0, 0, /* No members */
0 /* No specifics */
};

View file

@ -0,0 +1,43 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BaseCRLNumber_H_
#define _BaseCRLNumber_H_
#include "asn_application.h"
/* Including external dependencies */
#include "CRLNumber.h"
#ifdef __cplusplus
extern "C" {
#endif
/* BaseCRLNumber */
typedef CRLNumber_t BaseCRLNumber_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_BaseCRLNumber;
asn_struct_free_f BaseCRLNumber_free;
asn_struct_print_f BaseCRLNumber_print;
asn_constr_check_f BaseCRLNumber_constraint;
ber_type_decoder_f BaseCRLNumber_decode_ber;
der_type_encoder_f BaseCRLNumber_encode_der;
xer_type_decoder_f BaseCRLNumber_decode_xer;
xer_type_encoder_f BaseCRLNumber_encode_xer;
oer_type_decoder_f BaseCRLNumber_decode_oer;
oer_type_encoder_f BaseCRLNumber_encode_oer;
per_type_decoder_f BaseCRLNumber_decode_uper;
per_type_encoder_f BaseCRLNumber_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _BaseCRLNumber_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,66 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BaseDistance.h"
int
BaseDistance_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const INTEGER_t *st = (const INTEGER_t *)sptr;
long value;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Check if the sign bit is present */
value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
if((value >= 0)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
/*
* This type is implemented using INTEGER,
* so here we adjust the DEF accordingly.
*/
static asn_oer_constraints_t asn_OER_type_BaseDistance_constr_1 CC_NOTUSED = {
{ 0, 1 } /* (0..MAX) */,
-1};
asn_per_constraints_t asn_PER_type_BaseDistance_constr_1 CC_NOTUSED = {
{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static const ber_tlv_tag_t asn_DEF_BaseDistance_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn_TYPE_descriptor_t asn_DEF_BaseDistance = {
"BaseDistance",
"BaseDistance",
&asn_OP_INTEGER,
asn_DEF_BaseDistance_tags_1,
sizeof(asn_DEF_BaseDistance_tags_1)
/sizeof(asn_DEF_BaseDistance_tags_1[0]), /* 1 */
asn_DEF_BaseDistance_tags_1, /* Same as above */
sizeof(asn_DEF_BaseDistance_tags_1)
/sizeof(asn_DEF_BaseDistance_tags_1[0]), /* 1 */
{ &asn_OER_type_BaseDistance_constr_1, &asn_PER_type_BaseDistance_constr_1, BaseDistance_constraint },
0, 0, /* No members */
0 /* No specifics */
};

View file

@ -0,0 +1,44 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BaseDistance_H_
#define _BaseDistance_H_
#include "asn_application.h"
/* Including external dependencies */
#include "INTEGER.h"
#ifdef __cplusplus
extern "C" {
#endif
/* BaseDistance */
typedef INTEGER_t BaseDistance_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_BaseDistance_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_BaseDistance;
asn_struct_free_f BaseDistance_free;
asn_struct_print_f BaseDistance_print;
asn_constr_check_f BaseDistance_constraint;
ber_type_decoder_f BaseDistance_decode_ber;
der_type_encoder_f BaseDistance_encode_der;
xer_type_decoder_f BaseDistance_decode_xer;
xer_type_encoder_f BaseDistance_encode_xer;
oer_type_decoder_f BaseDistance_decode_oer;
oer_type_encoder_f BaseDistance_encode_oer;
per_type_decoder_f BaseDistance_decode_uper;
per_type_encoder_f BaseDistance_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _BaseDistance_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,120 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BasicConstraints.h"
static int
memb_pathLenConstraint_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const INTEGER_t *st = (const INTEGER_t *)sptr;
long value;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Check if the sign bit is present */
value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
if((value >= 0)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_memb_pathLenConstraint_constr_3 CC_NOTUSED = {
{ 0, 1 } /* (0..MAX) */,
-1};
static asn_per_constraints_t asn_PER_memb_pathLenConstraint_constr_3 CC_NOTUSED = {
{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static int asn_DFL_2_cmp_0(const void *sptr) {
const BOOLEAN_t *st = sptr;
if(!st) {
return -1; /* No value is not a default value */
}
/* Test default value 0 */
return (*st != 0);
}
static int asn_DFL_2_set_0(void **sptr) {
BOOLEAN_t *st = *sptr;
if(!st) {
st = (*sptr = CALLOC(1, sizeof(*st)));
if(!st) return -1;
}
/* Install default value 0 */
*st = 0;
return 0;
}
static asn_TYPE_member_t asn_MBR_BasicConstraints_1[] = {
{ ATF_NOFLAGS, 2, offsetof(struct BasicConstraints, cA),
(ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
0,
&asn_DEF_BOOLEAN,
0,
{ 0, 0, 0 },
&asn_DFL_2_cmp_0, /* Compare DEFAULT 0 */
&asn_DFL_2_set_0, /* Set DEFAULT 0 */
"cA"
},
{ ATF_POINTER, 1, offsetof(struct BasicConstraints, pathLenConstraint),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_INTEGER,
0,
{ &asn_OER_memb_pathLenConstraint_constr_3, &asn_PER_memb_pathLenConstraint_constr_3, memb_pathLenConstraint_constraint_1 },
0, 0, /* No default value */
"pathLenConstraint"
},
};
static const int asn_MAP_BasicConstraints_oms_1[] = { 0, 1 };
static const ber_tlv_tag_t asn_DEF_BasicConstraints_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_BasicConstraints_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* cA */
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 } /* pathLenConstraint */
};
static asn_SEQUENCE_specifics_t asn_SPC_BasicConstraints_specs_1 = {
sizeof(struct BasicConstraints),
offsetof(struct BasicConstraints, _asn_ctx),
asn_MAP_BasicConstraints_tag2el_1,
2, /* Count of tags in the map */
asn_MAP_BasicConstraints_oms_1, /* Optional members */
2, 0, /* Root/Additions */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_BasicConstraints = {
"BasicConstraints",
"BasicConstraints",
&asn_OP_SEQUENCE,
asn_DEF_BasicConstraints_tags_1,
sizeof(asn_DEF_BasicConstraints_tags_1)
/sizeof(asn_DEF_BasicConstraints_tags_1[0]), /* 1 */
asn_DEF_BasicConstraints_tags_1, /* Same as above */
sizeof(asn_DEF_BasicConstraints_tags_1)
/sizeof(asn_DEF_BasicConstraints_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_BasicConstraints_1,
2, /* Elements count */
&asn_SPC_BasicConstraints_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,40 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Implicit88"
* found in "../../../asn1/PKIXImplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BasicConstraints_H_
#define _BasicConstraints_H_
#include "asn_application.h"
/* Including external dependencies */
#include "BOOLEAN.h"
#include "INTEGER.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* BasicConstraints */
typedef struct BasicConstraints {
BOOLEAN_t cA /* DEFAULT FALSE */;
INTEGER_t *pathLenConstraint /* OPTIONAL */;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} BasicConstraints_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_BasicConstraints;
#ifdef __cplusplus
}
#endif
#endif /* _BasicConstraints_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,93 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BoundProfilePackage.h"
asn_TYPE_member_t asn_MBR_BoundProfilePackage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct BoundProfilePackage, initialiseSecureChannelRequest),
(ASN_TAG_CLASS_CONTEXT | (35 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_InitialiseSecureChannelRequest,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"initialiseSecureChannelRequest"
},
{ ATF_NOFLAGS, 0, offsetof(struct BoundProfilePackage, firstSequenceOf87),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
0,
&asn_DEF_SeqBoundProfilePackageTLV87,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"firstSequenceOf87"
},
{ ATF_NOFLAGS, 0, offsetof(struct BoundProfilePackage, sequenceOf88),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
0,
&asn_DEF_SeqBoundProfilePackageTLV88,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"sequenceOf88"
},
{ ATF_POINTER, 1, offsetof(struct BoundProfilePackage, secondSequenceOf87),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
0,
&asn_DEF_SeqSecondBoundProfilePackageTLV87,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"secondSequenceOf87"
},
{ ATF_NOFLAGS, 0, offsetof(struct BoundProfilePackage, sequenceOf86),
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
0,
&asn_DEF_SeqBoundProfilePackageTLV86,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"sequenceOf86"
},
};
static const int asn_MAP_BoundProfilePackage_oms_1[] = { 3 };
static const ber_tlv_tag_t asn_DEF_BoundProfilePackage_tags_1[] = {
(ASN_TAG_CLASS_CONTEXT | (54 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_BoundProfilePackage_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* firstSequenceOf87 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 }, /* sequenceOf88 */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 3, 0, 0 }, /* secondSequenceOf87 */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 4, 0, 0 }, /* sequenceOf86 */
{ (ASN_TAG_CLASS_CONTEXT | (35 << 2)), 0, 0, 0 } /* initialiseSecureChannelRequest */
};
asn_SEQUENCE_specifics_t asn_SPC_BoundProfilePackage_specs_1 = {
sizeof(struct BoundProfilePackage),
offsetof(struct BoundProfilePackage, _asn_ctx),
asn_MAP_BoundProfilePackage_tag2el_1,
5, /* Count of tags in the map */
asn_MAP_BoundProfilePackage_oms_1, /* Optional members */
1, 0, /* Root/Additions */
5, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_BoundProfilePackage = {
"BoundProfilePackage",
"BoundProfilePackage",
&asn_OP_SEQUENCE,
asn_DEF_BoundProfilePackage_tags_1,
sizeof(asn_DEF_BoundProfilePackage_tags_1)
/sizeof(asn_DEF_BoundProfilePackage_tags_1[0]) - 1, /* 1 */
asn_DEF_BoundProfilePackage_tags_1, /* Same as above */
sizeof(asn_DEF_BoundProfilePackage_tags_1)
/sizeof(asn_DEF_BoundProfilePackage_tags_1[0]), /* 2 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_BoundProfilePackage_1,
5, /* Elements count */
&asn_SPC_BoundProfilePackage_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,57 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BoundProfilePackage_H_
#define _BoundProfilePackage_H_
#include "asn_application.h"
/* Including external dependencies */
#include "InitialiseSecureChannelRequest.h"
#include "SeqBoundProfilePackageTLV87.h"
#include "SeqBoundProfilePackageTLV88.h"
#include "SeqBoundProfilePackageTLV86.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct SeqSecondBoundProfilePackageTLV87;
/* BoundProfilePackage */
typedef struct BoundProfilePackage {
InitialiseSecureChannelRequest_t initialiseSecureChannelRequest;
SeqBoundProfilePackageTLV87_t firstSequenceOf87;
SeqBoundProfilePackageTLV88_t sequenceOf88;
struct SeqSecondBoundProfilePackageTLV87 *secondSequenceOf87 /* OPTIONAL */;
SeqBoundProfilePackageTLV86_t sequenceOf86;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} BoundProfilePackage_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_BoundProfilePackage;
extern asn_SEQUENCE_specifics_t asn_SPC_BoundProfilePackage_specs_1;
extern asn_TYPE_member_t asn_MBR_BoundProfilePackage_1[5];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "SeqSecondBoundProfilePackageTLV87.h"
#endif /* _BoundProfilePackage_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,32 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BoundProfilePackageTLV86.h"
/*
* This type is implemented using OCTET_STRING,
* so here we adjust the DEF accordingly.
*/
static const ber_tlv_tag_t asn_DEF_BoundProfilePackageTLV86_tags_1[] = {
(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
};
asn_TYPE_descriptor_t asn_DEF_BoundProfilePackageTLV86 = {
"BoundProfilePackageTLV86",
"BoundProfilePackageTLV86",
&asn_OP_OCTET_STRING,
asn_DEF_BoundProfilePackageTLV86_tags_1,
sizeof(asn_DEF_BoundProfilePackageTLV86_tags_1)
/sizeof(asn_DEF_BoundProfilePackageTLV86_tags_1[0]) - 1, /* 1 */
asn_DEF_BoundProfilePackageTLV86_tags_1, /* Same as above */
sizeof(asn_DEF_BoundProfilePackageTLV86_tags_1)
/sizeof(asn_DEF_BoundProfilePackageTLV86_tags_1[0]), /* 2 */
{ 0, 0, OCTET_STRING_constraint },
0, 0, /* No members */
&asn_SPC_OCTET_STRING_specs /* Additional specs */
};

View file

@ -0,0 +1,43 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BoundProfilePackageTLV86_H_
#define _BoundProfilePackageTLV86_H_
#include "asn_application.h"
/* Including external dependencies */
#include "OCTET_STRING.h"
#ifdef __cplusplus
extern "C" {
#endif
/* BoundProfilePackageTLV86 */
typedef OCTET_STRING_t BoundProfilePackageTLV86_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_BoundProfilePackageTLV86;
asn_struct_free_f BoundProfilePackageTLV86_free;
asn_struct_print_f BoundProfilePackageTLV86_print;
asn_constr_check_f BoundProfilePackageTLV86_constraint;
ber_type_decoder_f BoundProfilePackageTLV86_decode_ber;
der_type_encoder_f BoundProfilePackageTLV86_encode_der;
xer_type_decoder_f BoundProfilePackageTLV86_decode_xer;
xer_type_encoder_f BoundProfilePackageTLV86_encode_xer;
oer_type_decoder_f BoundProfilePackageTLV86_decode_oer;
oer_type_encoder_f BoundProfilePackageTLV86_encode_oer;
per_type_decoder_f BoundProfilePackageTLV86_decode_uper;
per_type_encoder_f BoundProfilePackageTLV86_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _BoundProfilePackageTLV86_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,32 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BoundProfilePackageTLV87.h"
/*
* This type is implemented using OCTET_STRING,
* so here we adjust the DEF accordingly.
*/
static const ber_tlv_tag_t asn_DEF_BoundProfilePackageTLV87_tags_1[] = {
(ASN_TAG_CLASS_CONTEXT | (7 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
};
asn_TYPE_descriptor_t asn_DEF_BoundProfilePackageTLV87 = {
"BoundProfilePackageTLV87",
"BoundProfilePackageTLV87",
&asn_OP_OCTET_STRING,
asn_DEF_BoundProfilePackageTLV87_tags_1,
sizeof(asn_DEF_BoundProfilePackageTLV87_tags_1)
/sizeof(asn_DEF_BoundProfilePackageTLV87_tags_1[0]) - 1, /* 1 */
asn_DEF_BoundProfilePackageTLV87_tags_1, /* Same as above */
sizeof(asn_DEF_BoundProfilePackageTLV87_tags_1)
/sizeof(asn_DEF_BoundProfilePackageTLV87_tags_1[0]), /* 2 */
{ 0, 0, OCTET_STRING_constraint },
0, 0, /* No members */
&asn_SPC_OCTET_STRING_specs /* Additional specs */
};

View file

@ -0,0 +1,43 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BoundProfilePackageTLV87_H_
#define _BoundProfilePackageTLV87_H_
#include "asn_application.h"
/* Including external dependencies */
#include "OCTET_STRING.h"
#ifdef __cplusplus
extern "C" {
#endif
/* BoundProfilePackageTLV87 */
typedef OCTET_STRING_t BoundProfilePackageTLV87_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_BoundProfilePackageTLV87;
asn_struct_free_f BoundProfilePackageTLV87_free;
asn_struct_print_f BoundProfilePackageTLV87_print;
asn_constr_check_f BoundProfilePackageTLV87_constraint;
ber_type_decoder_f BoundProfilePackageTLV87_decode_ber;
der_type_encoder_f BoundProfilePackageTLV87_encode_der;
xer_type_decoder_f BoundProfilePackageTLV87_decode_xer;
xer_type_encoder_f BoundProfilePackageTLV87_encode_xer;
oer_type_decoder_f BoundProfilePackageTLV87_decode_oer;
oer_type_encoder_f BoundProfilePackageTLV87_encode_oer;
per_type_decoder_f BoundProfilePackageTLV87_decode_uper;
per_type_encoder_f BoundProfilePackageTLV87_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _BoundProfilePackageTLV87_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,32 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BoundProfilePackageTLV88.h"
/*
* This type is implemented using OCTET_STRING,
* so here we adjust the DEF accordingly.
*/
static const ber_tlv_tag_t asn_DEF_BoundProfilePackageTLV88_tags_1[] = {
(ASN_TAG_CLASS_CONTEXT | (8 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
};
asn_TYPE_descriptor_t asn_DEF_BoundProfilePackageTLV88 = {
"BoundProfilePackageTLV88",
"BoundProfilePackageTLV88",
&asn_OP_OCTET_STRING,
asn_DEF_BoundProfilePackageTLV88_tags_1,
sizeof(asn_DEF_BoundProfilePackageTLV88_tags_1)
/sizeof(asn_DEF_BoundProfilePackageTLV88_tags_1[0]) - 1, /* 1 */
asn_DEF_BoundProfilePackageTLV88_tags_1, /* Same as above */
sizeof(asn_DEF_BoundProfilePackageTLV88_tags_1)
/sizeof(asn_DEF_BoundProfilePackageTLV88_tags_1[0]), /* 2 */
{ 0, 0, OCTET_STRING_constraint },
0, 0, /* No members */
&asn_SPC_OCTET_STRING_specs /* Additional specs */
};

View file

@ -0,0 +1,43 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BoundProfilePackageTLV88_H_
#define _BoundProfilePackageTLV88_H_
#include "asn_application.h"
/* Including external dependencies */
#include "OCTET_STRING.h"
#ifdef __cplusplus
extern "C" {
#endif
/* BoundProfilePackageTLV88 */
typedef OCTET_STRING_t BoundProfilePackageTLV88_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_BoundProfilePackageTLV88;
asn_struct_free_f BoundProfilePackageTLV88_free;
asn_struct_print_f BoundProfilePackageTLV88_print;
asn_constr_check_f BoundProfilePackageTLV88_constraint;
ber_type_decoder_f BoundProfilePackageTLV88_decode_ber;
der_type_encoder_f BoundProfilePackageTLV88_encode_der;
xer_type_decoder_f BoundProfilePackageTLV88_decode_xer;
xer_type_encoder_f BoundProfilePackageTLV88_encode_xer;
oer_type_decoder_f BoundProfilePackageTLV88_decode_oer;
oer_type_encoder_f BoundProfilePackageTLV88_encode_oer;
per_type_decoder_f BoundProfilePackageTLV88_decode_uper;
per_type_encoder_f BoundProfilePackageTLV88_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _BoundProfilePackageTLV88_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,31 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BppCommandId.h"
/*
* This type is implemented using INTEGER,
* so here we adjust the DEF accordingly.
*/
static const ber_tlv_tag_t asn_DEF_BppCommandId_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn_TYPE_descriptor_t asn_DEF_BppCommandId = {
"BppCommandId",
"BppCommandId",
&asn_OP_INTEGER,
asn_DEF_BppCommandId_tags_1,
sizeof(asn_DEF_BppCommandId_tags_1)
/sizeof(asn_DEF_BppCommandId_tags_1[0]), /* 1 */
asn_DEF_BppCommandId_tags_1, /* Same as above */
sizeof(asn_DEF_BppCommandId_tags_1)
/sizeof(asn_DEF_BppCommandId_tags_1[0]), /* 1 */
{ 0, 0, INTEGER_constraint },
0, 0, /* Defined elsewhere */
0 /* No specifics */
};

View file

@ -0,0 +1,53 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "RSPDefinitions"
* found in "../../../asn1/rsp.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BppCommandId_H_
#define _BppCommandId_H_
#include "asn_application.h"
/* Including external dependencies */
#include "INTEGER.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum BppCommandId {
BppCommandId_initialiseSecureChannel = 0,
BppCommandId_configureISDP = 1,
BppCommandId_storeMetadata = 2,
BppCommandId_storeMetadata2 = 3,
BppCommandId_replaceSessionKeys = 4,
BppCommandId_loadProfileElements = 5
} e_BppCommandId;
/* BppCommandId */
typedef INTEGER_t BppCommandId_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_BppCommandId;
asn_struct_free_f BppCommandId_free;
asn_struct_print_f BppCommandId_print;
asn_constr_check_f BppCommandId_constraint;
ber_type_decoder_f BppCommandId_decode_ber;
der_type_encoder_f BppCommandId_encode_der;
xer_type_decoder_f BppCommandId_decode_xer;
xer_type_encoder_f BppCommandId_encode_xer;
oer_type_decoder_f BppCommandId_decode_oer;
oer_type_encoder_f BppCommandId_encode_oer;
per_type_decoder_f BppCommandId_decode_uper;
per_type_encoder_f BppCommandId_encode_uper;
#ifdef __cplusplus
}
#endif
#endif /* _BppCommandId_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,216 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BuiltInDomainDefinedAttribute.h"
static const int permitted_alphabet_table_2[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9, /* . '() +,-./ */
10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22, /* 0123456789: = ? */
0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37, /* ABCDEFGHIJKLMNO */
38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, /* abcdefghijklmno */
64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
};
static const int permitted_alphabet_code2value_2[74] = {
32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
113,114,115,116,117,118,119,120,121,122,};
static int check_permitted_alphabet_2(const void *sptr) {
const int *table = permitted_alphabet_table_2;
/* The underlying type is PrintableString */
const PrintableString_t *st = (const PrintableString_t *)sptr;
const uint8_t *ch = st->buf;
const uint8_t *end = ch + st->size;
for(; ch < end; ch++) {
uint8_t cv = *ch;
if(!table[cv]) return -1;
}
return 0;
}
static const int permitted_alphabet_table_3[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9, /* . '() +,-./ */
10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22, /* 0123456789: = ? */
0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37, /* ABCDEFGHIJKLMNO */
38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, /* abcdefghijklmno */
64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
};
static const int permitted_alphabet_code2value_3[74] = {
32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
113,114,115,116,117,118,119,120,121,122,};
static int check_permitted_alphabet_3(const void *sptr) {
const int *table = permitted_alphabet_table_3;
/* The underlying type is PrintableString */
const PrintableString_t *st = (const PrintableString_t *)sptr;
const uint8_t *ch = st->buf;
const uint8_t *end = ch + st->size;
for(; ch < end; ch++) {
uint8_t cv = *ch;
if(!table[cv]) return -1;
}
return 0;
}
static int
memb_type_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const PrintableString_t *st = (const PrintableString_t *)sptr;
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
size = st->size;
if((size >= 1 && size <= 8)
&& !check_permitted_alphabet_2(st)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int asn_PER_MAP_type_2_v2c(unsigned int value) {
if(value >= sizeof(permitted_alphabet_table_2)/sizeof(permitted_alphabet_table_2[0]))
return -1;
return permitted_alphabet_table_2[value] - 1;
}
static int asn_PER_MAP_type_2_c2v(unsigned int code) {
if(code >= sizeof(permitted_alphabet_code2value_2)/sizeof(permitted_alphabet_code2value_2[0]))
return -1;
return permitted_alphabet_code2value_2[code];
}
static int
memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const PrintableString_t *st = (const PrintableString_t *)sptr;
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
size = st->size;
if((size >= 1 && size <= 128)
&& !check_permitted_alphabet_3(st)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int asn_PER_MAP_value_3_v2c(unsigned int value) {
if(value >= sizeof(permitted_alphabet_table_3)/sizeof(permitted_alphabet_table_3[0]))
return -1;
return permitted_alphabet_table_3[value] - 1;
}
static int asn_PER_MAP_value_3_c2v(unsigned int code) {
if(code >= sizeof(permitted_alphabet_code2value_3)/sizeof(permitted_alphabet_code2value_3[0]))
return -1;
return permitted_alphabet_code2value_3[code];
}
static asn_oer_constraints_t asn_OER_memb_type_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..8)) */};
static asn_per_constraints_t asn_PER_memb_type_constr_2 CC_NOTUSED = {
{ APC_CONSTRAINED, 7, 7, 32, 122 } /* (32..122) */,
{ APC_CONSTRAINED, 3, 3, 1, 8 } /* (SIZE(1..8)) */,
asn_PER_MAP_type_2_v2c, /* Value to PER code map */
asn_PER_MAP_type_2_c2v /* PER code to value map */
};
static asn_oer_constraints_t asn_OER_memb_value_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..128)) */};
static asn_per_constraints_t asn_PER_memb_value_constr_3 CC_NOTUSED = {
{ APC_CONSTRAINED, 7, 7, 32, 122 } /* (32..122) */,
{ APC_CONSTRAINED, 7, 7, 1, 128 } /* (SIZE(1..128)) */,
asn_PER_MAP_value_3_v2c, /* Value to PER code map */
asn_PER_MAP_value_3_c2v /* PER code to value map */
};
asn_TYPE_member_t asn_MBR_BuiltInDomainDefinedAttribute_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct BuiltInDomainDefinedAttribute, type),
(ASN_TAG_CLASS_UNIVERSAL | (19 << 2)),
0,
&asn_DEF_PrintableString,
0,
{ &asn_OER_memb_type_constr_2, &asn_PER_memb_type_constr_2, memb_type_constraint_1 },
0, 0, /* No default value */
"type"
},
{ ATF_NOFLAGS, 0, offsetof(struct BuiltInDomainDefinedAttribute, value),
(ASN_TAG_CLASS_UNIVERSAL | (19 << 2)),
0,
&asn_DEF_PrintableString,
0,
{ &asn_OER_memb_value_constr_3, &asn_PER_memb_value_constr_3, memb_value_constraint_1 },
0, 0, /* No default value */
"value"
},
};
static const ber_tlv_tag_t asn_DEF_BuiltInDomainDefinedAttribute_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_BuiltInDomainDefinedAttribute_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (19 << 2)), 0, 0, 1 }, /* type */
{ (ASN_TAG_CLASS_UNIVERSAL | (19 << 2)), 1, -1, 0 } /* value */
};
asn_SEQUENCE_specifics_t asn_SPC_BuiltInDomainDefinedAttribute_specs_1 = {
sizeof(struct BuiltInDomainDefinedAttribute),
offsetof(struct BuiltInDomainDefinedAttribute, _asn_ctx),
asn_MAP_BuiltInDomainDefinedAttribute_tag2el_1,
2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_BuiltInDomainDefinedAttribute = {
"BuiltInDomainDefinedAttribute",
"BuiltInDomainDefinedAttribute",
&asn_OP_SEQUENCE,
asn_DEF_BuiltInDomainDefinedAttribute_tags_1,
sizeof(asn_DEF_BuiltInDomainDefinedAttribute_tags_1)
/sizeof(asn_DEF_BuiltInDomainDefinedAttribute_tags_1[0]), /* 1 */
asn_DEF_BuiltInDomainDefinedAttribute_tags_1, /* Same as above */
sizeof(asn_DEF_BuiltInDomainDefinedAttribute_tags_1)
/sizeof(asn_DEF_BuiltInDomainDefinedAttribute_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_BuiltInDomainDefinedAttribute_1,
2, /* Elements count */
&asn_SPC_BuiltInDomainDefinedAttribute_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,41 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BuiltInDomainDefinedAttribute_H_
#define _BuiltInDomainDefinedAttribute_H_
#include "asn_application.h"
/* Including external dependencies */
#include "PrintableString.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* BuiltInDomainDefinedAttribute */
typedef struct BuiltInDomainDefinedAttribute {
PrintableString_t type;
PrintableString_t value;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} BuiltInDomainDefinedAttribute_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_BuiltInDomainDefinedAttribute;
extern asn_SEQUENCE_specifics_t asn_SPC_BuiltInDomainDefinedAttribute_specs_1;
extern asn_TYPE_member_t asn_MBR_BuiltInDomainDefinedAttribute_1[2];
#ifdef __cplusplus
}
#endif
#endif /* _BuiltInDomainDefinedAttribute_H_ */
#include "asn_internal.h"

View file

@ -0,0 +1,52 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#include "BuiltInDomainDefinedAttributes.h"
static asn_oer_constraints_t asn_OER_type_BuiltInDomainDefinedAttributes_constr_1 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..4)) */};
asn_per_constraints_t asn_PER_type_BuiltInDomainDefinedAttributes_constr_1 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
0, 0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_BuiltInDomainDefinedAttributes_1[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_BuiltInDomainDefinedAttribute,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_BuiltInDomainDefinedAttributes_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn_SET_OF_specifics_t asn_SPC_BuiltInDomainDefinedAttributes_specs_1 = {
sizeof(struct BuiltInDomainDefinedAttributes),
offsetof(struct BuiltInDomainDefinedAttributes, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
asn_TYPE_descriptor_t asn_DEF_BuiltInDomainDefinedAttributes = {
"BuiltInDomainDefinedAttributes",
"BuiltInDomainDefinedAttributes",
&asn_OP_SEQUENCE_OF,
asn_DEF_BuiltInDomainDefinedAttributes_tags_1,
sizeof(asn_DEF_BuiltInDomainDefinedAttributes_tags_1)
/sizeof(asn_DEF_BuiltInDomainDefinedAttributes_tags_1[0]), /* 1 */
asn_DEF_BuiltInDomainDefinedAttributes_tags_1, /* Same as above */
sizeof(asn_DEF_BuiltInDomainDefinedAttributes_tags_1)
/sizeof(asn_DEF_BuiltInDomainDefinedAttributes_tags_1[0]), /* 1 */
{ &asn_OER_type_BuiltInDomainDefinedAttributes_constr_1, &asn_PER_type_BuiltInDomainDefinedAttributes_constr_1, SEQUENCE_OF_constraint },
asn_MBR_BuiltInDomainDefinedAttributes_1,
1, /* Single element */
&asn_SPC_BuiltInDomainDefinedAttributes_specs_1 /* Additional specs */
};

View file

@ -0,0 +1,47 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "PKIX1Explicit88"
* found in "../../../asn1/PKIXExplicit88.asn"
* `asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example`
*/
#ifndef _BuiltInDomainDefinedAttributes_H_
#define _BuiltInDomainDefinedAt