Next: , Previous: The X.509 trust model, Up: More on certificate authentication


5.2 The OpenPGP trust model

The OpenPGP key authentication relies on a distributed trust model, called the “web of trust”. The “web of trust” uses a decentralized system of trusted introducers, which are the same as a CA. OpenPGP allows anyone to sign anyone's else public key. When Alice signs Bob's key, she is introducing Bob's key to anyone who trusts Alice. If someone trusts Alice to introduce keys, then Alice is a trusted introducer in the mind of that observer.

pgp1.png

For example: If David trusts Alice to be an introducer, and Alice signed Bob's key, Dave also trusts Bob's key to be the real one.

There are some key points that are important in that model. In the example Alice has to sign Bob's key, only if she is sure that the key belongs to Bob. Otherwise she may also make Dave falsely believe that this is Bob's key. Dave has also the responsibility to know who to trust. This model is similar to real life relations.

Just see how Charlie behaves in the previous example. Although he has signed Bob's key - because he knows, somehow, that it belongs to Bob - he does not trust Bob to be an introducer. Charlie decided to trust only Kevin, for some reason. A reason could be that Bob is lazy enough, and signs other people's keys without being sure that they belong to the actual owner.

5.2.1 OpenPGP keys

In GnuTLS the OpenPGP key structures [RFC2440] (See RFC2440.) are handled using the gnutls_openpgp_key_t type and the corresponding private keys with the gnutls_openpgp_privkey_t type. All the prototypes for the key handling functions can be found at gnutls/openpgp.h.

5.2.2 Verifying an OpenPGP key

The verification functions of OpenPGP keys, included in GnuTLS, are simple ones, and do not use the features of the “web of trust”. For that reason, if the verification needs are complex, the assistance of external tools like GnuPG and GPGME (http://www.gnupg.org/related_software/gpgme/) is recommended.

There are two verification functions in GnuTLS, The gnutls_openpgp_key_verify_ring and the gnutls_openpgp_key_verify_trustdb. The first one checks an OpenPGP key against a given set of public keys (keyring) and returns the key status. The key verification status is the same as in X.509 certificates, although the meaning and interpretation are different. For example an OpenPGP key may be valid, if the self signature is ok, even if no signers were found. The meaning of verification status is shown in the figure below. The latter function checks a GnuPG trust database for the given key. This function does not check the key signatures, only checks for disabled and revoked keys.

CERT_INVALID:
A signature on the key is invalid. That means that the key was modified by somebody, or corrupted during transport.
CERT_REVOKED:
The key has been revoked by its owner.
CERT_SIGNER_NOT_FOUND:
The key was not signed by a known signer.
GNUTLS_CERT_INSECURE_ALGORITHM:
The certificate was signed using an insecure algorithm such as MD2 or MD5. These algorithms have been broken and should not be trusted.