1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-04 18:29:19 +02:00

Typo, comment.

This commit is contained in:
B. Petersen 2017-05-24 22:01:25 +02:00
parent ee7cf1d018
commit 9d4b18e5e3
5 changed files with 20 additions and 5 deletions

View file

@ -545,9 +545,11 @@ pgp_write_xfer_key(pgp_output_t *output,
unsigned subkeysigidx = 0;
pgp_subkeysig_t *subkeysigp;
#if 0 ////// -- we don't need armored keys (only armored messages)
if (armoured) {
pgp_writer_push_armoured(output, PGP_PGP_PUBLIC_KEY_BLOCK);
}
#endif //////
/* primary key */
if (key->type == PGP_PTAG_CT_PUBLIC_KEY) {

View file

@ -847,23 +847,28 @@ armoured_finaliser(pgp_armor_type_t type,
return stacked_write(writer, tail, tailsize, errors);
}
#if 0 //////
static unsigned
armored_pubkey_fini(pgp_error_t **errors, pgp_writer_t *writer)
{
return armoured_finaliser(PGP_PGP_PUBLIC_KEY_BLOCK, errors, writer);
}
#endif //////
#if 0 //////
static unsigned
armored_privkey_fini(pgp_error_t **errors, pgp_writer_t *writer)
{
return armoured_finaliser(PGP_PGP_PRIVATE_KEY_BLOCK, errors, writer);
}
#endif //////
/* \todo use this for other armoured types */
/**
\ingroup Core_WritersNext
\brief Push Armoured Writer on stack (generic)
*/
#if 0 //////
void
pgp_writer_push_armoured(pgp_output_t *output, pgp_armor_type_t type)
{
@ -919,6 +924,7 @@ pgp_writer_push_armoured(pgp_output_t *output, pgp_armor_type_t type)
pgp_writer_push(output, base64_writer, finaliser,
generic_destroyer, base64);
}
#endif //////
/**************************************************************************/

View file

@ -66,6 +66,13 @@ static int load_or_generate_public_key__(mrmailbox_t* mailbox, mrkey_t* public_k
mrsqlite3_unlock(mailbox->m_sql); /* SIC! unlock database during creation - otherwise the GUI may hang */
/* The public key must contain the following:
- a signing-capable primary key Kp
- a user id
- a self signature
- an encryption-capable subkey Ke
- a binding signature over Ke by Kp
(see https://autocrypt.readthedocs.io/en/latest/level0.html#type-p-openpgp-based-key-data )*/
key_created = mre2ee_driver_create_keypair(mailbox, self_addr, public_key, private_key);
mrsqlite3_lock(mailbox->m_sql);

View file

@ -215,7 +215,7 @@ cleanup:
if( secout ) { pgp_output_delete(secout); }
if( pubmem ) { pgp_memory_free(pubmem); }
if( secmem ) { pgp_memory_free(secmem); }
pgp_key_free(&seckey); /* not: pgp_keydata_free() which will also free the pointer itself (we created it on the statck) */
pgp_key_free(&seckey); /* not: pgp_keydata_free() which will also free the pointer itself (we created it on the stack) */
pgp_key_free(&pubkey);
pgp_key_free(&subkey);
free(user_id);

View file

@ -168,10 +168,10 @@ void stress_functions(mrmailbox_t* mailbox)
{
mrkey_t *public_key = mrkey_new(), *private_key = mrkey_new();
mre2ee_driver_create_keypair(mailbox, "foo@bar.de", public_key, private_key);
/*char* temp = mrkey_render_base64(public_key, 78, " ");
char* tempsec = mrkey_render_base64(private_key, 78, " ");
printf("\nPUBLIC: [%s]\nPRIVATE: [%s]\n", temp, tempsec);
free(temp); free(tempsec);*/
char* temp = mrkey_render_base64(public_key, 78, "\n");
char* tempsec = mrkey_render_base64(private_key, 78, "\n");
printf("\n-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n%s\n-----END PGP PUBLIC KEY BLOCK-----\n\n-----BEGIN PGP PRIVATE KEY BLOCK-----\n\n%s\n-----END PGP PRIVATE KEY BLOCK-----\n", temp, tempsec);
free(temp); free(tempsec);
#if 0
mrkey_t *public_key2 = mrkey_new(), *private_key2 = mrkey_new();