Skip to content

Commit

Permalink
* illegal regexp to parse RSA PKCS#1 packed data. fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
nahi committed Nov 4, 2004
1 parent 1f3c3f9 commit df50c25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pgp/pkeyalgorithm.rb
Expand Up @@ -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])
Expand Down

0 comments on commit df50c25

Please sign in to comment.