smdpOid (SM-DP+ 对象标识符)
定义: smdpOid 是一个对象标识符(OID),用于在GSMA RSP生态系统中唯一标识一个SM-DP+。它类似于一个全局唯一的ID,确保与其他SM-DP+区分开来。
作用:
- 会话关联与认证:在
ES9+.CancelSession等流程中,SM-DP+会验证收到的smdpOid是否与自身证书中的OID一致,确保该会话请求是针对正确的SM-DP+发起的,防止会话劫持或错误路由。 - RPM管理:在
RpmConfiguration和LoadRpmPackageResultDataSigned等结构中,smdpOid用于标识执行远程Profile管理(RPM)操作的SM-DP+。 - Profile元数据标识:在Profile元数据中,
dpOid字段(其值与smdpOid相同)用于标识该Profile的发行方(即SM-DP+)。
来源与提取方式: smdpOid 来源于SM-DP+的认证证书 CERT.DPauth.SIG(或CERT.DPauth.ECDSA)。
提取方法(严格遵循SGP.22规范):
- 解析证书的
subjectAltName扩展:该扩展的OID为2.5.29.17。 - 查找
registeredID类型的条目:在subjectAltName扩展的GeneralName序列中,查找类型为registeredID(编号为8)的条目。 - 获取OID值:该
registeredID条目携带的OID值即为smdpOid。
文档依据:
- SGP.22-3.1.pdf 明确指出,
CERT.DPauth.SIG证书的subjectAltName扩展中包含SM-DP+的OID,并用于验证smdpOid。 - SGP.22-2.4.pdf 也描述了相同的证书结构,
subjectAltName扩展中必须包含SM-DP+的OID。
smdpOid 从CERT.DPauth.ECDSA证书的扩展字段2.5.29.17 subjectAltName中提取
dpOid (DpProprietaryData 中的 SM-DP+ OID)
定义与关系: dpOid 与 smdpOid 是同一个概念。它同样代表SM-DP+的OID,用于唯一标识一个SM-DP+。dpOid 是此字段在特定数据结构 DpProprietaryData 中的命名。
作用:
- 在Profile元数据的
DpProprietaryData结构体中,dpOid字段用于携带该Profile的发行方(SM-DP+)的OID。这有助于eUICC或LPAd识别该Profile的来源。
来源与提取方式:dpOid 的来源与 smdpOid 完全一致,同样从SM-DP+的认证证书 CERT.DPauth.SIG 的 subjectAltName 扩展中提取。
文档依据:
- SGP.22-3.1.pdf 的ASN.1定义中,
DpProprietaryData结构体的定义如下,其注释明确表明了dpOid的出处:
DpProprietaryData ::= SEQUENCE { -- maximum size including tag and length field: 128 bytes |
remoteOpId (InitialiseSecureChannelRequest 中的远程操作类型标识符)
定义: remoteOpId 是 InitialiseSecureChannelRequest 数据对象中的一个字段,用于标识当前RSP会话要执行的远程操作类型。
作用:
- 指示操作类型:告诉eUICC即将执行的具体操作(例如,是安装一个新的Profile,还是执行一个RPM命令)。
- 参与签名计算:SM-DP+在计算关键签名(如
smdpSign)时,会将remoteOpId作为输入数据之一,确保签名与特定的操作类型绑定,防止重放攻击。 - eUICC行为判断:eUICC接收到请求后,会根据
remoteOpId的值来决定执行何种流程和验证逻辑。如果remoteOpId无效或未知,eUICC会返回错误。
来源与设置方式: remoteOpId 的值不是从证书中获取的,而是由SM-DP+在构建InitialiseSecureChannelRequest消息时,根据当前RSP会话的具体需求动态设置。
文档依据:
SGP.22-2.5 在
InitialiseSecureChannelRequest的ASN.1定义中说明:InitialiseSecureChannelRequest ::= [35] SEQUENCE { --Tag 'BF23'
remoteOpId, --Remote Operation Type Identifier (value SHALL be set to installBoundProfilePackage)
...
}这里的注释表明,当执行安装Bound Profile包的操作时,remoteOpId的值必须设置到installBoundProfilePackage中。
SGP.22-3.1.pdf 进一步说明,
remoteOpId的取值由SM-DP+根据操作类型设定,并用于签名计算。例如,在Profile下载流程中,它被设置为installBoundProfilePackage。
| 字段 | 定义 | 来源 | 提取/设置方式 | 作用 |
|---|---|---|---|---|
| smdpOid | SM-DP+ 的对象标识符 | SM-DP+ 证书 CERT.DPauth.SIG |
解析证书的 subjectAltName 扩展,获取类型为 registeredID 的OID值。 |
唯一标识SM-DP+,用于会话关联、认证、RPM管理和Profile元数据标识。 |
| dpOid | 同 smdpOid,SM-DP+的OID |
与 smdpOid 相同,来源于 CERT.DPauth.SIG |
提取方式与 smdpOid 相同。 |
在Profile元数据的 DpProprietaryData 结构中携带,标识Profile的发行方。 |
| remoteOpId | 远程操作类型标识符 | 由SM-DP+根据当前操作动态设置 | 非证书字段,由SM-DP+在构建 InitialiseSecureChannelRequest 时设置(如installBoundProfilePackage)。 |
指示eUICC要执行的具体操作类型,并参与签名计算以确保消息完整性。 |
密钥派生
密钥派生过程应由卡外实体(SM-DP+)和eUICC以对称方式进行执行。
• 使用otPK.eUICC.ECKA和otPK.DP.ECKA(分别使用各自的临时私钥),按照GlobalPlatform Card Specification Amendment F [13]第3.1.1节中描述的方法生成共享密钥ShS(但仅限于临时密钥),该共享密钥作为密钥派生过程的输入。
• 将以下值拼接为SharedInfo,作为密钥派生过程的输入(此数据即函数“ES8+.InitialiseSecureChannel”中的输入数据):
- 密钥类型(1字节)
- 密钥长度(1字节)
- HostID-LV 和 EID-LV。HostID-LV 包含输入数据中提供的HostID的长度字段和值字段;EID-LV 包含EID的长度字段和值字段。
• 初始MAC链值、S-ENC和S-MAC取自根据BSI TR-03111 [41]中定义的“X9.63密钥派生函数”从ShS派生出的KeyData(密钥派生时应使用SHA-256算法以生成足够长度的KeyData)。该密钥派生过程包含附加信息,即密钥派生算法的“SharedInfo”。密钥的分配如下表所示:
| KeyData | Key |
|---|---|
| 1 to L | Initial MAC chaining value |
| L+1 to 2L | S-ENC |
| 2L+1 to 3L | S-MAC |
初始MAC链值用于计算“ES8+.初始化安全通道”命令之后第一个SCP03t数据块的MAC
The key derivation process described in this section SHALL be executed by both the off-card entity (SM-DP+) and the eUICC in a symmetric way.
· Use otPK.eUICC.ECKA and otPK.DP.ECKA (with their respective one time private keys) to generate the shared secret ShS as described in GlobalPlatform Card Specification Amendment F [13] section 3.1.1 (but limited to ephemeral keys) which constitutes the input for the Key Derivation process.
· Concatenate the following values as SharedInfo as input for the Key Derivation process (this data is the one given as input data in the function “ES8+.InitialiseSecureChannel”):
· Key type (1 byte)
· Key length (1 byte)
· HostID-LV and EID-LV. HostID-LV comprises the length and the value field of the HostID given in the input data; EID-LV comprises the length and value field of the EID.
· Initial MAC Chaining value, S-ENC and S-MAC are taken from KeyData derived from the ShS as defined in BSI TR-03111 [41] for the “X9.63 Key Derivation Function” (SHA-256 SHALL be used for the key derivation to calculate KeyData of sufficient length). This key derivation includes additional information, the ‘SharedInfo’ of the key derivation algorithm. Keys are assigned as defined in the following table:
The initial MAC chaining value is used for the computation of the MAC of the first SCP03t block following the “ES8+.InitialiseSecureChannel” command.