Skip to content

Commit 7477e44

Browse files
committed
Use urlsafe Base64 en/decode calls.
1 parent c4279a8 commit 7477e44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rex/post/hwbridge/extensions/rftransceiver/rftransceiver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def make_pkt_vlen(idx, len)
8484
# @param data [String] Data to transmit
8585
# @param opt [Hash] Optional parameters: "repeat" => Integer, "offset" => Integer
8686
def rfxmit(idx, data, opt={})
87-
data = Base64.encode64(data)
87+
data = Base64.urlsafe_encode64(data)
8888
request = "/rftransceiver/#{idx}/rfxmit?data=#{data}"
8989
request += "&repeat=#{opt["repeat"]}" if opt.has_key? "repeat"
9090
request += "&offset=#{opt["offset"]}" if opt.has_key? "offset"
@@ -112,7 +112,7 @@ def rfrecv(idx, opt={})
112112
data = client.send_request(request)
113113
# Note the data is initially base64 encoded
114114
if data.size() > 0
115-
data["data"] = Base64.decode64(data["data"]) if data.has_key? "data"
115+
data["data"] = Base64.urlsafe_decode64(data["data"]) if data.has_key? "data"
116116
end
117117
data
118118
end

0 commit comments

Comments
 (0)