【发布时间】:2021-10-05 07:35:35
【问题描述】:
我正在更新客户端以支持 TLS 1.3。尝试连接到 TLS 1.3 服务器时,客户端报告“内部错误”。 Wireshark 跟踪显示该服务器以 Verify Certificate, Finished 消息响应。但是客户端无法使用以下调用堆栈生成密钥 -
libcrypto-1_1.dll!ASN1_get_object(const unsigned char * * pp, long * plength, int * ptag, int * pclass, long omax) Line 101
libcrypto-1_1.dll!asn1_item_embed_d2i(ASN1_VALUE_st * * pval, const unsigned char * * in, long len, const ASN1_ITEM_st * it, int tag, int aclass, char opt, ASN1_TLC_st * ctx, int depth) Line 287
[Inline Frame] libcrypto-1_1.dll!ASN1_item_ex_d2i(ASN1_VALUE_st * *) Line 124
libcrypto-1_1.dll!ASN1_item_d2i(ASN1_VALUE_st * * pval, const unsigned char * * in, long len, const ASN1_ITEM_st * it) Line 114
libcrypto-1_1.dll!d2i_X509_SIG(X509_sig_st * * a, const unsigned char * * in, long len) Line 21
MyCode.dll!PrivateKeyOperationCallback(ssl_st * pSSL, unsigned int type, unsigned int rsakeysize, const unsigned char * hash, unsigned int hashlen, unsigned char * sig, unsigned int sigmaxlen, unsigned int * siglen)
[Inline Frame] MyCode.dll!My_RSA_private_encrypt1(ssl_st *)
MyCode.dll!My_RSA_private_encrypt(int flen, const unsigned char * from, unsigned char * to, rsa_st * rsa, int padding)
libcrypto-1_1.dll!pkey_rsa_sign(evp_pkey_ctx_st * ctx, unsigned char * sig, unsigned int * siglen, const unsigned char * tbs, unsigned int tbslen) Line 185
libcrypto-1_1.dll!EVP_PKEY_sign(evp_pkey_ctx_st * ctx, unsigned char * sig, unsigned int * siglen, const unsigned char * tbs, unsigned int tbslen) Line 66
libcrypto-1_1.dll!EVP_DigestSignFinal(evp_md_ctx_st * ctx, unsigned char * sigret, unsigned int * siglen) Line 148
libcrypto-1_1.dll!EVP_DigestSign(evp_md_ctx_st * ctx, unsigned char * sigret, unsigned int * siglen, const unsigned char * tbs, unsigned int tbslen) Line 170
libssl-1_1.dll!tls_construct_cert_verify(ssl_st * s, wpacket_st * pkt) Line 307
libssl-1_1.dll!write_state_machine(ssl_st * s) Line 843
libssl-1_1.dll!state_machine(ssl_st * s, int server) Line 443
libssl-1_1.dll!ossl_statem_connect(ssl_st * s) Line 250
libssl-1_1.dll!SSL_do_handshake(ssl_st * s) Line 3661
libssl-1_1.dll!SSL_connect(ssl_st * s) Line 1662
ASN1_get_object 返回“标头过长”。同一个客户端可以使用 TLS 1.2 连接到同一台服务器,甚至可以使用 TLS 1.3 从浏览器连接到同一台服务器。
问题出在 mTLS(与 TLS 无关)。
【问题讨论】:
-
您说相同的代码在 1.3 上失败并且能够与 1.3 连接。你真的是指别的东西吗,比如 1.2?
-
错字。已更正。
标签: ssl openssl client-side tls1.3