diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-10-15 18:48:47 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-10-15 18:48:47 +0000 |
commit | 595e804ae39ac4a4e5b923320f8203e29838b0d3 (patch) | |
tree | e2b9903f84c57a08baaafabd558ccd4e8e889ec3 /apps/s_cb.c | |
parent | b381e9b9529a47fa0458d17e9643fa8e939f8bf9 (diff) |
Fix for WIN32 (and possibly other platforms) which don't define in_port_t.
Diffstat (limited to 'apps/s_cb.c')
-rw-r--r-- | apps/s_cb.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/apps/s_cb.c b/apps/s_cb.c index 4b27c7f0f5..78c8a5cc28 100644 --- a/apps/s_cb.c +++ b/apps/s_cb.c @@ -723,15 +723,16 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsign { case AF_INET: length += sizeof(struct in_addr); + length += sizeof(peer.s4.sin_port); break; case AF_INET6: length += sizeof(struct in6_addr); + length += sizeof(peer.s6.sin6_port); break; default: OPENSSL_assert(0); break; } - length += sizeof(in_port_t); #else length = sizeof(peer.sin_addr); length += sizeof(peer.sin_port); @@ -750,16 +751,16 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsign case AF_INET: memcpy(buffer, &peer.s4.sin_port, - sizeof(in_port_t)); - memcpy(buffer + sizeof(in_port_t), + sizeof(peer.s4.sin_port)); + memcpy(buffer + sizeof(peer.s4.sin_port), &peer.s4.sin_addr, sizeof(struct in_addr)); break; case AF_INET6: memcpy(buffer, &peer.s6.sin6_port, - sizeof(in_port_t)); - memcpy(buffer + sizeof(in_port_t), + sizeof(peer.s6.sin6_port)); + memcpy(buffer + sizeof(peer.s6.sin6_port), &peer.s6.sin6_addr, sizeof(struct in6_addr)); break; @@ -811,15 +812,16 @@ int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned { case AF_INET: length += sizeof(struct in_addr); + length += sizeof(peer.s4.sin_port); break; case AF_INET6: length += sizeof(struct in6_addr); + length += sizeof(peer.s6.sin6_port); break; default: OPENSSL_assert(0); break; } - length += sizeof(in_port_t); #else length = sizeof(peer.sin_addr); length += sizeof(peer.sin_port); @@ -838,16 +840,16 @@ int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned case AF_INET: memcpy(buffer, &peer.s4.sin_port, - sizeof(in_port_t)); - memcpy(buffer + sizeof(in_port_t), + sizeof(peer.s4.sin_port)); + memcpy(buffer + sizeof(peer.s4.sin_port), &peer.s4.sin_addr, sizeof(struct in_addr)); break; case AF_INET6: memcpy(buffer, &peer.s6.sin6_port, - sizeof(in_port_t)); - memcpy(buffer + sizeof(in_port_t), + sizeof(peer.s6.sin6_port)); + memcpy(buffer + sizeof(peer.s6.sin6_port), &peer.s6.sin6_addr, sizeof(struct in6_addr)); break; |