docs: upgrade ASN.1 definitions to SGP.22 v2.2.2 (#87)

This commit is contained in:
septs 2024-05-09 19:42:52 +08:00 committed by GitHub
parent c632f86b22
commit 4cbadb5d5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 190 additions and 184 deletions

View file

@ -1,3 +0,0 @@
asn1c -fwide-types -fcompound-names -fincludes-quoted -no-gen-example ../../../asn1/PKIXExplicit88.asn ../../../asn1/PKIXImplicit88.asn ../../../asn1/rsp.asn
find "." -type f \( -name "*.c" -o -name "*.h" \) | while read -r file; do for header in $(find "." -type f -name "*.h"); do header_file=$(basename "$header"); sed -i "/#include <${header_file}>/c\#include \"${header_file}\"" "$file"; done; done

View file

@ -11,12 +11,15 @@ id-rsp OBJECT IDENTIFIER ::= {joint-iso-itu-t(2) international-organizations(23)
-- Basic types, for size constraints
Octet8 ::= OCTET STRING (SIZE(8))
Octet4 ::= OCTET STRING (SIZE(4))
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.
-- If revision is not used (e.g. v2.1), byte 3 SHALL be set to '00'.
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))
@ -63,7 +66,8 @@ 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
testProfileSupport (3), -- support for test profile
deviceInfoExtensibilitySupport (4) -- support for ASN.1 extensibility in the Device Info
}
-- Definition of CertificationDataObject
@ -107,12 +111,19 @@ UICCCapability ::= BIT STRING {
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
}
multipleCsimSupport(18), -- Multiple CSIM applications are supported within the same Profile
berTlvFileSupport(19), -- BER TLV files
dfLinkSupport(20), -- Linked Directory Files
catTp(21), -- Support of CAT TP
getIdentity(22), -- Support of the GET IDENTITY command as defined in ETSI TS 102 221 [6]
profile-a-x25519(23), -- Support of ECIES Profile A as defined in 3GPP TS 33.501 [87]
profile-b-p256(24), -- Support of ECIES Profile B as defined in 3GPP TS 33.501 [87]
suciCalculatorApi(25) -- Support of the associated API for SUCI derivation as defined in 3GPP 31.130 [88]
}
-- Definition of DeviceInfo
DeviceInfo ::= SEQUENCE {
tac Octet8,
tac Octet4,
deviceCapabilities DeviceCapabilities,
imei Octet8 OPTIONAL
}
@ -124,10 +135,12 @@ DeviceCapabilities ::= SEQUENCE { -- Highest fully supported release for each de
cdma2000onexSupportedRelease VersionType OPTIONAL,
cdma2000hrpdSupportedRelease VersionType OPTIONAL,
cdma2000ehrpdSupportedRelease VersionType OPTIONAL,
eutranSupportedRelease VersionType OPTIONAL,
eutranEpcSupportedRelease VersionType OPTIONAL,
contactlessSupportedRelease VersionType OPTIONAL,
rspCrlSupportedVersion VersionType OPTIONAL,
rspRpmSupportedVersion VersionType OPTIONAL
nrEpcSupportedRelease VersionType OPTIONAL,
nr5gcSupportedRelease VersionType OPTIONAL,
eutran5gcSupportedRelease VersionType OPTIONAL
}
ProfileInfoListRequest ::= [45] SEQUENCE { -- Tag 'BF2D'
@ -154,9 +167,9 @@ ProfileInfo ::= [PRIVATE 3] SEQUENCE { -- Tag 'E3'
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'
profileClass [21] ProfileClass OPTIONAL, -- Tag '95'
notificationConfigurationInfo [22] SEQUENCE OF NotificationConfigurationInformation OPTIONAL, -- Tag 'B6'
profileOwner [23] OperatorID OPTIONAL, -- Tag 'B7'
profileOwner [23] OperatorId OPTIONAL, -- Tag 'B7'
dpProprietaryData [24] DpProprietaryData OPTIONAL, -- Tag 'B8'
profilePolicyRules [25] PprIds OPTIONAL, -- Tag '99'
refArDo [118] SEQUENCE OF RefArDo OPTIONAL -- Tag 'BF76'
@ -175,11 +188,10 @@ RefArDo ::= [PRIVATE 2] SEQUENCE { -- Tag 'E2'
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'
ppr2(2) -- Indicator for PPR2 'Deletion of this Profile is not allowed'
}
OperatorID ::= SEQUENCE {
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]
@ -195,9 +207,9 @@ StoreMetadataRequest ::= [37] SEQUENCE { -- Tag 'BF25'
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')
profileClass [21] ProfileClass DEFAULT operational, -- Tag '95'
notificationConfigurationInfo [22] SEQUENCE OF NotificationConfigurationInformation OPTIONAL,
profileOwner [23] OperatorID OPTIONAL, -- Tag 'B7'
profileOwner [23] OperatorId OPTIONAL, -- Tag 'B7'
profilePolicyRules [25] PprIds OPTIONAL -- Tag '99'
}
@ -235,7 +247,7 @@ PrepareDownloadRequest ::= [33] SEQUENCE { -- Tag 'BF21'
}
SmdpSigned2 ::= SEQUENCE {
transactionId [0] TransactionId, -- The TransactionID generated by the SM DP+
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'
}
@ -266,7 +278,7 @@ DownloadErrorCode ::= INTEGER {invalidCertificate(1), invalidSignature(2), unsup
-- Definition of data objects for command AuthenticateServer--------------------
AuthenticateServerRequest ::= [56] SEQUENCE { -- Tag 'BF38'
serverSigned1 ServerSigned1, -- Signed information
serverSignature1 [APPLICATION 55] OCTET STRING, -- tag ?5F37?
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
@ -280,7 +292,7 @@ ServerSigned1 ::= SEQUENCE {
}
CtxParams1 ::= CHOICE {
ctxParamsForCommonAuthentication CtxParamsForCommonAuthentication -- New contextual data objects may be defined for extensibility
ctxParamsForCommonAuthentication CtxParamsForCommonAuthentication -- New contextual data objects MAY be defined for extensibility
}
CtxParamsForCommonAuthentication ::= SEQUENCE {
@ -321,7 +333,7 @@ CancelSessionRequest ::= [65] SEQUENCE { -- Tag 'BF41'
reason CancelSessionReason
}
CancelSessionReason ::= INTEGER {endUserRejection(0), postponed(1), timeout(2), pprNotAllowed(3)}
CancelSessionReason ::= INTEGER {endUserRejection(0), postponed(1), timeout(2), pprNotAllowed(3), metadataMismatch(4), loadBppExecutionError(5), undefinedReason(127)}
CancelSessionResponse ::= [65] CHOICE { -- Tag 'BF41'
cancelSessionResponseOk CancelSessionResponseOk,
@ -339,23 +351,13 @@ EuiccCancelSessionSigned ::= SEQUENCE {
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
firstSequenceOf87 [0] SEQUENCE OF [7] OCTET STRING, -- sequence of '87' TLVs
sequenceOf88 [1] SEQUENCE OF [8] OCTET STRING, -- sequence of '88' TLVs
secondSequenceOf87 [2] SEQUENCE OF [7] OCTET STRING OPTIONAL, -- sequence of '87' TLVs
sequenceOf86 [3] SEQUENCE OF [6] OCTET STRING -- sequence of '86' TLVs
}
-- Definition of Get eUICC Challenge --------------------------
@ -366,7 +368,7 @@ GetEuiccChallengeResponse ::= [46] SEQUENCE { -- Tag 'BF2E'
euiccChallenge Octet16 -- random eUICC challenge
}
-- Definition of Profile Installation Resulceipt
-- Definition of Profile Installation Result
ProfileInstallationResult ::= [55] SEQUENCE { -- Tag 'BF37'
profileInstallationResultData [39] ProfileInstallationResultData,
euiccSignPIR EuiccSignPIR
@ -375,14 +377,14 @@ ProfileInstallationResult ::= [55] SEQUENCE { -- Tag 'BF37'
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)
smdpOid OBJECT IDENTIFIER, -- 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
EuiccSignPIR ::= [APPLICATION 55] OCTET STRING -- Tag '5F37', eUICCs signature
SuccessResult ::= SEQUENCE {
aid [APPLICATION 15] OCTET STRING (SIZE (5..16)), -- AID of ISD-P
@ -409,7 +411,7 @@ ErrorReason ::= INTEGER {
installFailedDueToIccidAlreadyExistsOnEuicc(9), installFailedDueToInsufficientMemoryForProfile(10),
installFailedDueToInterruption(11),
installFailedDueToPEProcessingError (12),
installFailedDueToIccidMismatch(13),
installFailedDueToDataMismatch(13),
testProfileInstallFailedDueToInvalidNaaKey(14),
pprNotAllowed(15),
installFailedDueToUnknownError(127)
@ -426,7 +428,7 @@ ListNotificationResponse ::= [40] CHOICE { -- Tag 'BF28'
NotificationMetadata ::= [47] SEQUENCE { -- Tag 'BF2F'
seqNumber [0] INTEGER,
profileManagementOperation [1] NotificationEvent, --Only one bit set to 1
profileManagementOperation [1] NotificationEvent, --Only one bit SHALL be set to 1
notificationAddress UTF8String, -- FQDN to forward the notification
iccid Iccid OPTIONAL
}
@ -536,7 +538,7 @@ EnableProfileRequest ::= [49] SEQUENCE { -- Tag 'BF31'
}
EnableProfileResponse ::= [49] SEQUENCE { -- Tag 'BF31'
enableResult INTEGER {ok(0), iccidOrAidNotFound (1), profileNotInDisabledState(2), disallowedByPolicy(3), wrongProfileReenabling(4), undefinedError(127)}
enableResult INTEGER {ok(0), iccidOrAidNotFound (1), profileNotInDisabledState(2), disallowedByPolicy(3), wrongProfileReenabling(4), catBusy(5), undefinedError(127)}
}
-- Definition of Disable Profile --------------------------
@ -549,7 +551,7 @@ DisableProfileRequest ::= [50] SEQUENCE { -- Tag 'BF32'
}
DisableProfileResponse ::= [50] SEQUENCE { -- Tag 'BF32'
disableResult INTEGER {ok(0), iccidOrAidNotFound (1), profileNotInEnabledState(2), disallowedByPolicy(3), undefinedError(127)}
disableResult INTEGER {ok(0), iccidOrAidNotFound (1), profileNotInEnabledState(2), disallowedByPolicy(3), catBusy(5), undefinedError(127)}
}
-- Definition of Delete Profile --------------------------
@ -571,7 +573,7 @@ EuiccMemoryResetRequest ::= [52] SEQUENCE { -- Tag 'BF34'
}
EuiccMemoryResetResponse ::= [52] SEQUENCE { -- Tag 'BF34'
resetResult INTEGER {ok(0), nothingToDelete(1), undefinedError(127)}
resetResult INTEGER {ok(0), nothingToDelete(1), catBusy(5), undefinedError(127)}
}
-- Definition of Get EID --------------------------
@ -597,13 +599,15 @@ GetRatResponse ::= [67] SEQUENCE { -- Tag 'BF43'
RulesAuthorisationTable ::= SEQUENCE OF ProfilePolicyAuthorisationRule
ProfilePolicyAuthorisationRule ::= SEQUENCE {
pprIds PprIds,
allowedOperators SEQUENCE OF OperatorID,
allowedOperators SEQUENCE OF OperatorId,
pprFlags BIT STRING {consentRequired(0)}
}
-- Definition of data structure containing the list of CRL segments
SegmentedCrlList ::= SEQUENCE OF CertificateList
-- Definition of data structure command for loading a CRL
LoadCRLRequest ::= [53] SEQUENCE { -- Tag 'BF35'
-- A CRL-A
-- A CRL
crl CertificateList
}
@ -614,11 +618,9 @@ loadCRLResponseError LoadCRLResponseError
}
LoadCRLResponseOk ::= SEQUENCE {
missingParts SEQUENCE OF SEQUENCE {
number INTEGER (0..MAX)
} OPTIONAL
missingParts SEQUENCE OF INTEGER OPTIONAL
}
LoadCRLResponseError ::= INTEGER {invalidSignature(1), invalidCRLFormat(2), notEnoughMemorySpace(3), verificationKeyNotFound(4), undefinedError(127)}
LoadCRLResponseError ::= INTEGER {invalidSignature(1), invalidCRLFormat(2), notEnoughMemorySpace(3), verificationKeyNotFound(4), fresherCrlAlreadyLoaded(5), baseCrlMissing(6), undefinedError(127)}
-- Definition of the extension for Certificate Expiration Date
id-rsp-expDate OBJECT IDENTIFIER ::= {id-rspExt 1}
@ -691,6 +693,7 @@ AuthenticateClientResponseEs9 ::= [59] CHOICE { -- Tag 'BF3B'
noEligibleProfile(8),
ciPKUnknown(9),
invalidTransactionId(10),
insufficientMemory(11),
undefinedError(127)
}
}
@ -698,7 +701,9 @@ AuthenticateClientResponseEs9 ::= [59] CHOICE { -- Tag 'BF3B'
AuthenticateClientOk ::= SEQUENCE {
transactionId [0] TransactionId,
profileMetaData [37] StoreMetadataRequest,
prepareDownloadRequest [33] PrepareDownloadRequest
smdpSigned2 SmdpSigned2, -- Signed information
smdpSignature2 [APPLICATION 55] OCTET STRING, -- tag '5F37'
smdpCertificate Certificate -- CERT.DPpb.ECDSA
}
GetBoundProfilePackageRequest ::= [58] SEQUENCE { -- Tag 'BF3A'
@ -713,6 +718,8 @@ GetBoundProfilePackageResponse ::= [58] CHOICE { -- Tag 'BF3A'
confirmationCodeMissing(2),
confirmationCodeRefused(3),
confirmationCodeRetriesExceeded(4),
bppRebindingRefused(5),
downloadOrderExpired(6),
invalidTransactionId(95),
undefinedError(127)
}

View file

@ -50,6 +50,8 @@ enum es10b_cancel_session_reason
ES10B_CANCEL_SESSION_REASON_POSTPONED = 1,
ES10B_CANCEL_SESSION_REASON_TIMEOUT = 2,
ES10B_CANCEL_SESSION_REASON_PPRNOTALLOWED = 3,
ES10B_CANCEL_SESSION_REASON_METADATAMISMATCH = 4,
ES10B_CANCEL_SESSION_REASON_LOADBPPEXECUTIONERROR = 5,
ES10B_CANCEL_SESSION_REASON_UNDEFINED = 127
};