@@ -149,6 +149,9 @@ typedef union _rfbCredential
149149 char * x509ClientCertFile ;
150150 char * x509ClientKeyFile ;
151151 uint8_t x509CrlVerifyMode ; /* Only required for OpenSSL - see meanings below */
152+ uint8_t * x509ExpectedFingerprint ; /**< When none of the x509*CertFile paths are given, this can be used to
153+ convey to the library the expected SHA256 fingerprint of the remote's
154+ certificate. When not NULL, must be 32 bytes. */
152155 } x509Credential ;
153156 /** Plain (VeNCrypt), MSLogon (UltraVNC) */
154157 struct
@@ -215,6 +218,17 @@ typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y
215218typedef void (* FinishedFrameBufferUpdateProc )(struct _rfbClient * client );
216219typedef char * (* GetPasswordProc )(struct _rfbClient * client );
217220typedef rfbCredential * (* GetCredentialProc )(struct _rfbClient * client , int credentialType );
221+ /**
222+ Callback that is invoked with the remote's cert's details if the remote cert
223+ could not be validated against the system CA and, failing that, its fingerprint
224+ does not match the one indicated in rfbCredential.x509Credential.x509ExpectedFingerprint.
225+ */
226+ typedef rfbBool (* GetX509CertFingerprintMismatchDecisionProc )(struct _rfbClient * client ,
227+ const char * remote_cert_subject ,
228+ time_t remote_cert_valid_from ,
229+ time_t remote_cert_valid_until ,
230+ const uint8_t * remote_cert_sha256_fingerprint ,
231+ size_t remote_cert_sha256_fingerprint_len );
218232typedef rfbBool (* MallocFrameBufferProc )(struct _rfbClient * client );
219233typedef void (* GotXCutTextProc )(struct _rfbClient * client , const char * text , int textlen );
220234typedef void (* GotXCutTextUTF8Proc )(struct _rfbClient * client , const char * buffer , int buffer_len );
@@ -489,6 +503,8 @@ typedef struct _rfbClient {
489503
490504 /* flag to indicate wheter updateRect is managed by lib or user */
491505 rfbBool isUpdateRectManagedByLib ;
506+
507+ GetX509CertFingerprintMismatchDecisionProc GetX509CertFingerprintMismatchDecision ;
492508} rfbClient ;
493509
494510/* cursor.c */
0 commit comments