feat: expose the chromium validated certificate in the certificate verify proc (#21890)
This commit is contained in:
		
					parent
					
						
							
								f34cbe66a0
							
						
					
				
			
			
				commit
				
					
						37feeb8e5f
					
				
			
		
					 4 changed files with 4 additions and 0 deletions
				
			
		|  | @ -272,6 +272,7 @@ the original network configuration. | |||
|   * `request` Object | ||||
|     * `hostname` String | ||||
|     * `certificate` [Certificate](structures/certificate.md) | ||||
|     * `validatedCertificate` [Certificate](structures/certificate.md) | ||||
|     * `verificationResult` String - Verification result from chromium. | ||||
|     * `errorCode` Integer - Error code. | ||||
|   * `callback` Function | ||||
|  |  | |||
|  | @ -32,6 +32,7 @@ void CertVerifierClient::Verify( | |||
|   params.default_result = net::ErrorToString(default_error); | ||||
|   params.error_code = default_error; | ||||
|   params.certificate = certificate; | ||||
|   params.validated_certificate = default_result.verified_cert; | ||||
|   cert_verify_proc_.Run( | ||||
|       params, | ||||
|       base::AdaptCallbackForRepeating(base::BindOnce( | ||||
|  |  | |||
|  | @ -17,6 +17,7 @@ struct VerifyRequestParams { | |||
|   std::string default_result; | ||||
|   int error_code; | ||||
|   scoped_refptr<net::X509Certificate> certificate; | ||||
|   scoped_refptr<net::X509Certificate> validated_certificate; | ||||
| 
 | ||||
|   VerifyRequestParams(); | ||||
|   VerifyRequestParams(const VerifyRequestParams&); | ||||
|  |  | |||
|  | @ -364,6 +364,7 @@ v8::Local<v8::Value> Converter<electron::VerifyRequestParams>::ToV8( | |||
|   gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); | ||||
|   dict.Set("hostname", val.hostname); | ||||
|   dict.Set("certificate", val.certificate); | ||||
|   dict.Set("validatedCertificate", val.validated_certificate); | ||||
|   dict.Set("verificationResult", val.default_result); | ||||
|   dict.Set("errorCode", val.error_code); | ||||
|   return ConvertToV8(isolate, dict); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Samuel Attard
				Samuel Attard