@@ -3233,8 +3233,13 @@ static int dtls_state_setup(switch_rtp_t *rtp_session, switch_dtls_t *dtls)
32333233 if ((dtls -> type & DTLS_TYPE_SERVER )) {
32343234 r = 1 ;
32353235 } else if ((cert = SSL_get_peer_certificate (dtls -> ssl ))) {
3236- switch_core_cert_extract_fingerprint (cert , dtls -> remote_fp );
3237- r = switch_core_cert_verify (dtls -> remote_fp );
3236+ dtls_fingerprint_t fp = {0 };
3237+
3238+ fp .type = dtls -> remote_fp -> type ;
3239+
3240+ switch_core_cert_extract_fingerprint (cert , & fp );
3241+ r = (!zstr (fp .str ) && !strncasecmp (fp .str , dtls -> remote_fp -> str , MAX_FPSTRLEN ));
3242+
32383243 X509_free (cert );
32393244 }
32403245
@@ -3446,9 +3451,12 @@ static int cb_verify_peer(int preverify_ok, X509_STORE_CTX *ctx)
34463451 }
34473452
34483453 if ((cert = SSL_get_peer_certificate (dtls -> ssl ))) {
3449- switch_core_cert_extract_fingerprint ( cert , dtls -> remote_fp ) ;
3454+ dtls_fingerprint_t fp = { 0 } ;
34503455
3451- r = switch_core_cert_verify (dtls -> remote_fp );
3456+ fp .type = dtls -> remote_fp -> type ;
3457+
3458+ switch_core_cert_extract_fingerprint (cert , & fp );
3459+ r = (!zstr (fp .str ) && !strncasecmp (fp .str , dtls -> remote_fp -> str , MAX_FPSTRLEN ));
34523460
34533461 X509_free (cert );
34543462 } else {
@@ -4019,8 +4027,6 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_dtls(switch_rtp_t *rtp_session, d
40194027 }
40204028
40214029 BIO_ctrl (dtls -> filter_bio , BIO_CTRL_DGRAM_SET_MTU , dtls -> mtu , NULL );
4022-
4023- switch_core_cert_expand_fingerprint (remote_fp , remote_fp -> str );
40244030
40254031 if ((type & DTLS_TYPE_RTP )) {
40264032 rtp_session -> dtls = dtls ;
0 commit comments