Commit 13f3ab98 authored by Constantin Rack's avatar Constantin Rack Committed by GitHub

Merge pull request #2702 from bluca/test

Problems: GSSAPI builds broken with picky compilers, Debian/RPM packages do not use GSSAPI, no CI jobs that test GSSAPI
parents 2c8a1315 68ba6d17
......@@ -41,7 +41,7 @@ matrix:
apt:
packages:
- valgrind
- env: BUILD_TYPE=default CURVE=libsodium
- env: BUILD_TYPE=default CURVE=libsodium GSSAPI=enabled PGM=enabled
os: linux
addons:
apt:
......@@ -49,10 +49,12 @@ matrix:
- sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_14.04/ ./'
key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_14.04/Release.key'
packages:
- libkrb5-dev
- libpgm-dev
- libsodium-dev
- asciidoc
- xmlto
- env: BUILD_TYPE=default CURVE=libsodium DRAFT=enabled
- env: BUILD_TYPE=default CURVE=libsodium DRAFT=enabled GSSAPI=enabled PGM=enabled
os: linux
addons:
apt:
......@@ -60,6 +62,8 @@ matrix:
- sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_14.04/ ./'
key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_14.04/Release.key'
packages:
- libkrb5-dev
- libpgm-dev
- libsodium-dev
- env: BUILD_TYPE=default CURVE=libsodium DRAFT=enabled
os: osx
......
......@@ -36,6 +36,14 @@ if [ $BUILD_TYPE == "default" ]; then
fi
fi
if [ -n "$GSSAPI" ] && [ "$GSSAPI" == "enabled" ]; then
CONFIG_OPTS+=("--with-libgssapi_krb5=yes")
fi
if [ -n "$PGM" ] && [ "$PGM" == "enabled" ]; then
CONFIG_OPTS+=("--with-pgm=yes")
fi
if [ -z $DRAFT ] || [ $DRAFT == "disabled" ]; then
CONFIG_OPTS+=("--enable-drafts=no")
elif [ $DRAFT == "enabled" ]; then
......
......@@ -565,7 +565,9 @@ ZMQ_EXPORT void zmq_threadclose (void* thread);
#define ZMQ_DGRAM 18
/* DRAFT Socket options. */
#define ZMQ_BINDTODEVICE 90
#define ZMQ_GSSAPI_PRINCIPAL_NAMETYPE 90
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE 91
#define ZMQ_BINDTODEVICE 92
/* DRAFT 0MQ socket events and monitoring */
/* Unspecified system errors during handshake. Event value is an errno. */
......@@ -677,12 +679,9 @@ ZMQ_EXPORT long zmq_timers_timeout (void *timers);
ZMQ_EXPORT int zmq_timers_execute (void *timers);
/******************************************************************************/
/* GSSAPI socket options to set name type */
/* GSSAPI definitions */
/******************************************************************************/
#define ZMQ_GSSAPI_PRINCIPAL_NAMETYPE 90
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE 91
/* GSSAPI principal name types */
#define ZMQ_GSSAPI_NT_HOSTBASED 0
#define ZMQ_GSSAPI_NT_USER_NAME 1
......
......@@ -4,6 +4,7 @@ Priority: optional
Maintainer: libzmq Developers <zeromq-dev@lists.zeromq.org>
Build-Depends: debhelper (>= 9),
dh-autoreconf,
libkrb5-dev,
libpgm-dev,
libsodium-dev,
libunwind-dev | libunwind8-dev | libunwind7-dev,
......
......@@ -41,7 +41,7 @@ override_dh_clean:
rm -f config.log
override_dh_auto_configure:
dh_auto_configure -- --with-pgm --with-libsodium --enable-drafts=$(DRAFTS)
dh_auto_configure -- --with-pgm --with-libsodium --enable-drafts=$(DRAFTS) --with-libgssapi_krb5=yes
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
......
......@@ -6,7 +6,7 @@ Version: 4.2.3
Maintainer: libzmq Developers <zeromq-dev@lists.zeromq.org>
Homepage: http://www.zeromq.org/
Standards-Version: 3.9.8
Build-Depends: debhelper (>= 9), dh-autoreconf, libpgm-dev, libsodium-dev, libunwind-dev | libunwind8-dev | libunwind7-dev, pkg-config, asciidoc-base | asciidoc, xmlto
Build-Depends: debhelper (>= 9), dh-autoreconf, libkrb5-dev, libpgm-dev, libsodium-dev, libunwind-dev | libunwind8-dev | libunwind7-dev, pkg-config, asciidoc-base | asciidoc, xmlto
Package-List:
libzmq3-dev deb libdevel optional arch=any
libzmq5 deb libs optional arch=any
......
......@@ -24,9 +24,26 @@ BuildRequires: autoconf automake libtool libsodium-devel glib2-devel
BuildRequires: e2fsprogs-devel
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%endif
%bcond_with pgm
%if %{with pgm}
BuildRequires: openpgm-devel
%define PGM yes
%else
%define PGM no
%endif
%bcond_with libgssapi_krb5
%if %{with libgssapi_krb5}
BuildRequires: krb5-devel
%define GSSAPI yes
%else
%define GSSAPI no
%endif
%bcond_with libsodium
%if %{with libsodium}
BuildRequires: libsodium-devel
%define SODIUM yes
%else
%define SODIUM no
%endif
BuildRequires: gcc, make, gcc-c++, libstdc++-devel, asciidoc, xmlto
Requires: libstdc++
......@@ -126,12 +143,9 @@ sed -i "s/openpgm-[0-9].[0-9]/%{openpgm_pc}/g" \
%build
autoreconf -fi
%configure --enable-drafts=%{DRAFTS} \
%{?_with_libsodium} \
%{?_without_libsodium} \
%{?_with_pgm} \
%{?_without_pgm} \
%{?_with_libgssapi_krb5} \
%{?_without_libgssapi_krb5} \
--with-pgm=%{PGM} \
--with-libsodium=%{SODIUM} \
--with-libgssapi_krb5=%{GSSAPI} \
%{?_with_pic} \
%{?_without_pic} \
%{?_with_gnu_ld} \
......
......@@ -43,7 +43,7 @@
zmq::gssapi_client_t::gssapi_client_t (session_base_t *session_,
const options_t &options_) :
mechanism_base_t (session_, options_),
gssapi_mechanism_base_t (options_),
gssapi_mechanism_base_t (session_, options_),
state (call_next_init),
token_ptr (GSS_C_NO_BUFFER),
mechs (),
......
......@@ -42,7 +42,6 @@
zmq::gssapi_mechanism_base_t::gssapi_mechanism_base_t (
session_base_t *session_,
const std::string &peer_address_,
const options_t &options_) :
mechanism_base_t (session_, options_),
send_tok (),
......@@ -314,32 +313,7 @@ int zmq::gssapi_mechanism_base_t::process_initiate (msg_t *msg_, void **token_va
int zmq::gssapi_mechanism_base_t::produce_ready (msg_t *msg_)
{
unsigned char * const command_buffer = (unsigned char *) malloc (512);
alloc_assert (command_buffer);
unsigned char *ptr = command_buffer;
// Add command name
memcpy (ptr, "\x05READY", 6);
ptr += 6;
// Add socket type property
const char *socket_type = socket_type_string (options.type);
ptr += add_property (ptr, ZMQ_MSG_PROPERTY_SOCKET_TYPE, socket_type,
strlen (socket_type));
// Add identity property
if (options.type == ZMQ_REQ
|| options.type == ZMQ_DEALER
|| options.type == ZMQ_ROUTER)
ptr += add_property (ptr, ZMQ_MSG_PROPERTY_IDENTITY, options.identity,
options.identity_size);
const size_t command_size = ptr - command_buffer;
const int rc = msg_->init_size (command_size);
errno_assert (rc == 0);
memcpy (msg_->data (), command_buffer, command_size);
free (command_buffer);
make_command_with_basic_properties (msg_, "\5READY", 6);
if (do_encryption)
return encode_message (msg_);
......
......@@ -37,7 +37,7 @@
#endif
#include <gssapi/gssapi_krb5.h>
#include "mechanism.hpp"
#include "mechanism_base.hpp"
#include "options.hpp"
namespace zmq
......@@ -53,7 +53,6 @@ namespace zmq
{
public:
gssapi_mechanism_base_t (session_base_t *session_,
const std::string &peer_address_,
const options_t &options_);
virtual ~gssapi_mechanism_base_t () = 0;
......
......@@ -46,8 +46,10 @@ zmq::gssapi_server_t::gssapi_server_t (session_base_t *session_,
const std::string &peer_address_,
const options_t &options_) :
mechanism_base_t (session_, options_),
gssapi_mechanism_base_t (options_),
gssapi_mechanism_base_t (session_, options_),
zap_client_t (session_, peer_address_, options_),
session (session_),
peer_address (peer_address_),
state (recv_next_token),
security_context_established (false)
{
......@@ -156,7 +158,8 @@ void zmq::gssapi_server_t::send_zap_request ()
{
gss_buffer_desc principal;
gss_display_name (&min_stat, target_name, &principal, NULL);
zap_client_t::send_zap_request ("GSSAPI", 6, principal.value,
zap_client_t::send_zap_request ("GSSAPI", 6,
reinterpret_cast<const uint8_t *> (principal.value),
principal.length);
gss_release_buffer (&min_stat, &principal);
......
......@@ -73,8 +73,6 @@ namespace zmq
const std::string peer_address;
zap_client_t zap_client;
// Current FSM state
state_t state;
......
......@@ -47,7 +47,9 @@
#define ZMQ_DGRAM 18
/* DRAFT Socket options. */
#define ZMQ_BINDTODEVICE 90
#define ZMQ_GSSAPI_PRINCIPAL_NAMETYPE 90
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE 91
#define ZMQ_BINDTODEVICE 92
/* DRAFT 0MQ socket events and monitoring */
/* Unspecified system errors during handshake. Event value is an errno. */
......@@ -155,12 +157,9 @@ long zmq_timers_timeout (void *timers);
int zmq_timers_execute (void *timers);
/******************************************************************************/
/* GSSAPI socket options to set name type */
/* GSSAPI definitions */
/******************************************************************************/
#define ZMQ_GSSAPI_PRINCIPAL_NAMETYPE 90
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE 91
/* GSSAPI principal name types */
#define ZMQ_GSSAPI_NT_HOSTBASED 0
#define ZMQ_GSSAPI_NT_USER_NAME 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment