Loading ttcn/Security/LibItsSecurity_Functions.ttcn3 +13 −7 Original line number Diff line number Diff line Loading @@ -86,6 +86,11 @@ module LibItsSecurity_Functions { in octetstring p_ecdsaNistp256PublicKeyX, in octetstring p_ecdsaNistp256PublicKeyY ) return boolean { // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); // log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); // log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyX", p_ecdsaNistp256PublicKeyX); // log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY", p_ecdsaNistp256PublicKeyY); return fx_verifyWithEcdsaNistp256WithSha256( p_toBeVerifiedData, p_signature, Loading Loading @@ -233,11 +238,11 @@ module LibItsSecurity_Functions { v_secPayload := bit2oct(encvalue(v_toBeSignedSecuredMessage)); // Calculate the hash of the SecuredMessage payload to be signed v_hash := f_hashWithSha256(v_secPayload); // FIXME BUG Framework already compute the hash v_hash := f_hashWithSha256(v_secPayload); // Signed payload v_signature := f_signWithEcdsaNistp256WithSha256( v_hash v_secPayload // FIXME BUG Framework already compute the hash v_hash ); p_securedMessage := m_securedMessage( Loading Loading @@ -601,10 +606,11 @@ module LibItsSecurity_Functions { v_secPayload := bit2oct(encvalue(v_toBeSignedSecuredMessage)); log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_secPayload=", v_secPayload); // Calculate the hash of the SecuredMessage payload to be signed v_hash := fx_hashWithSha256(v_secPayload); log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_hash=", v_hash); // FIXME BUG Framework already compute the hash // // Calculate the hash of the SecuredMessage payload to be signed // v_hash := fx_hashWithSha256(v_secPayload); // log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_hash=", v_hash); // // Verify payload for (v_counter := 0; v_counter < lengthof(p_securedMessage.trailer_fields); v_counter := v_counter + 1) { var SecuredMessage v_securedMessage := valueof(p_securedMessage); Loading @@ -618,7 +624,7 @@ module LibItsSecurity_Functions { v_securedMessage.trailer_fields[v_counter].trailerField.signature_.signature_.ecdsa_signature.s; log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_signedData=", v_signedData); v_result := f_verifyWithEcdsaNistp256WithSha256( v_hash, v_secPayload, // FIXME BUG Framework already compute the hash v_hash, v_signedData, valueof(p_publicKey.public_key.eccPoint.x), valueof(p_publicKey.public_key.eccPoint.y.y) Loading Loading
ttcn/Security/LibItsSecurity_Functions.ttcn3 +13 −7 Original line number Diff line number Diff line Loading @@ -86,6 +86,11 @@ module LibItsSecurity_Functions { in octetstring p_ecdsaNistp256PublicKeyX, in octetstring p_ecdsaNistp256PublicKeyY ) return boolean { // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData", p_toBeVerifiedData); // log("f_verifyWithEcdsaNistp256WithSha256: toBeVerifiedData length", lengthof(p_toBeVerifiedData)); // log("f_verifyWithEcdsaNistp256WithSha256: signature", p_signature); // log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyX", p_ecdsaNistp256PublicKeyX); // log("f_verifyWithEcdsaNistp256WithSha256: ecdsaNistp256PublicKeyY", p_ecdsaNistp256PublicKeyY); return fx_verifyWithEcdsaNistp256WithSha256( p_toBeVerifiedData, p_signature, Loading Loading @@ -233,11 +238,11 @@ module LibItsSecurity_Functions { v_secPayload := bit2oct(encvalue(v_toBeSignedSecuredMessage)); // Calculate the hash of the SecuredMessage payload to be signed v_hash := f_hashWithSha256(v_secPayload); // FIXME BUG Framework already compute the hash v_hash := f_hashWithSha256(v_secPayload); // Signed payload v_signature := f_signWithEcdsaNistp256WithSha256( v_hash v_secPayload // FIXME BUG Framework already compute the hash v_hash ); p_securedMessage := m_securedMessage( Loading Loading @@ -601,10 +606,11 @@ module LibItsSecurity_Functions { v_secPayload := bit2oct(encvalue(v_toBeSignedSecuredMessage)); log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_secPayload=", v_secPayload); // Calculate the hash of the SecuredMessage payload to be signed v_hash := fx_hashWithSha256(v_secPayload); log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_hash=", v_hash); // FIXME BUG Framework already compute the hash // // Calculate the hash of the SecuredMessage payload to be signed // v_hash := fx_hashWithSha256(v_secPayload); // log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_hash=", v_hash); // // Verify payload for (v_counter := 0; v_counter < lengthof(p_securedMessage.trailer_fields); v_counter := v_counter + 1) { var SecuredMessage v_securedMessage := valueof(p_securedMessage); Loading @@ -618,7 +624,7 @@ module LibItsSecurity_Functions { v_securedMessage.trailer_fields[v_counter].trailerField.signature_.signature_.ecdsa_signature.s; log("f_verifyGnSecuredMessageSignatureWithPublicKey: v_signedData=", v_signedData); v_result := f_verifyWithEcdsaNistp256WithSha256( v_hash, v_secPayload, // FIXME BUG Framework already compute the hash v_hash, v_signedData, valueof(p_publicKey.public_key.eccPoint.x), valueof(p_publicKey.public_key.eccPoint.y.y) Loading