lib/pubnub/events/subscribe.rb in pubnub-5.2.2 vs lib/pubnub/events/subscribe.rb in pubnub-5.3.0
- old
+ new
@@ -6,9 +6,14 @@
include Concurrent::Async
include Pubnub::Validator::Subscribe
def initialize(options, app)
@event = :subscribe
+
+ # Override crypto module if custom cipher key has been used.
+ random_iv = options.key?(:random_iv) ? options[:random_iv] : true
+ options[:crypto_module] = Crypto::CryptoModule.new_legacy(options[:cipher_key], random_iv) if options[:cipher_key]
+
super
app.apply_state(self)
end
def clear_state