Skip to content
Browse files

* illegal regexp to parse RSA PKCS#1 packed data. fixed.

  • Loading branch information...
1 parent 1f3c3f9 commit df50c254857693e73b9c78c67b1f3fa7e48cc49e @nahi committed Nov 4, 2004
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/pgp/pkeyalgorithm.rb
View
2 lib/pgp/pkeyalgorithm.rb
@@ -115,7 +115,7 @@ def self.encode_sessionkey(nbits, algorithm, sessionkey)
end
def self.decode_sessionkey(data)
- rnd, algorithm, rest = data.scan(/\A\000\002([^\000]+)\000(.)(.+)\z/)[0]
+ rnd, algorithm, rest = data.scan(/\A\000\002([^\000]+)\000([\x00-\xff])([\x00-\xff]*)\z/)[0]
algorithm = algorithm.unpack("C")[0]
sessionkey = rest[0..-3]
checksum = MPI.from_bytes(rest[-2..-1])

0 comments on commit df50c25

Please sign in to comment.
Something went wrong with that request. Please try again.