mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-06-27 15:43:42 +08:00
Add SM4-FF1, update socket API
This commit is contained in:
@@ -217,7 +217,6 @@ int tls13_client_main(int argc, char *argv[])
|
||||
TLS_CTX ctx;
|
||||
TLS_CONNECT conn;
|
||||
|
||||
struct hostent *hp;
|
||||
struct sockaddr_in server;
|
||||
tls_socket_t sock = tls_socket_invalid();
|
||||
char buf[1024] = {0};
|
||||
@@ -782,17 +781,10 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!(hp = gethostbyname(host))) {
|
||||
#ifdef WIN32
|
||||
fprintf(stderr, "%s: parse -host value error: %d\n", prog, WSAGetLastError());
|
||||
#else
|
||||
fprintf(stderr, "%s: parse -host value error: %s\n", prog, hstrerror(h_errno));
|
||||
#endif
|
||||
if (tls_socket_get_addr(host, port, &server) != 1) {
|
||||
fprintf(stderr, "%s: parse -host value error\n", prog);
|
||||
goto end;
|
||||
}
|
||||
server.sin_addr = *((struct in_addr *)hp->h_addr_list[0]);
|
||||
server.sin_family = AF_INET;
|
||||
server.sin_port = htons(port);
|
||||
|
||||
if (tls_socket_create(&sock, AF_INET, SOCK_STREAM, 0) != 1) {
|
||||
fprintf(stderr, "%s: socket create error\n", prog);
|
||||
|
||||
Reference in New Issue
Block a user