-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add smime support #104
base: master
Are you sure you want to change the base?
add smime support #104
Conversation
for more information, see https://pre-commit.ci
bool writeMimeMessageBuffer(); | ||
bool handleData(PKCS7 *p7, BIO *dataIn, int flags); | ||
|
||
MimeMessage *_mimeMessage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these members should go into a private class, and I think it would be nicer if we could transform a MimeMessage into a SMimeMessage
@@ -93,6 +109,7 @@ target_link_libraries(SimpleMail${PROJECT_VERSION_MAJOR}Qt${QT_VERSION_MAJOR} | |||
PUBLIC | |||
Qt::Core | |||
Qt::Network | |||
${OPENSSL_LIBS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call target_link_libs() agains instead of variable
@@ -228,6 +231,10 @@ bool MimePart::write(QIODevice *device) | |||
headers.append("; name=\"?UTF-8?B?" + d->contentName.toBase64(QByteArray::Base64Encoding) + | |||
"?=\""); | |||
} | |||
if (headers.contains("signed")) { | |||
headers.append("; protocol=\"application/pkcs7-signature\";"); | |||
headers.append("; micalg=sha1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put on a single line, it seems to have doubled ;
|
||
int flags = PKCS7_DETACHED | PKCS7_STREAM | PKCS7_BINARY; | ||
|
||
BIO *out = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null, raw pointers, would be nicer if it was RAII even if with just std::unique_ptr with custom deleter
|
||
void SMime::loadPKCS12PrivateKey() | ||
{ | ||
QFile file(QString::fromLatin1(_keyfile.toStdString().c_str())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for all these conversions
|
||
bool SMime::writeMimeMessageBuffer() | ||
{ | ||
QBuffer *buffer = new QBuffer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the stack instead
Hello,
as promised in Pull Request #101, here is SMIME support for the master branch.