From f608b289cc8df43705511fa7c75008852a18c3ac Mon Sep 17 00:00:00 2001 From: amuta Date: Tue, 7 Dec 2021 09:34:15 -0300 Subject: [PATCH] Fix rfx2696 cookie, it should use the to_ber_bin method because to_ber will try to encode to UTF-8 first and break the cookie's representation of binary data --- lib/net/ldap/connection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/ldap/connection.rb b/lib/net/ldap/connection.rb index 71e2edda..aefe46c9 100644 --- a/lib/net/ldap/connection.rb +++ b/lib/net/ldap/connection.rb @@ -429,7 +429,7 @@ def search(args = nil) Net::LDAP::LDAPControls::PAGED_RESULTS.to_ber, # Criticality MUST be false to interoperate with normal LDAPs. false.to_ber, - rfc2696_cookie.map(&:to_ber).to_ber_sequence.to_s.to_ber, + [rfc2696_cookie[0].to_ber, rfc2696_cookie[1].to_ber_bin].to_ber_sequence.to_ber_bin, ].to_ber_sequence if paged controls << ber_sort if ber_sort controls = controls.empty? ? nil : controls.to_ber_contextspecific(0)