[PR #505] [CLOSED] Autocrypt base implementation #856

Closed
opened 2026-02-25 21:36:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cypht-org/cypht/pull/505
Author: @henrique-borba
Created: 8/24/2021
Status: Closed

Base: masterHead: autocrypt-implementation


📝 Commits (1)

  • a6f965c Autocrypt base header parsing, public key import and send

📊 Changes

9 files changed (+109 additions, -9 deletions)

View changed files

📝 modules/imap/output_modules.php (+16 -2)
📝 modules/imap/site.css (+5 -1)
📝 modules/pgp/modules.php (+35 -0)
📝 modules/pgp/setup.php (+4 -1)
📝 modules/pgp/site.js (+30 -3)
📝 modules/smtp/hm-mime-message.php (+4 -0)
📝 modules/smtp/modules.php (+11 -1)
📝 modules/smtp/setup.php (+3 -1)
📝 modules/smtp/site.css (+1 -0)

📄 Description

Autocrypt

This PR is a preview and it is not ready for merging.

This PR aims to implement the sending and receiving of public PGP keys through message headers using Autocrypt Level 1 standards.

When enabling the PGP module, the user can choose to include a public key in the message header on the compose page. When receiving a message with Autocrypt headers, the user can choose to import the received key on the message preview page.

Reference: https://autocrypt.org

Screenshot_20210824_143717

Screenshot_20210824_143813

Currently mandatory items implemented according to specification

Peer State Management

The Autocrypt Header

  • The addr attribute is mandatory, and contains the single recipient address this header is valid for. If this address differs from the one in the From header, the entire Autocrypt header MUST be treated as invalid.
  • The keydata attribute is mandatory, and contains the key data for the specified addr recipient address. The value of the keydata attribute is a Base64 representation of the binary OpenPGP “Transferable Public Key”. For ease of parsing, the keydata attribute MUST be the last attribute in this header.

OpenPGP Based key data

  • The keydata sent by an Autocrypt-enabled Level 1 MUA MUST consist of an OpenPGP “Transferable Public Key”
  • These packets MUST be assembled in binary format (not ASCII-armored), and then base64-encoded.
  • A Level 1 MUA MUST be capable of processing and handling Ed25519 public keys for signatures, as well as Cv25519 for encryption.

Header injection in outbound mail

  • This header MUST contain the corresponding public key material (accounts[from-addr].public_key) as the keydata attribute, and from-addr as the addr attribute. The most minimal Level 1 compliant MUA will only include these two attributes. If accounts[from-addr].prefer_encrypt is set to mutual, then the header MUST have a prefer-encrypt attribute with the value mutual.
  • If the From address changes during message composition (e.g., if the user selects a different outbound identity), then the MUA MUST change the Autocrypt header accordingly.
  • The MUA MUST NOT include more than one valid Level 1 Autocrypt header (see Updating Autocrypt Peer State).

Message Encryption

  • An Autocrypt MUA MUST NOT create an Autocrypt Setup Message without explicit user interaction

Solves


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cypht-org/cypht/pull/505 **Author:** [@henrique-borba](https://github.com/henrique-borba) **Created:** 8/24/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `autocrypt-implementation` --- ### 📝 Commits (1) - [`a6f965c`](https://github.com/cypht-org/cypht/commit/a6f965cef3eee6f4d59a161661d22f9b038b629f) Autocrypt base header parsing, public key import and send ### 📊 Changes **9 files changed** (+109 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `modules/imap/output_modules.php` (+16 -2) 📝 `modules/imap/site.css` (+5 -1) 📝 `modules/pgp/modules.php` (+35 -0) 📝 `modules/pgp/setup.php` (+4 -1) 📝 `modules/pgp/site.js` (+30 -3) 📝 `modules/smtp/hm-mime-message.php` (+4 -0) 📝 `modules/smtp/modules.php` (+11 -1) 📝 `modules/smtp/setup.php` (+3 -1) 📝 `modules/smtp/site.css` (+1 -0) </details> ### 📄 Description # Autocrypt > This PR is a preview and it is not ready for merging. This PR aims to implement the sending and receiving of public PGP keys through message headers using Autocrypt Level 1 standards. When enabling the PGP module, the user can choose to include a public key in the message header on the compose page. When receiving a message with Autocrypt headers, the user can choose to import the received key on the message preview page. Reference: https://autocrypt.org ![Screenshot_20210824_143717](https://user-images.githubusercontent.com/1107499/130663499-d1864b7a-b729-415d-b10c-f75d61ba678b.png) ![Screenshot_20210824_143813](https://user-images.githubusercontent.com/1107499/130663607-f5303181-d1eb-4750-b723-eaabe609f874.png) # Currently mandatory items implemented according to specification ### Peer State Management #### The Autocrypt Header - The addr attribute is mandatory, and contains the single recipient address this header is valid for. If this address differs from the one in the From header, the entire Autocrypt header **MUST** be treated as invalid. - The keydata attribute is mandatory, and contains the key data for the specified addr recipient address. The value of the keydata attribute is a Base64 representation of the binary OpenPGP “Transferable Public Key”. For ease of parsing, the keydata attribute **MUST** be the last attribute in this header. #### OpenPGP Based key data - The keydata sent by an Autocrypt-enabled Level 1 MUA **MUST** consist of an OpenPGP “Transferable Public Key” - These packets **MUST** be assembled in binary format (not ASCII-armored), and then base64-encoded. - A Level 1 MUA **MUST** be capable of processing and handling Ed25519 public keys for signatures, as well as Cv25519 for encryption. #### Header injection in outbound mail - This header **MUST** contain the corresponding public key material (accounts[from-addr].public_key) as the keydata attribute, and from-addr as the addr attribute. The most minimal Level 1 compliant MUA will only include these two attributes. If accounts[from-addr].prefer_encrypt is set to mutual, then the header **MUST** have a prefer-encrypt attribute with the value mutual. - If the From address changes during message composition (e.g., if the user selects a different outbound identity), then the MUA **MUST** change the Autocrypt header accordingly. - The MUA **MUST NOT** include more than one valid Level 1 Autocrypt header (see Updating Autocrypt Peer State). #### Message Encryption - An Autocrypt MUA **MUST NOT** create an Autocrypt Setup Message without explicit user interaction # Solves - https://github.com/jasonmunro/cypht/issues/241 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 21:36:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#856
No description provided.