~ubuntu-branches/ubuntu/utopic/gnupg2/utopic-updates

« back to all changes in this revision

Viewing changes to .pc/CVE-2013-4351.patch/include/cipher.h

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-11-01 22:15:05 UTC
  • mfrom: (14.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20131101221505-i1zpbl1qd1a3gsvx
Tags: 2.0.22-1ubuntu1
* Merge from Debian, remaining changes:
  - Drop sh prefix from openpgp test environment as it leads to exec
  invocations of sh /bin/bash leading to syntax errors from sh.  Fixes
  FTBFS detected in Ubuntu saucy archive rebuild.
  - Add udev rules to give gpg access to some smartcard readers;
    Debian #543217.
  - debian/gnupg2.udev: udev rules to set ACLs on SCM smartcard readers.
  - Add upstart user job for gpg-agent.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* cipher.h - Definitions for OpenPGP
2
 
 * Copyright (C) 1998, 1999, 2000, 2001, 2006,
3
 
 *               2007  Free Software Foundation, Inc.
4
 
 *
5
 
 * This file is part of GnuPG.
6
 
 *
7
 
 * GnuPG is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; either version 3 of the License, or
10
 
 * (at your option) any later version.
11
 
 *
12
 
 * GnuPG is distributed in the hope that it will be useful,
13
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 * GNU General Public License for more details.
16
 
 *
17
 
 * You should have received a copy of the GNU General Public License
18
 
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19
 
 */
20
 
#ifndef G10_CIPHER_H
21
 
#define G10_CIPHER_H
22
 
 
23
 
#include <gcrypt.h>
24
 
 
25
 
/* Macros for compatibility with older libgcrypt versions. */
26
 
#ifndef GCRY_PK_USAGE_CERT
27
 
# define GCRY_PK_USAGE_CERT 4
28
 
# define GCRY_PK_USAGE_AUTH 8
29
 
# define GCRY_PK_USAGE_UNKN 128
30
 
#endif
31
 
 
32
 
 
33
 
/* Constants for OpenPGP. */
34
 
 
35
 
#define CIPHER_ALGO_NONE         /*  0 */  GCRY_CIPHER_NONE
36
 
#define CIPHER_ALGO_IDEA         /*  1 */  GCRY_CIPHER_IDEA
37
 
#define CIPHER_ALGO_3DES         /*  2 */  GCRY_CIPHER_3DES
38
 
#define CIPHER_ALGO_CAST5        /*  3 */  GCRY_CIPHER_CAST5
39
 
#define CIPHER_ALGO_BLOWFISH     /*  4 */  GCRY_CIPHER_BLOWFISH /* 128 bit */
40
 
/* 5 & 6 are reserved */
41
 
#define CIPHER_ALGO_AES          /*  7 */  GCRY_CIPHER_AES
42
 
#define CIPHER_ALGO_AES192       /*  8 */  GCRY_CIPHER_AES192
43
 
#define CIPHER_ALGO_AES256       /*  9 */  GCRY_CIPHER_AES256
44
 
#define CIPHER_ALGO_RIJNDAEL     CIPHER_ALGO_AES
45
 
#define CIPHER_ALGO_RIJNDAEL192  CIPHER_ALGO_AES192
46
 
#define CIPHER_ALGO_RIJNDAEL256  CIPHER_ALGO_AES256
47
 
#define CIPHER_ALGO_TWOFISH      /* 10 */  GCRY_CIPHER_TWOFISH  /* 256 bit */
48
 
/* Note: Camellia ids don't match those used by libgcrypt. */
49
 
#define CIPHER_ALGO_CAMELLIA128     11
50
 
#define CIPHER_ALGO_CAMELLIA192     12
51
 
#define CIPHER_ALGO_CAMELLIA256     13
52
 
#define CIPHER_ALGO_DUMMY          110    /* No encryption at all. */
53
 
 
54
 
#define PUBKEY_ALGO_RSA          /*  1 */ GCRY_PK_RSA
55
 
#define PUBKEY_ALGO_RSA_E        /*  2 */ GCRY_PK_RSA_E /* RSA encrypt only. */
56
 
#define PUBKEY_ALGO_RSA_S        /*  3 */ GCRY_PK_RSA_S /* RSA sign only.    */
57
 
#define PUBKEY_ALGO_ELGAMAL_E    /* 16 */ GCRY_PK_ELG_E /* Elgamal encr only */
58
 
#define PUBKEY_ALGO_DSA          /* 17 */ GCRY_PK_DSA
59
 
#define PUBKEY_ALGO_ECDH            18
60
 
#define PUBKEY_ALGO_ECDSA           19
61
 
#define PUBKEY_ALGO_ELGAMAL      /* 20 */ GCRY_PK_ELG   /* Elgamal encr+sign */
62
 
 
63
 
#define PUBKEY_USAGE_SIG     GCRY_PK_USAGE_SIGN  /* Good for signatures. */
64
 
#define PUBKEY_USAGE_ENC     GCRY_PK_USAGE_ENCR  /* Good for encryption. */
65
 
#define PUBKEY_USAGE_CERT    GCRY_PK_USAGE_CERT  /* Also good to certify keys. */
66
 
#define PUBKEY_USAGE_AUTH    GCRY_PK_USAGE_AUTH  /* Good for authentication. */
67
 
#define PUBKEY_USAGE_UNKNOWN GCRY_PK_USAGE_UNKN  /* Unknown usage flag. */
68
 
 
69
 
#define DIGEST_ALGO_MD5       /*  1 */ GCRY_MD_MD5
70
 
#define DIGEST_ALGO_SHA1      /*  2 */ GCRY_MD_SHA1
71
 
#define DIGEST_ALGO_RMD160    /*  3 */ GCRY_MD_RMD160
72
 
/* 4, 5, 6, and 7 are reserved */
73
 
#define DIGEST_ALGO_SHA256    /*  8 */ GCRY_MD_SHA256
74
 
#define DIGEST_ALGO_SHA384    /*  9 */ GCRY_MD_SHA384
75
 
#define DIGEST_ALGO_SHA512    /* 10 */ GCRY_MD_SHA512
76
 
/* SHA224 is only available in libgcrypt 1.4.0; thus we
77
 
   can't use the GCRY macro here.  */
78
 
#define DIGEST_ALGO_SHA224    /* 11 */ 11 /* GCRY_MD_SHA224 */
79
 
 
80
 
#define COMPRESS_ALGO_NONE 0
81
 
#define COMPRESS_ALGO_ZIP  1
82
 
#define COMPRESS_ALGO_ZLIB 2
83
 
#define COMPRESS_ALGO_BZIP2  3
84
 
 
85
 
#define is_RSA(a)     ((a)==PUBKEY_ALGO_RSA || (a)==PUBKEY_ALGO_RSA_E \
86
 
                       || (a)==PUBKEY_ALGO_RSA_S )
87
 
#define is_ELGAMAL(a) ((a)==PUBKEY_ALGO_ELGAMAL_E)
88
 
#define is_DSA(a)     ((a)==PUBKEY_ALGO_DSA)
89
 
 
90
 
/* The data encryption key object. */
91
 
typedef struct
92
 
{
93
 
  int algo;
94
 
  int keylen;
95
 
  int algo_info_printed;
96
 
  int use_mdc;
97
 
  int symmetric;
98
 
  byte key[32]; /* This is the largest used keylen (256 bit). */
99
 
  char s2k_cacheid[1+16+1];
100
 
} DEK;
101
 
 
102
 
 
103
 
 
104
 
/* Constants to allocate static MPI arrays. */
105
 
#define PUBKEY_MAX_NPKEY  4
106
 
#define PUBKEY_MAX_NSKEY  6
107
 
#define PUBKEY_MAX_NSIG   2
108
 
#define PUBKEY_MAX_NENC   2
109
 
 
110
 
#endif /*G10_CIPHER_H*/