X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pgplib.h;h=a5f536284b9bde5d7a9d1ed14fd05adc1608ada6;hp=9b2b5d56edbcd84d16ddd1999e807f0bf8ae5f4a;hb=766fd6928123218aca635827248299ceeeb1d170;hpb=6833ce8bdca2d64e14485118f2a4417b7e1cb1b1 diff --git a/pgplib.h b/pgplib.h index 9b2b5d5..a5f5362 100644 --- a/pgplib.h +++ b/pgplib.h @@ -1,38 +1,23 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1996,1997 Michael R. Elkins * Copyright (C) 1999-2000 Thomas Roessler * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ -#ifdef CRYPT_BACKEND_CLASSIC_PGP - #include "mutt_crypt.h" - -typedef struct pgp_signature -{ +typedef struct pgp_signature { struct pgp_signature *next; unsigned char sigtype; unsigned long sid1; unsigned long sid2; -} -pgp_sig_t; +} pgp_sig_t; -struct pgp_keyinfo -{ +struct pgp_keyinfo { char *keyid; struct pgp_uid *address; int flags; @@ -44,28 +29,26 @@ struct pgp_keyinfo struct pgp_signature *sigs; struct pgp_keyinfo *next; - short fp_len; /* length of fingerprint. - * 20 for sha-1, 16 for md5. - */ - unsigned char fingerprint[20]; /* large enough to hold SHA-1 and RIPEMD160 - hashes (20 bytes), MD5 hashes just use the - first 16 bytes */ + short fp_len; /* length of fingerprint. + * 20 for sha-1, 16 for md5. + */ + unsigned char fingerprint[20]; /* large enough to hold SHA-1 and RIPEMD160 + hashes (20 bytes), MD5 hashes just use the + first 16 bytes */ }; + /* Note, that pgp_key_t is now pointer and declared in crypt.h */ -typedef struct pgp_uid -{ +typedef struct pgp_uid { char *addr; short trust; int flags; struct pgp_keyinfo *parent; struct pgp_uid *next; struct pgp_signature *sigs; -} -pgp_uid_t; +} pgp_uid_t; -enum pgp_version -{ +enum pgp_version { PGP_V2, PGP_V3, PGP_GPG, @@ -76,15 +59,13 @@ enum pgp_version const char *pgp_pkalgbytype (unsigned char); -pgp_key_t pgp_remove_key (pgp_key_t *, pgp_key_t ); -pgp_uid_t *pgp_copy_uids (pgp_uid_t *, pgp_key_t ); +pgp_key_t pgp_remove_key (pgp_key_t *, pgp_key_t); +pgp_uid_t *pgp_copy_uids (pgp_uid_t *, pgp_key_t); short pgp_canencrypt (unsigned char); short pgp_cansign (unsigned char); short pgp_get_abilities (unsigned char); -void pgp_free_key (pgp_key_t *kpp); - -#define pgp_new_keyinfo() safe_calloc (sizeof *((pgp_key_t)0), 1) +void pgp_free_key (pgp_key_t * kpp); -#endif /* CRYPT_BACKEND_CLASSIC_PGP */ +#define pgp_new_keyinfo() xmalloc(sizeof *((pgp_key_t)0))