8000 Fix socket test issues by torben-hansen · Pull Request #2404 · aws/aws-lc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix socket test issues #2404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions crypto/bio/bio_socket_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ class OwnedSocket {
return temp;
}

int type() const {
int type = 0;
socklen_t length = sizeof(int);
getsockopt(get(), SOL_SOCKET, SO_TYPE, (char *)&type, &length);
return type;
}

SockaddrStorage storage() const {
SockaddrStorage server_addr;
if (0 != getsockname(get(), server_addr.addr_mut(), &server_addr.len)) {
Expand Down Expand Up @@ -202,7 +195,7 @@ static OwnedSocket Bind(const int family, const int type, const sockaddr *addr,
static int prepare_unix_domain_socket(sockaddr_un *sun) {
assert(sun != NULL);

OPENSSL_cleanse(sun, sizeof(sun));
OPENSSL_cleanse(sun, sizeof(struct sockaddr_un));
sun->sun_family = AF_UNIX;

char dir_buffer[PATH_MAX] = {0};
Expand Down Expand Up @@ -249,7 +242,6 @@ static OwnedSocket ListenLoopback(int type, int addr_family = 0,
if (inet_pton(AF_INET, "127.0.0.1", &sin.sin_addr) != 1) {
ADD_FAILURE() << LastSocketError();
return OwnedSocket();
return OwnedSocket();
}
sock = Bind(AF_INET, type, reinterpret_cast<const sockaddr *>(&sin),
sizeof(sin));
Expand Down Expand Up @@ -545,6 +537,7 @@ static void test_puts_receive(bssl::UniquePtr<BIO> &sender_bio,
ASSERT_EQ((int)strlen(kTestMessage),
BIO_read(receiver_bio.get(), buff, sizeof(buff)))
<< LastSocketError();
buff[strlen(kTestMessage)] = '\0';

// Verify the message received matches the message sent.
ASSERT_EQ(Bytes(buff), Bytes(kTestMessage));
Expand Down
Loading
0