Fix the size of the hash array when checking sig hashes
[onak.git] / openpgp.h
1 /*
2  * openpgp.h - Defines directly related to OpenPGP RFC 4880
3  *
4  * Copyright 2011 Jonathan McDowell <noodles@earth.li>
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program; if not, write to the Free Software Foundation, Inc., 51
17  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __OPENPGP_H__
21 #define __OPENPGP_H__
22
23 #define OPENPGP_PKALGO_RSA              1
24 #define OPENPGP_PKALGO_ELGAMAL          16
25 #define OPENPGP_PKALGO_DSA              17
26 #define OPENPGP_PKALGO_ELGAMAL_SIGN     20
27
28 #define OPENPGP_HASH_MD5                1
29 #define OPENPGP_HASH_SHA1               2
30 #define OPENPGP_HASH_RIPEMD160          3
31 #define OPENPGP_HASH_SHA256             8
32 #define OPENPGP_HASH_SHA384             9
33 #define OPENPGP_HASH_SHA512             10
34 #define OPENPGP_HASH_SHA224             11
35
36 #define OPENPGP_PACKET_SIGNATURE        2
37 #define OPENPGP_PACKET_PUBLICKEY        6
38 #define OPENPGP_PACKET_TRUST            12
39 #define OPENPGP_PACKET_UID              13
40 #define OPENPGP_PACKET_PUBLICSUBKEY     14
41 #define OPENPGP_PACKET_UAT              17
42
43 #define OPENPGP_SIGTYPE_BINARY          0x00
44 #define OPENPGP_SIGTYPE_TEXT            0x01
45 #define OPENPGP_SIGTYPE_KEY_REV         0x20
46 #define OPENPGP_SIGTYPE_SUBKEY_REV      0x28
47 #define OPENPGP_SIGTYPE_CERT_REV        0x30
48
49 #define OPENPGP_SIGSUB_CREATION         2
50 #define OPENPGP_SIGSUB_EXPIRY           3
51 #define OPENPGP_SIGSUB_EXPORTABLE       4
52 #define OPENPGP_SIGSUB_TRUSTSIG         5
53 #define OPENPGP_SIGSUB_REGEX            6
54 #define OPENPGP_SIGSUB_KEYEXPIRY        9
55 #define OPENPGP_SIGSUB_PREFSYM          11
56 #define OPENPGP_SIGSUB_ISSUER           16
57 #define OPENPGP_SIGSUB_NOTATION         20
58 #define OPENPGP_SIGSUB_PREFHASH         21
59 #define OPENPGP_SIGSUB_PREFCOMPRESS     22
60 #define OPENPGP_SIGSUB_KEYSERVER        23
61 #define OPENPGP_SIGSUB_PRIMARYUID       25
62 #define OPENPGP_SIGSUB_POLICYURI        26
63 #define OPENPGP_SIGSUB_KEYFLAGS         27
64
65 #endif /* __OPENPGP_H__ */