Commit d6bdf59d authored by filatov's avatar filatov
Browse files

f_verifyCertificateSignatureWithPublicKey

f_verifyCertificateSignatureWithIssuingCertificate
f_verifyGnSecuredMessageWithPublicKey
f_verifyGnSecuredMessageWithDeviceCertificate
parent d8b2dd00
Loading
Loading
Loading
Loading
+43 −12
Original line number Original line Diff line number Diff line
@@ -382,29 +382,45 @@ module LibItsSecurity_Functions {
        group deviceSignatureHelpers {
        group deviceSignatureHelpers {
             
             
            /**
            /**
             * @desc Verify the signature of the provided secured message
             * @desc Verify the signature of the provided certificate
             * @param p_aaCertifcate    Certificate Authority certificate
             * @param p_cert  Certificate to be verified
             * @param p_atCertificate   Authorization Ticket certificate
             * @param p_key   Public key to verify
             * @return true on success, false otherwise
             * @return true on success, false otherwise
             * @verdict 
             * @verdict 
             */
             */
            function f_verifyCertificateSignature(
            function f_verifyCertificateSignatureWithPublicKey(
                                                  in template (value) Certificate p_aaCertifcate,
                                                  in template (value) Certificate p_cert,
                                                  in template (value) Certificate p_atCertificate 
                                                  in template (value) PublicKey key 
            ) return boolean {
            ) return boolean {
                // TODO To be implemented
                // TODO To be implemented
                return false;
                return false;
            }
            }


            /**
             * @desc Verify the signature of the provided secured message
             * @param p_cert    Certificate to be verified
             * @param p_verify  Certificate to be used to verify
             * @return true on success, false otherwise
             * @verdict 
             */
            function f_verifyCertificateSignatureWithIssuingCertificate(
                                                  in template (value) Certificate p_cert,
                                                  in template (value) Certificate p_verify 
            ) return boolean {
                return f_verifyCertificateSignatureWithPublicKey(p_cert, 
                            p_verify.subject_attributes[0].attribute.key); 
            }
            
            /**
            /**
             * @desc Verify the signature of the provided secured message
             * @desc Verify the signature of the provided secured message
             * @param p_securedMessage
             * @param p_securedMessage
             * @param p_certificate     Certificate to be used to verify the message
             * @return true on success, false otherwise
             * @return true on success, false otherwise
             * @verdict 
             * @verdict 
             */
             */
            function f_verifyGnSecuredOtherMessageWithDeviceCertificate(
            function f_verifyGnSecuredMessageWithPublicKey(
                                                                        in template (value) SecuredMessage p_securedMessage,
                                                                        in template (value) SecuredMessage p_securedMessage,
                                                                        in template (value) Certificate p_certificate 
                                                                        in template (value) PublicKey p_key 
            ) return boolean {
            ) return boolean {
                
                
                // Local variables
                // Local variables
@@ -440,13 +456,28 @@ module LibItsSecurity_Functions {
                        v_result := f_verifyWithEcdsaNistp256WithSha256(
                        v_result := f_verifyWithEcdsaNistp256WithSha256(
                            v_hash,
                            v_hash,
                            v_signedData,
                            v_signedData,
                            p_certificate.subject_attributes[0].attribute.key.public_key.eccPoint.x,
                            p_key.public_key.eccPoint.x,
                            p_certificate.subject_attributes[0].attribute.key.public_key.eccPoint.y.y
                            p_key.public_key.eccPoint.y.y
                        );
                        );
                    }
                    }
                } // End of 'for' statement
                } // End of 'for' statement
                
                
                return v_result;
                return v_result;
            } // End of function f_verifyGnSecuredOtherMessageWithPublicKey
            
            /**
             * @desc Verify the signature of the provided secured message
             * @param p_securedMessage
             * @param p_certificate     Certificate to be used to verify the message
             * @return true on success, false otherwise
             * @verdict 
             */
            function f_verifyGnSecuredMessageWithDeviceCertificate(
                                                                        in template (value) SecuredMessage p_securedMessage,
                                                                        in template (value) Certificate p_certificate 
            ) return boolean {
                return f_verifyGnSecuredMessageWithPublicKey(p_securedMessage,
                            p_certificate.subject_attributes[0].attribute.key);
            } // End of function f_verifyGnSecuredOtherMessageWithDeviceCertificate 
            } // End of function f_verifyGnSecuredOtherMessageWithDeviceCertificate 
                
                
        } // End of group deviceSignatureHelpers
        } // End of group deviceSignatureHelpers
@@ -526,7 +557,7 @@ module LibItsSecurity_Functions {
        
        
        group CertRequests{
        group CertRequests{
            
            
            function f_askForCertificateChain (in HashedId3s p_digests) {
            function f_askForCertificate (in HashedId3 p_digest) {
                
                
            }
            }