Fixed problem with null usernames coming from prepackaged mime messages in 'From' for MIME_encrypt_message

doc_update_sequoia
Krista Grothoff 7 years ago
parent 9787a03563
commit 01ea05e22e

@ -525,6 +525,9 @@ DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
}
}
if (!identity->username)
identity->username = strdup("");
status = set_identity(session, identity);
assert(status == PEP_STATUS_OK);
if (status != PEP_STATUS_OK) {

@ -145,11 +145,14 @@ int main() {
}
inFile4.close();
const char* out_msg_plain = text4.c_str();
// const char* out_msg_plain = text4.c_str();
const char* out_msg_plain = "From: krista@kgrothoff.org\nTo: Volker <vb@pep-project.org>\nSubject: Test\nContent-Type: text/plain; charset=utf-8\nContent-Language: en-US\nContent-Transfer-Encoding:quoted-printable\n\ngaga\n\n";
char* enc_msg = NULL;
char* dec_msg = NULL;
PEP_STATUS status7 = MIME_encrypt_message(session, text4.c_str(), text4.length(), NULL, &enc_msg, PEP_enc_PGP_MIME, 0);
// PEP_STATUS status7 = MIME_encrypt_message(session, text4.c_str(), text4.length(), NULL, &enc_msg, PEP_enc_PGP_MIME, 0);
PEP_STATUS status7 = MIME_encrypt_message(session, out_msg_plain, strlen(out_msg_plain), NULL, &enc_msg, PEP_enc_PGP_MIME, 0);
assert(status7 == PEP_STATUS_OK);
cout << enc_msg << endl;

Loading…
Cancel
Save