Commit c30f78a2 authored by garciay's avatar garciay
Browse files

STF538: Start Encryption TPs implementation

parent 19acefd5
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -94,4 +94,9 @@ module LibItsSecurity_Pics {
     */
    modulepar boolean PICS_SEC_ITS_AID_OTHER := true;
    
    /**
     * Does the IUT support encryption data?
     */
    modulepar boolean PICS_SEC_ENCRYPTION_SUPPORT := true;
    
} // End of module LibItsSecurity_Pics
 No newline at end of file
+175 −3
Original line number Diff line number Diff line
@@ -586,7 +586,7 @@ module LibItsSecurity_Templates {
                                                                          template (present) EncryptedData p_encryptedData := ?
        ) := {
            protocolVersion := c_protocol_version,
            content         := { encryptedData := p_encryptedDat }
            content         := { encryptedData := p_encryptedData }
        } // End of template mw_etsiTs103097Data_encrypted
        
        /**
@@ -682,6 +682,10 @@ module LibItsSecurity_Templates {
        
    } // End of group signedData
    
    /**
     * @desc Send templates for ToBeSignedData header
     * @see Draft ETSI TS 103 097 V1.3.1 Clause 5.3 EncryptedData
     */
    group encryptedData {
        
        template (value) EncryptedData m_encryptedData(
@@ -700,6 +704,130 @@ module LibItsSecurity_Templates {
            ciphertext := p_ciphertex
        } // End of template mw_encryptedData
        
        template (value) RecipientInfo m_recipientInfo_pskRecipInfo(
                                                                    in template (value) PreSharedKeyRecipientInfo p_pskRecipInfo
        ) := {
            pskRecipInfo := p_pskRecipInfo
        } // End of template m_recipientInfo_pskRecipInfo
        
        template (value) RecipientInfo m_recipientInfo_symmRecipInfo(
                                                                     in template (value) SymmRecipientInfo p_symmRecipInfo
        ) := {
            symmRecipInfo := p_symmRecipInfo
        } // End of template m_recipientInfo_symmRecipInfo
        
        template (value) RecipientInfo m_recipientInfo_certRecipInfo(
                                                                     in template (value) PKRecipientInfo p_certRecipInfo
        ) := {
            certRecipInfo := p_certRecipInfo
        } // End of template m_recipientInfo_certRecipInfo
        
        template (present) RecipientInfo mw_recipientInfo_certRecipInfo(
                                                                        template (present) PKRecipientInfo p_certRecipInfo := ?
        ) := {
            certRecipInfo := p_certRecipInfo
        } // End of template mw_recipientInfo_certRecipInfo
        
        template (value) RecipientInfo m_recipientInfo_signedDataRecipInfo(
                                                                           in template (value) PKRecipientInfo p_signedDataRecipInfo
        ) := {
            signedDataRecipInfo := p_signedDataRecipInfo
        } // End of template m_recipientInfo_signedDataRecipInfo
        
        template (value) RecipientInfo m_recipientInfo_rekRecipInfo(
                                                                    in template (value) PKRecipientInfo p_rekRecipInfo
        ) := {
            rekRecipInfo := p_rekRecipInfo
        } // End of template m_recipientInfo_rekRecipInfo
                
        template (value) PKRecipientInfo m_pKRecipientInfo(
                                                           in template (value) HashedId8 p_recipientId,
                                                           in template (value) EncryptedDataEncryptionKey p_encKey
        ) := { 
            recipientId := p_recipientId, 
            encKey      := p_encKey
        } // End of template m_pKRecipientInfo
        
        template (present) PKRecipientInfo mw_pKRecipientInfo(
                                                              template (present) HashedId8 p_recipientId := ?, 
                                                              template (present) EncryptedDataEncryptionKey p_encKey := ?
        ) := { 
            recipientId := p_recipientId, 
            encKey      := p_encKey
        } // End of template mw_pKRecipientInfo
        
        template (value) EciesP256EncryptedKey m_evciesP256EncryptedKey(
                                                                        in template (value) EccP256CurvePoint p_v,
                                                                        in template (value) Oct16 p_c,
                                                                        in template (value) Oct16 p_t
        ) :={
            v := p_v,
            c := p_c,
            t := p_t
        } // End of template m_evciesP256EncryptedKey
        
        template (present) EciesP256EncryptedKey mw_evciesP256EncryptedKey(
                                                                           template (present) EccP256CurvePoint p_v := ?,
                                                                           template (present) Oct16 p_c := ?,
                                                                           template (present) Oct16 p_t := ?
        ) :={
            v := p_v,
            c := p_c,
            t := p_t
        } // End of template mw_evciesP256EncryptedKey
        
        template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesNistP256(
                                                                                               in template (value) EciesP256EncryptedKey p_eciesNistP256
        ) := { 
            eciesNistP256 := p_eciesNistP256
        } // End of template m_encryptedDataEncryptionKey_eciesNistP256
        
        template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesNistP256(
                                                                                                  template (present) EciesP256EncryptedKey p_eciesNistP256 := ?
        ) := { 
            eciesNistP256 := p_eciesNistP256
        } // End of template mw_encryptedDataEncryptionKey_eciesNistP256
        
        template (value) EncryptedDataEncryptionKey m_encryptedDataEncryptionKey_eciesBrainpoolP256r1(
                                                                                                      in template (value) EciesP256EncryptedKey p_eciesBrainpoolP256r1
        ) := { 
            eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1
        } // End of template m_encryptedDataEncryptionKey_eciesBrainpoolP256r1
        
        template (present) EncryptedDataEncryptionKey mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1(
                                                                                                         template (present) EciesP256EncryptedKey p_eciesBrainpoolP256r1 := ?
        ) := { 
            eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1
        } // End of template mw_encryptedDataEncryptionKey_eciesBrainpoolP256r1
        
        template (value) SymmetricCiphertext m_SymmetricCiphertext_aes128ccm(
                                                                             in template (value) AesCcmCiphertext p_aes128ccm
        ) := {
            aes128ccm := p_aes128ccm
        } // End of template m_SymmetricCiphertext_aes128ccm
        
        template (present) SymmetricCiphertext mw_SymmetricCiphertext_aes128ccm(
                                                                                template (present) AesCcmCiphertext p_aes128ccm := ?
        ) := {
            aes128ccm := p_aes128ccm
        } // End of template mw_SymmetricCiphertext_aes128ccm

        template (value) AesCcmCiphertext m_aesCcmCiphertext(
                                                             in template (value) Oct12 p_nonce,
                                                             in template (value) Opaque p_ccmCiphertext
        ) := {
            nonce         := p_nonce,
            ccmCiphertext := p_ccmCiphertext
        } // End of template m_aesCcmCiphertext
        
        template (present) AesCcmCiphertext mw_aesCcmCiphertext(
                                                                template (present) Oct12 p_nonce := ?,
                                                                template (present) Opaque p_ccmCiphertext := ?
        ) := {
            nonce         := p_nonce,
            ccmCiphertext := p_ccmCiphertext
        } // End of template mw_aesCcmCiphertext
        
    } // End of group encryptedData
    
    /**
@@ -1429,7 +1557,7 @@ module LibItsSecurity_Templates {
        
    } // End of group toBeSignedCertificate
    
    group keys {
    group verificationKeys {
        
        template (value) VerificationKeyIndicator m_verificationKeyIndicator_verificationKey(
                                                                                             in template (value) PublicVerificationKey p_verificationKey
@@ -1491,7 +1619,51 @@ module LibItsSecurity_Templates {
            ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1
        } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384
        
    } // End of group keys
    } // End of group verificationKeys
    
    group encryptionKey {
        
        template (value) PublicEncryptionKey m_encryptionKey(
                                                             in template (value) SymmAlgorithm p_supportedSymmAlg,
                                                             in template (value) BasePublicEncryptionKey p_publicKey
        ) := { 
            supportedSymmAlg := p_supportedSymmAlg,
            publicKey        := p_publicKey
        } // End of template m_encryptionKey
        
        template (present) PublicEncryptionKey mw_encryptionKey(
                                                                template (present) SymmAlgorithm p_supportedSymmAlg := aes128Ccm,
                                                                template (present) BasePublicEncryptionKey p_publicKey := ?
        ) := { 
            supportedSymmAlg := p_supportedSymmAlg,
            publicKey        := p_publicKey
        } // End of template mw_encryptionKey
        
        template (value) BasePublicEncryptionKey m_publicEncryptionKey_ecdsaNistP256(
                                                                                     in template (value) EccP256CurvePoint p_eciesNistP256
        ) := { 
            eciesNistP256 := p_eciesNistP256
        } // End of template m_publicEncryptionKey_ecdsaNistP256
        
        template (present) BasePublicEncryptionKey mw_publicEncryptionKey_ecdsaNistP256(
                                                                                        template (present) EccP256CurvePoint p_eciesNistP256 := ?
        ) := { 
            eciesNistP256 := p_eciesNistP256
        } // End of template mw_publicEncryptionKey_ecdsaNistP256
        
        template (value) BasePublicEncryptionKey m_publicEncryptionKey_eciesBrainpoolP256r1(
                                                                                            in template (value) EccP256CurvePoint p_eciesBrainpoolP256r1
        ) := { 
            eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1
        } // End of template m_publicEncryptionKey_eciesBrainpoolP256r1
        
        template (present) BasePublicEncryptionKey mw_publicEncryptionKey_eciesBrainpoolP256r1(
                                                                                               template (present) EccP256CurvePoint p_eciesBrainpoolP256r1 := ?
        ) := { 
            eciesBrainpoolP256r1 := p_eciesBrainpoolP256r1
        } // End of template mw_publicEncryptionKey_eciesBrainpoolP256r1
        
    } // End of group encryptionKey
    
    group appPermissions {