-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19624 from cdelafuente-r7/fix/mod/ms_icpr
Fix a crash when generating CSRs with OpenSSL 3.4.0
- Loading branch information
Showing
7 changed files
with
138 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Rex::Proto::X509 | ||
|
||
class Request | ||
def self.create_csr(private_key, cn, algorithm = 'SHA256') | ||
request = OpenSSL::X509::Request.new | ||
request.subject = OpenSSL::X509::Name.new([ | ||
['CN', cn, OpenSSL::ASN1::UTF8STRING] | ||
]) | ||
request.public_key = private_key.public_key | ||
|
||
yield request if block_given? | ||
|
||
request.sign(private_key, OpenSSL::Digest.new(algorithm)) | ||
request | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.