diff --git a/0001-PROTON-974-Accept-a-single-symbol-in-SASL-mechs-fram.patch b/0001-PROTON-974-Accept-a-single-symbol-in-SASL-mechs-fram.patch new file mode 100644 index 0000000..42bc28a --- /dev/null +++ b/0001-PROTON-974-Accept-a-single-symbol-in-SASL-mechs-fram.patch @@ -0,0 +1,66 @@ +From caf9578be09e1540a9b1bb6a0a47abbaa62312ce Mon Sep 17 00:00:00 2001 +From: Andrew Stitcher +Date: Tue, 11 Aug 2015 16:21:39 -0400 +Subject: [PATCH] PROTON-974: Accept a single symbol in SASL mechs frame - As + well as an array of symbols - This is a specific interop issue with qpidd + AMQP 1.0 support + +--- + proton-c/src/sasl/sasl.c | 33 +++++++++++++++++++++++---------- + 1 file changed, 23 insertions(+), 10 deletions(-) + +diff --git a/proton-c/src/sasl/sasl.c b/proton-c/src/sasl/sasl.c +index 6e1ce1d..fb98894 100644 +--- a/proton-c/src/sasl/sasl.c ++++ b/proton-c/src/sasl/sasl.c +@@ -671,24 +671,37 @@ int pn_do_mechanisms(pn_transport_t *transport, uint8_t frame_type, uint16_t cha + + // This scanning relies on pn_data_scan leaving the pn_data_t cursors + // where they are after finishing the scan +- int err = pn_data_scan(args, "D.[@["); ++ pn_string_t *mechs = pn_string(""); ++ ++ // Try array of symbols for mechanism list ++ bool array = false; ++ int err = pn_data_scan(args, "D.[?@[", &array); + if (err) return err; + +- pn_string_t *mechs = pn_string(""); ++ if (array) { ++ // Now keep checking for end of array and pull a symbol ++ while(pn_data_next(args)) { ++ pn_bytes_t s = pn_data_get_symbol(args); ++ if (pni_included_mech(transport->sasl->included_mechanisms, s)) { ++ pn_string_addf(mechs, "%*s ", (int)s.size, s.start); ++ } ++ } + +- // Now keep checking for end of array and pull a symbol +- while(pn_data_next(args)) { +- pn_bytes_t s = pn_data_get_symbol(args); +- if (pni_included_mech(transport->sasl->included_mechanisms, s)) { +- pn_string_addf(mechs, "%*s ", (int)s.size, s.start); ++ if (pn_string_size(mechs)) { ++ pn_string_buffer(mechs)[pn_string_size(mechs)-1] = 0; + } +- } ++ } else { ++ // No array of symbols; try single symbol ++ pn_data_rewind(args); ++ pn_bytes_t symbol; ++ int err = pn_data_scan(args, "D.[s]", &symbol); ++ if (err) return err; + +- if (pn_string_size(mechs)) { +- pn_string_buffer(mechs)[pn_string_size(mechs)-1] = 0; ++ pn_string_setn(mechs, symbol.start, symbol.size); + } + + if (pni_init_client(transport) && ++ pn_string_size(mechs) && + pni_process_mechanisms(transport, pn_string_get(mechs))) { + pni_sasl_set_desired_state(transport, SASL_POSTED_INIT); + } else { +-- +1.8.3.1 + diff --git a/qpid-proton.spec b/qpid-proton.spec index f879593..8b87355 100644 --- a/qpid-proton.spec +++ b/qpid-proton.spec @@ -14,7 +14,7 @@ Name: qpid-proton Version: 0.10 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A high performance, lightweight messaging library License: ASL 2.0 @@ -43,8 +43,10 @@ BuildRequires: epydoc BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Test::Exception) BuildRequires: perl(Test::More) +BuildRequires: cyrus-sasl-devel +Requires: cyrus-sasl-lib - +Patch0: 0001-PROTON-974-Accept-a-single-symbol-in-SASL-mechs-fram.patch %description Proton is a high performance, lightweight messaging library. It can be used in @@ -173,7 +175,7 @@ Requires: qpid-proton-c = %{version}-%{release} %prep %setup -q -n %{name}-%{version} - +%patch0 -p1 %build @@ -214,7 +216,11 @@ make test popd %changelog -* Wed Sep 2 2015 Irina Boverman - 0.10-1 +* Tue Sep 8 2015 Irina Boverman - 0.10-2 +- Added dependency on cyrus-sasl-devel and cyrus-sasl-lib +- Added 0001-PROTON-974-Accept-a-single-symbol-in-SASL-mechs-fram.patch + +* Wed Sep 2 2015 Irina Boverman - 0.10-1 - Rebased to 0.10 * Thu Jun 18 2015 Fedora Release Engineering - 0.9-5