Browse Source

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

doc_update_sequoia
Krista Grothoff 6 years ago
parent
commit
01ea05e22e
2 changed files with 8 additions and 2 deletions
  1. +3
    -0
      src/keymanagement.c
  2. +5
    -2
      test/message_api_test.cc

+ 3
- 0
src/keymanagement.c View File

@ -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) {


+ 5
- 2
test/message_api_test.cc View File

@ -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