Skip to content

Commit

Permalink
Merge pull request #4591 from jrw972/gov-gen-fix
Browse files Browse the repository at this point in the history
`gov_gen` uses openssl API incorrectly
  • Loading branch information
jrw972 committed Apr 18, 2024
2 parents b532e4d + 5a9bc85 commit 270cae5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/news.d/gov-gen.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. news-prs: 4591
.. news-start-section: Fixes
- Fixed incorrect usage of OpenSSL in ``gov_gen`` application.
.. news-end-section
4 changes: 2 additions & 2 deletions tests/security/attributes/gov_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[])
return EXIT_FAILURE;
}

PKCS7* p7 = PKCS7_sign(cert, key, NULL, NULL, PKCS7_TEXT | PKCS7_DETACHED);
PKCS7* p7 = PKCS7_sign(cert, key, NULL, mem, PKCS7_TEXT | PKCS7_DETACHED | PKCS7_STREAM);
if (!p7) {
std::cerr << "ERROR: could not sign" << std::endl;
print_ssl_error();
Expand All @@ -418,7 +418,7 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[])

}

if (!SMIME_write_PKCS7(out, p7, mem, PKCS7_TEXT | PKCS7_DETACHED)) {
if (!SMIME_write_PKCS7(out, p7, mem, PKCS7_TEXT | PKCS7_DETACHED | PKCS7_STREAM)) {
std::cerr << "ERROR: could not write " << outpath << std::endl;
print_ssl_error();
return EXIT_FAILURE;
Expand Down

0 comments on commit 270cae5

Please sign in to comment.