Commit 89eedddc authored by garciay's avatar garciay
Browse files

STF538: Start validation

parent c59d259d
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -107,6 +107,10 @@ module ItsGenCert_Functions {
    // Sign the certificate using ECDSA/SHA-256 (NIST p-256)
    if (p_certificate_params.curve == e_nist_p256) {
      v_signature := f_signWithEcdsaNistp256WithSha256(bit2oct(v_enc_msg), p_issuer_certificate_details.private_key);
      if (lengthof(v_signature) != 64) {
        setverdict(fail, "Wrong signature size, shall be 64 instead of ", lengthof(v_signature));
        stop;
      }
      p_certificate_details.certificate.signature_ := valueof(
                                                              m_signature_ecdsaNistP256(
                                                                                        m_ecdsaP256Signature(
@@ -118,6 +122,10 @@ module ItsGenCert_Functions {
                                                                                        ));
    } else if (p_certificate_params.curve == e_brainpool_p256) {
      v_signature := f_signWithEcdsaBrainpoolp256WithSha256(bit2oct(v_enc_msg), p_issuer_certificate_details.private_key);
      if (lengthof(v_signature) != 64) {
        setverdict(fail, "Wrong signature size, shall be 64 instead of ", lengthof(v_signature));
        stop;
      }
      p_certificate_details.certificate.signature_ := valueof(
                                                              m_signature_ecdsaBrainpoolP256r1(
                                                                                               m_ecdsaP256Signature(
@@ -129,6 +137,10 @@ module ItsGenCert_Functions {
                                                                                               ));
    } else if (p_certificate_params.curve == e_brainpool_p384) {
      v_signature := f_signWithEcdsaBrainpoolp384WithSha384(bit2oct(v_enc_msg), p_issuer_certificate_details.private_key);
      if (lengthof(v_signature) != 96) {
        setverdict(fail, "Wrong signature size, shall be 96 instead of ", lengthof(v_signature));
        stop;
      }
      p_certificate_details.certificate.signature_ := valueof(m_signature_ecdsaBrainpoolP384r1(
                                                                                               m_ecdsaP384Signature(
                                                                                                                    m_eccP384CurvePoint_x_only(
+2 −1
Original line number Diff line number Diff line
@@ -151,7 +151,8 @@ module ItsGenCert_Pics {
      sha256,                                                             // hash_algorithm
      e_nist_p256,                                                        // curve
      "CERT_IUT_A_AA",                                                    // signed_by
      false                                                               // encryption_key
      false,                                                              // encryption_key
      omit                                                                // encryption_curve
    }, 
    { 
      "CERT_IUT_C_RCA",                                                   // certificate_id