Commit ebe38684 authored by garciay's avatar garciay
Browse files

TTCN-3 typing review

parent c261d6c7
Loading
Loading
Loading
Loading
+30 −18
Original line number Original line Diff line number Diff line
@@ -3,7 +3,7 @@
 *  @version  $URL$
 *  @version  $URL$
 *            $Id$
 *            $Id$
 *  @desc     Module containing types and values for Security Protocol
 *  @desc     Module containing types and values for Security Protocol
 *
 *  @see Draft ETSI TS 103 097 V1.1.6
 */
 */
module LibItsSecurity_TypesAndValues {
module LibItsSecurity_TypesAndValues {
    
    
@@ -16,7 +16,7 @@ module LibItsSecurity_TypesAndValues {
    import from LibCommon_DataStrings {
    import from LibCommon_DataStrings {
        type 
        type 
            Bit2, Bit3, 
            Bit2, Bit3, 
            Oct2, Oct3, Oct8, Oct12, Oct20, Oct1to31, Oct1to255 
            Oct2, Oct3, Oct8, Oct12, Oct0to20, Oct1to31, Oct1to255 
    }
    }
    
    
    // LibIts
    // LibIts
@@ -92,7 +92,8 @@ module LibItsSecurity_TypesAndValues {
         * @member field_size   The lengths of the vectors containing the raw keys 
         * @member field_size   The lengths of the vectors containing the raw keys 
         * @member type_        The ECC key types
         * @member type_        The ECC key types
         * @member x            The x coordinate 
         * @member x            The x coordinate 
         * @member y 
         * @member y            The y coordinate
         * @remark In case of e_x_coordinate_only, e_compressed_lsb_y_0 and e_compressed_lsb_y_1, the field y shall not be present
         * @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.5   EccPoint
         * @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.5   EccPoint
         * @see Draft ETSI TS 103 097 V1.1.6 Table 2: Derivation of field sizes depending on the used algorithm
         * @see Draft ETSI TS 103 097 V1.1.6 Table 2: Derivation of field sizes depending on the used algorithm
         */
         */
@@ -122,8 +123,7 @@ module LibItsSecurity_TypesAndValues {
            e_x_coordinate_only     (0),
            e_x_coordinate_only     (0),
            e_compressed_lsb_y_0    (2),
            e_compressed_lsb_y_0    (2),
            e_compressed_lsb_y_1    (3),
            e_compressed_lsb_y_1    (3),
            e_uncompressed          (4),
            e_uncompressed          (4)
            e_unknown       (255)
        } with { variant "8 bit" }
        } with { variant "8 bit" }
        
        
        /**
        /**
@@ -137,6 +137,12 @@ module LibItsSecurity_TypesAndValues {
            EncryptionParametersContainer   public_key
            EncryptionParametersContainer   public_key
        } // End of type EncryptionParameters
        } // End of type EncryptionParameters
        
        
        /**
         * @desc Identifies a CRL series
         * @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.8   CrlSeries
         */
        type UInt32 CrlSeries; // TODO Not used ???
        
        /**
        /**
         * @desc 
         * @desc 
         * @member nonce    Data encryption with the Advanced Encryption Standard (AES) using a 128-bit key in Counter with cipher block chaining message authentication code (CCM) mode
         * @member nonce    Data encryption with the Advanced Encryption Standard (AES) using a 128-bit key in Counter with cipher block chaining message authentication code (CCM) mode
@@ -188,6 +194,7 @@ module LibItsSecurity_TypesAndValues {
         * @desc Information about the signer of a message
         * @desc Information about the signer of a message
         * @member type_        Signature algorithm type
         * @member type_        Signature algorithm type
         * @member signerInfo   Signature algorithm information. In case of self-signed, this field is not required because of no additional data shall be given
         * @member signerInfo   Signature algorithm information. In case of self-signed, this field is not required because of no additional data shall be given
         * @remark In case of e_self, the field signerInfo shall not be present
         * @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.11  SignerInfo
         * @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.11  SignerInfo
         */
         */
        type record SignerInfo {
        type record SignerInfo {
@@ -200,7 +207,7 @@ module LibItsSecurity_TypesAndValues {
         * @member digest               The digest value
         * @member digest               The digest value
         * @member certificate          A certificate
         * @member certificate          A certificate
         * @member certificates         A complete certificate chain
         * @member certificates         A complete certificate chain
         * @member certificateWithAlgo  TODO
         * @member certificateWithAlgo  A certificate with a specific algorithm
         * @member info                 TODO
         * @member info                 TODO
         */
         */
        type union SignerInfoContainer {
        type union SignerInfoContainer {
@@ -322,6 +329,7 @@ module LibItsSecurity_TypesAndValues {
         * @desc Defines geographic regions used to limit the validity of certificates
         * @desc Defines geographic regions used to limit the validity of certificates
         * @member region_type  Region type 
         * @member region_type  Region type 
         * @member region       Region description
         * @member region       Region description
         * @remark In case of e_none, the field region shall not be present
         * @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.21  GeographicRegion
         * @see Draft ETSI TS 103 097 V1.1.6 Clause 4.2.21  GeographicRegion
         */
         */
        type record GeographicRegion {
        type record GeographicRegion {
@@ -418,7 +426,7 @@ module LibItsSecurity_TypesAndValues {
            UInt8           protocol_version,
            UInt8           protocol_version,
            UInt8           security_profile,
            UInt8           security_profile,
            HeaderFields    header_fields,
            HeaderFields    header_fields,
            Payload         payload_fields,
            Payloads        payload_fields,
            TrailerFields   trailer_fields
            TrailerFields   trailer_fields
        } // End of type SecuredMessage
        } // End of type SecuredMessage
        
        
@@ -458,6 +466,7 @@ module LibItsSecurity_TypesAndValues {
            octetstring                     other_header
            octetstring                     other_header
        } // End of type HeaderFieldContainer
        } // End of type HeaderFieldContainer
        
        
        type set of Payload Payloads;
        
        
        /**
        /**
         * @desc Payload structure
         * @desc Payload structure
@@ -495,8 +504,7 @@ module LibItsSecurity_TypesAndValues {
            e_signed                (1),
            e_signed                (1),
            e_encrypted             (2),
            e_encrypted             (2),
            e_signed_external       (3),
            e_signed_external       (3),
            e_signed_and_encrypted  (4),
            e_signed_and_encrypted  (4)
            e_unknown               (255)
        } with { variant "8 bit" }
        } with { variant "8 bit" }
        
        
        type set of TrailerField TrailerFields;
        type set of TrailerField TrailerFields;
@@ -525,8 +533,7 @@ module LibItsSecurity_TypesAndValues {
         * @see Draft ETSI TS 103 097 V1.1.6 Clause 5.7 TrailerFieldType
         * @see Draft ETSI TS 103 097 V1.1.6 Clause 5.7 TrailerFieldType
         */
         */
        type enumerated TrailerFieldType {
        type enumerated TrailerFieldType {
            e_signature     (1),
            e_signature     (1)
            e_unknown       (255)
        } with { variant "8 bit" }
        } with { variant "8 bit" }
        
        
        /**
        /**
@@ -552,17 +559,22 @@ module LibItsSecurity_TypesAndValues {
            octetstring         enc_key_other
            octetstring         enc_key_other
        } // End of type RecipientInfoContainer
        } // End of type RecipientInfoContainer
        
        
        /**
         * @desc Defines an ECIES-encrypted symmetric key as defined in IEEE Std 1363a 2004 
         * @member symm_alg     The algorithm 
         * @member symm_key_len The length of vector c containing the encrypted (AES) key 
         * @member v            The sender's ECC ephemeral key used for the Elliptic Curve Encryption Scheme
         * @member c            TODO
         * @member t            TODO
         */
        type record EciesEncryptedKey {
        type record EciesEncryptedKey {
            SymmetricAlgorithm   symm_alg,
            SymmetricAlgorithm   symm_alg,
            UInt32               symm_key_len,
            UInt32               symm_key_len,
            EccPoint             v,
            EccPoint             v,
            octetstring          c,
            octetstring          c,
            Oct20                t
            Oct0to20             t // TODO Oct0to20 ot Oct1to20?
        }  // End of type EciesEncryptedKey
        }  // End of type EciesEncryptedKey
        
        
        
        
        
    } // End of group SecurityMessages
    } // End of group SecurityMessages
    
    
    group certificateSpecification {
    group certificateSpecification {
@@ -598,7 +610,7 @@ module LibItsSecurity_TypesAndValues {
         */
         */
        type record SubjectInfo {
        type record SubjectInfo {
            SubjectType subject_type,
            SubjectType subject_type,
            Oct1to255   subject_name
            Oct1to255   subject_name // TODO Oct0to255 or Oct1to255
        } // End of type SubjectInfo
        } // End of type SubjectInfo
        
        
        /**
        /**
@@ -746,7 +758,7 @@ module LibItsSecurity_TypesAndValues {
         */
         */
        type record ItsAidSsp {
        type record ItsAidSsp {
            IntX        its_aid,
            IntX        its_aid,
            Oct1to31    service_specific_permissions
            Oct1to31    service_specific_permissions // TODO Oct0to31 or Oct1to31
        } // End of type ItsAidSsp
        } // End of type ItsAidSsp
        
        
    } // End of group certificateSpecification
    } // End of group certificateSpecification