Skip to content

Commit

Permalink
WL#15135 patch #2: Class TlsKeyManager
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zmur committed Sep 26, 2023
1 parent 83c744c commit 675e0b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions storage/ndb/src/common/util/testTlsKeyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,10 @@ void test_affirm_client_auth(Test::CertAuthority & ca) {
ok(r == 0, "Client cert for test hostname is OK");
if(r) {
char buff[INET6_ADDRSTRLEN];
ndb_sockaddr addr(ai->ai_addr, ai->ai_addrlen);
Ndb_inet_ntop(&addr, buff, sizeof(buff));
printf(" >>> Test of address %s for %s returned error %s\n",
inet_ntop(ai->ai_family, ai->ai_addr, buff, sizeof(buff)),
TheTestHostname, TlsKeyError::message(r));
buff, TheTestHostname, TlsKeyError::message(r));
}
}

Expand Down

0 comments on commit 675e0b3

Please sign in to comment.