LCOV - code coverage report
Current view: top level - common - openpgpdefs.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 23 0.0 %
Date: 2016-11-29 15:00:56 Functions: 0 1 0.0 %

          Line data    Source code
       1             : /* openpgpdefs.h - Constants from the OpenPGP standard (rfc2440)
       2             :  * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
       3             :  *               2006 Free Software Foundation, Inc.
       4             :  * Copyright (C) 2014 Werner Koch
       5             :  *
       6             :  * This file is free software; you can redistribute it and/or modify
       7             :  * it under the terms of either
       8             :  *
       9             :  *   - the GNU Lesser General Public License as published by the Free
      10             :  *     Software Foundation; either version 3 of the License, or (at
      11             :  *     your option) any later version.
      12             :  *
      13             :  * or
      14             :  *
      15             :  *   - the GNU General Public License as published by the Free
      16             :  *     Software Foundation; either version 2 of the License, or (at
      17             :  *     your option) any later version.
      18             :  *
      19             :  * or both in parallel, as here.
      20             :  *
      21             :  * This file is distributed in the hope that it will be useful,
      22             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      23             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      24             :  * GNU General Public License for more details.
      25             :  *
      26             :  * You should have received a copy of the GNU General Public License
      27             :  * along with this program; if not, see <https://www.gnu.org/licenses/>.
      28             :  */
      29             : 
      30             : #ifndef GNUPG_COMMON_OPENPGPDEFS_H
      31             : #define GNUPG_COMMON_OPENPGPDEFS_H
      32             : 
      33             : typedef enum
      34             :   {
      35             :     PKT_NONE          = 0,
      36             :     PKT_PUBKEY_ENC    = 1,  /* Public key encrypted packet. */
      37             :     PKT_SIGNATURE     = 2,  /* Secret key encrypted packet. */
      38             :     PKT_SYMKEY_ENC    = 3,  /* Session key packet. */
      39             :     PKT_ONEPASS_SIG   = 4,  /* One pass sig packet. */
      40             :     PKT_SECRET_KEY    = 5,  /* Secret key. */
      41             :     PKT_PUBLIC_KEY    = 6,  /* Public key. */
      42             :     PKT_SECRET_SUBKEY = 7,  /* Secret subkey. */
      43             :     PKT_COMPRESSED    = 8,  /* Compressed data packet. */
      44             :     PKT_ENCRYPTED     = 9,  /* Conventional encrypted data. */
      45             :     PKT_MARKER        = 10, /* Marker packet. */
      46             :     PKT_PLAINTEXT     = 11, /* Literal data packet. */
      47             :     PKT_RING_TRUST    = 12, /* Keyring trust packet. */
      48             :     PKT_USER_ID       = 13, /* User id packet. */
      49             :     PKT_PUBLIC_SUBKEY = 14, /* Public subkey. */
      50             :     PKT_OLD_COMMENT   = 16, /* Comment packet from an OpenPGP draft. */
      51             :     PKT_ATTRIBUTE     = 17, /* PGP's attribute packet. */
      52             :     PKT_ENCRYPTED_MDC = 18, /* Integrity protected encrypted data. */
      53             :     PKT_MDC           = 19, /* Manipulation detection code packet. */
      54             :     PKT_COMMENT       = 61, /* new comment packet (GnuPG specific). */
      55             :     PKT_GPG_CONTROL   = 63  /* internal control packet (GnuPG specific). */
      56             :   }
      57             : pkttype_t;
      58             : 
      59             : static inline const char *
      60           0 : pkttype_str (pkttype_t type)
      61             : {
      62           0 :   switch (type)
      63             :     {
      64           0 :     case PKT_PUBKEY_ENC: return "PUBKEY_ENC";
      65           0 :     case PKT_SIGNATURE: return "SIGNATURE";
      66           0 :     case PKT_SYMKEY_ENC: return "SYMKEY_ENC";
      67           0 :     case PKT_ONEPASS_SIG: return "ONEPASS_SIG";
      68           0 :     case PKT_SECRET_KEY: return "SECRET_KEY";
      69           0 :     case PKT_PUBLIC_KEY: return "PUBLIC_KEY";
      70           0 :     case PKT_SECRET_SUBKEY: return "SECRET_SUBKEY";
      71           0 :     case PKT_COMPRESSED: return "COMPRESSED";
      72           0 :     case PKT_ENCRYPTED: return "ENCRYPTED";
      73           0 :     case PKT_MARKER: return "MARKER";
      74           0 :     case PKT_PLAINTEXT: return "PLAINTEXT";
      75           0 :     case PKT_RING_TRUST: return "RING_TRUST";
      76           0 :     case PKT_USER_ID: return "USER_ID";
      77           0 :     case PKT_PUBLIC_SUBKEY: return "PUBLIC_SUBKEY";
      78           0 :     case PKT_OLD_COMMENT: return "OLD_COMMENT";
      79           0 :     case PKT_ATTRIBUTE: return "ATTRIBUTE";
      80           0 :     case PKT_ENCRYPTED_MDC: return "ENCRYPTED_MDC";
      81           0 :     case PKT_MDC: return "MDC";
      82           0 :     case PKT_COMMENT: return "COMMENT";
      83           0 :     case PKT_GPG_CONTROL: return "GPG_CONTROL";
      84           0 :     default: return "unknown packet type";
      85             :     }
      86             : }
      87             : 
      88             : typedef enum
      89             :   {
      90             :     SIGSUBPKT_TEST_CRITICAL = -3,
      91             :     SIGSUBPKT_LIST_UNHASHED = -2,
      92             :     SIGSUBPKT_LIST_HASHED   = -1,
      93             :     SIGSUBPKT_NONE          =  0,
      94             :     SIGSUBPKT_SIG_CREATED   =  2, /* Signature creation time. */
      95             :     SIGSUBPKT_SIG_EXPIRE    =  3, /* Signature expiration time. */
      96             :     SIGSUBPKT_EXPORTABLE    =  4, /* Exportable. */
      97             :     SIGSUBPKT_TRUST         =  5, /* Trust signature. */
      98             :     SIGSUBPKT_REGEXP        =  6, /* Regular expression. */
      99             :     SIGSUBPKT_REVOCABLE     =  7, /* Revocable. */
     100             :     SIGSUBPKT_KEY_EXPIRE    =  9, /* Key expiration time. */
     101             :     SIGSUBPKT_ARR           = 10, /* Additional recipient request. */
     102             :     SIGSUBPKT_PREF_SYM      = 11, /* Preferred symmetric algorithms. */
     103             :     SIGSUBPKT_REV_KEY       = 12, /* Revocation key. */
     104             :     SIGSUBPKT_ISSUER        = 16, /* Issuer key ID. */
     105             :     SIGSUBPKT_NOTATION      = 20, /* Notation data. */
     106             :     SIGSUBPKT_PREF_HASH     = 21, /* Preferred hash algorithms. */
     107             :     SIGSUBPKT_PREF_COMPR    = 22, /* Preferred compression algorithms. */
     108             :     SIGSUBPKT_KS_FLAGS      = 23, /* Key server preferences. */
     109             :     SIGSUBPKT_PREF_KS       = 24, /* Preferred keyserver. */
     110             :     SIGSUBPKT_PRIMARY_UID   = 25, /* Primary user id. */
     111             :     SIGSUBPKT_POLICY        = 26, /* Policy URL. */
     112             :     SIGSUBPKT_KEY_FLAGS     = 27, /* Key flags. */
     113             :     SIGSUBPKT_SIGNERS_UID   = 28, /* Signer's user id. */
     114             :     SIGSUBPKT_REVOC_REASON  = 29, /* Reason for revocation. */
     115             :     SIGSUBPKT_FEATURES      = 30, /* Feature flags. */
     116             : 
     117             :     SIGSUBPKT_SIGNATURE     = 32, /* Embedded signature. */
     118             :     SIGSUBPKT_ISSUER_FPR    = 33, /* EXPERIMENTAL: Issuer fingerprint. */
     119             : 
     120             :     SIGSUBPKT_FLAG_CRITICAL = 128
     121             :   }
     122             : sigsubpkttype_t;
     123             : 
     124             : 
     125             : typedef enum
     126             :   {
     127             :     CIPHER_ALGO_NONE        =  0,
     128             :     CIPHER_ALGO_IDEA        =  1,
     129             :     CIPHER_ALGO_3DES        =  2,
     130             :     CIPHER_ALGO_CAST5       =  3,
     131             :     CIPHER_ALGO_BLOWFISH    =  4, /* 128 bit */
     132             :     /* 5 & 6 are reserved */
     133             :     CIPHER_ALGO_AES         =  7,
     134             :     CIPHER_ALGO_AES192      =  8,
     135             :     CIPHER_ALGO_AES256      =  9,
     136             :     CIPHER_ALGO_TWOFISH     = 10, /* 256 bit */
     137             :     CIPHER_ALGO_CAMELLIA128 = 11,
     138             :     CIPHER_ALGO_CAMELLIA192 = 12,
     139             :     CIPHER_ALGO_CAMELLIA256 = 13
     140             :   }
     141             : cipher_algo_t;
     142             : 
     143             : 
     144             : typedef enum
     145             :   {
     146             :     PUBKEY_ALGO_RSA         =  1,
     147             :     PUBKEY_ALGO_RSA_E       =  2, /* RSA encrypt only (legacy). */
     148             :     PUBKEY_ALGO_RSA_S       =  3, /* RSA sign only (legacy).    */
     149             :     PUBKEY_ALGO_ELGAMAL_E   = 16, /* Elgamal encrypt only.      */
     150             :     PUBKEY_ALGO_DSA         = 17,
     151             :     PUBKEY_ALGO_ECDH        = 18, /* RFC-6637  */
     152             :     PUBKEY_ALGO_ECDSA       = 19, /* RFC-6637  */
     153             :     PUBKEY_ALGO_ELGAMAL     = 20, /* Elgamal encrypt+sign (legacy).  */
     154             :     /*                        21     reserved by OpenPGP.            */
     155             :     PUBKEY_ALGO_EDDSA       = 22  /* EdDSA (not yet assigned).       */
     156             :   }
     157             : pubkey_algo_t;
     158             : 
     159             : 
     160             : typedef enum
     161             :   {
     162             :     DIGEST_ALGO_MD5         =  1,
     163             :     DIGEST_ALGO_SHA1        =  2,
     164             :     DIGEST_ALGO_RMD160      =  3,
     165             :     /* 4, 5, 6, and 7 are reserved. */
     166             :     DIGEST_ALGO_SHA256      =  8,
     167             :     DIGEST_ALGO_SHA384      =  9,
     168             :     DIGEST_ALGO_SHA512      = 10,
     169             :     DIGEST_ALGO_SHA224      = 11
     170             :   }
     171             : digest_algo_t;
     172             : 
     173             : 
     174             : typedef enum
     175             :   {
     176             :     COMPRESS_ALGO_NONE      =  0,
     177             :     COMPRESS_ALGO_ZIP       =  1,
     178             :     COMPRESS_ALGO_ZLIB      =  2,
     179             :     COMPRESS_ALGO_BZIP2     =  3
     180             :   }
     181             : compress_algo_t;
     182             : 
     183             : 
     184             : #endif /*GNUPG_COMMON_OPENPGPDEFS_H*/

Generated by: LCOV version 1.11