Commit d35994ab authored by Yann Garcia's avatar Yann Garcia
Browse files

Continue PKI ATS development

parent ec376d26
Loading
Loading
Loading
Loading
+34 −0
Original line number Original line Diff line number Diff line
module LibItsPki_EncdecDeclarations {
module LibItsPki_EncdecDeclarations {
    
    
  // LibIts
  // LibIts
  import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
  import from EtsiTs102941BaseTypes language "ASN.1:1997" all;
  import from EtsiTs102941BaseTypes language "ASN.1:1997" all;
  import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all;
  import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all;
  import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all;
  import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all;
@@ -90,4 +91,37 @@ module LibItsPki_EncdecDeclarations {
  external function fx_dec_AuthorizationValidationRequest(inout bitstring b, out EtsiTs102941TypesAuthorizationValidation.AuthorizationValidationRequest p) return integer
  external function fx_dec_AuthorizationValidationRequest(inout bitstring b, out EtsiTs102941TypesAuthorizationValidation.AuthorizationValidationRequest p) return integer
  with {extension "prototype(sliding) decode(PER)"}
  with {extension "prototype(sliding) decode(PER)"}
    
    
  /**
   * @desc Encoding function for EtsiTs102941BaseTypes PublicKeys
   * @param p The certificate to encode
   * @return The encode message in OER format
   */
  external function fx_enc_PublicKeys(in EtsiTs102941BaseTypes.PublicKeys p) return bitstring
  with {extension "prototype(convert) encode(PER)"}
    
  external function fx_dec_PublicKeys(inout bitstring b, out EtsiTs102941BaseTypes.PublicKeys p) return integer
  with {extension "prototype(sliding) decode(PER)"}
    
  /**
   * @desc Encoding function for IEEE1609dot2BaseTypes PublicVerificationKey
   * @param p The certificate to encode
   * @return The encode message in OER format
   */
  external function fx_enc_PublicVerificationKey(in IEEE1609dot2BaseTypes.PublicVerificationKey p) return bitstring
  with {extension "prototype(convert) encode(PER)"}
    
  external function fx_dec_PublicVerificationKey(inout bitstring b, out IEEE1609dot2BaseTypes.PublicVerificationKey p) return integer
  with {extension "prototype(sliding) decode(PER)"}
    
  /**
   * @desc Encoding function for IEEE1609dot2BaseTypes PublicEncryptionKey
   * @param p The certificate to encode
   * @return The encode message in OER format
   */
  external function fx_enc_PublicEncryptionKey(in IEEE1609dot2BaseTypes.PublicEncryptionKey p) return bitstring
  with {extension "prototype(convert) encode(PER)"}
    
  external function fx_dec_PublicEncryptionKey(inout bitstring b, out IEEE1609dot2BaseTypes.PublicEncryptionKey p) return integer
  with {extension "prototype(sliding) decode(PER)"}
    
} // End of module LibItsPki_EncdecDeclarations 
} // End of module LibItsPki_EncdecDeclarations 
+123 −63

File changed.

Preview size limit exceeded, changes collapsed.

+9 −1
Original line number Original line Diff line number Diff line
@@ -38,7 +38,15 @@ module LibItsPki_Pixits {
  /**
  /**
   * @desc Indicate which encryption algorithem to be used
   * @desc Indicate which encryption algorithem to be used
   */
   */
  modulepar SecurityAlg PX_EC_ALG := e_nist_p256;
  modulepar SecurityAlg PX_EC_ALG_FOR_EC  := e_nist_p256; // TODO Use RCA to determine encryption algorithm?
  /**
   * @desc Indicate which encryption algorithem to be used
   */
  modulepar SecurityAlg PX_EC_ALG_FOR_AT  := e_nist_p256;
  /**
   * @desc Indicate which encryption algorithem to be used
   */
  modulepar SecurityAlg PX_EC_ALG_FOR_ATV := e_nist_p256;
  
  
  /**
  /**
   * @desc Indicate which verification algorithem to be used
   * @desc Indicate which verification algorithem to be used
+3 −0
Original line number Original line Diff line number Diff line
@@ -624,6 +624,8 @@ module LibItsSecurity_Functions {
                                              out Oct32 p_publicKeyCompressed,
                                              out Oct32 p_publicKeyCompressed,
                                              out integer p_compressed_mode
                                              out integer p_compressed_mode
                                             ) return boolean {
                                             ) return boolean {
          log(">>> f_generate_key_pair_nistp256");
          
          if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values
          if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values
           p_privateKey := '43481BC44C073C1432DB6EC4F0EF57062BEA08E4C19F811567325AD1FD1C6577'O;
           p_privateKey := '43481BC44C073C1432DB6EC4F0EF57062BEA08E4C19F811567325AD1FD1C6577'O;
           p_publicKeyX := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O;
           p_publicKeyX := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O;
@@ -653,6 +655,7 @@ module LibItsSecurity_Functions {
                                                   out Oct32 p_publicKeyCompressed,
                                                   out Oct32 p_publicKeyCompressed,
                                                   out integer p_compressed_mode
                                                   out integer p_compressed_mode
                                                  ) return boolean {
                                                  ) return boolean {
          log(">>> f_generate_key_pair_brainpoolp256");
          return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode);
          return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode);
        }
        }
        
        
+11 −0
Original line number Original line Diff line number Diff line
@@ -1804,6 +1804,17 @@ module LibItsSecurity_Templates {
            seconds := p_duration
            seconds := p_duration
        } // End of template m_duration_in_seconds
        } // End of template m_duration_in_seconds
        
        
        /**
         * @desc Send template for Duration (in hours)
         * @param p_duration    The duration value
         * @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18  Duration
         */
        template (value) Duration m_duration_in_hours(
                                                      in template (value) Int16 p_duration
                                                      ) := {
         hours := p_duration
      } // End of template m_duration_in_hours
        
        /**
        /**
         * @desc Receive template for Duration (in seconds)
         * @desc Receive template for Duration (in seconds)
         * @param p_duration    The duration value
         * @param p_duration    The duration value
Loading