Skip to content

Commit 675e0b3

Browse files
committed
WL#15135 patch #2: Class TlsKeyManager
Post push fix. In test program testTlsKeyManager-t a struct sockaddr pointer was passed to inet_ntop instead of struct in_addr for AF_INET and struct in6_addr for AF_INET6. That caused wrong addresses to be printed on error: not ok 26 - Client cert for test hostname is OK >>> Test of address 2.0.0.0 for msdn.microsoft.com returned error authorization failure: bad hostname not ok 27 - Client cert for test hostname is OK >>> Test of address a00::2620:1ec:46:0 for msdn.microsoft.com returned error authorization failure: bad hostname not ok 28 - Client cert for test hostname is OK >>> Test of address a00::2620:1ec:bdf:0 for msdn.microsoft.com returned error authorization failure: bad hostname Should be 13.107.x.53 or 2620:1ec:x::53. Changed to use ndb_sockaddr and Ndb_inet_ntop instead. Change-Id: Iae4bebca26462f9b65c3232e9768c574e767b380
1 parent 83c744c commit 675e0b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

storage/ndb/src/common/util/testTlsKeyManager.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,10 @@ void test_affirm_client_auth(Test::CertAuthority & ca) {
700700
ok(r == 0, "Client cert for test hostname is OK");
701701
if(r) {
702702
char buff[INET6_ADDRSTRLEN];
703+
ndb_sockaddr addr(ai->ai_addr, ai->ai_addrlen);
704+
Ndb_inet_ntop(&addr, buff, sizeof(buff));
703705
printf(" >>> Test of address %s for %s returned error %s\n",
704-
inet_ntop(ai->ai_family, ai->ai_addr, buff, sizeof(buff)),
705-
TheTestHostname, TlsKeyError::message(r));
706+
buff, TheTestHostname, TlsKeyError::message(r));
706707
}
707708
}
708709

0 commit comments

Comments
 (0)