-
Notifications
You must be signed in to change notification settings - Fork 5
Signatures
A message can be sent in one of 3 "types/modes":
- origin a regular message send from a client account to another client account
- authorized a message sent on behalf of a client account but without access to the client's private key
- server a message send from a mail-server to a client
The signature check will differ based on the sending mode
- if the send type is "origin":
- get the public key of the sender
- hash the header (without signatures)
- verify if the given client signature matches the header-hash (using: header hash, client signature, public key)
- if the send type is "authorized":
-
get the public key of the origin sender (this is actually the originator who we send on behalf)
-
get the public key of the AUTHORIZEDBY from the header
-
get the signature of the AUTHORIZEDBY from the header
-
verify if the signature matches (using: hash authorized public key, authorized signature, origin public key)
-
At this point, we have verified that the public key is valid, as it is signed with the origin public key
-
get the public key of the AUTHORIZEDBY
-
hash the header (without signatures)
-
verify if the given client signature matches the header hash (using: header hash, client signature, AUTHORIZEDBY public key)
-
- if the send type is "server":
- get the public key of the sender as ROUTING (it's not a address hash, but a routing hash)
- hash the header (without signatures)
- verify if the given client signature matches the header-hash (using: header hash, client signature, ROUTING public key)
This will always verify the sending server. A sending server attaches a signature to prove it has originated from that specific server. In the future this could be amended with proxy servers in between (although communication should be end-to-end without proxies)
- if the send type is "server", the server verification is ignored. This is because it is the same signature as the client signature.
- if the send type is "origin":
- get the public key of the sender
- hash the header (without signatures)
- verify if the given server signature matches the header-hash (using: header hash, server signature, public key)