Update TLCP client

set optional CA certs and client keys
tlcp_client can correctly connect  https://ebssec.boc.cn, https://zffw.jxzwfww.gov.cn

Bugs:
send, recv return value.
handle input when connected.
This commit is contained in:
Zhi Guan
2022-07-26 22:36:33 +08:00
parent 43bec77d15
commit bb1dea9160
4 changed files with 28 additions and 8 deletions

View File

@@ -1472,6 +1472,7 @@ int x509_certs_get_cert_by_subject(const uint8_t *d, size_t dlen,
return 1;
}
}
error_print(); // 可能来自于没有找到对应的CA证书
return 0;
}
@@ -1649,6 +1650,7 @@ int x509_certs_verify_tlcp(const uint8_t *certs, size_t certslen,
return -1;
}
if (x509_certs_get_cert_by_subject(rootcerts, rootcertslen, name, namelen, &cacert, &cacertlen) != 1) {
// 当前证书链和提供的CA证书不匹配
error_print();
return -1;
}