00001 /* 00002 * Copyright (c) 2005-2008 Nominet UK (www.nic.uk) 00003 * All rights reserved. 00004 * Contributors: Ben Laurie, Rachel Willmer. The Contributors have asserted 00005 * their moral rights under the UK Copyright Design and Patents Act 1988 to 00006 * be recorded as the authors of this copyright work. 00007 * 00008 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 00009 * use this file except in compliance with the License. 00010 * 00011 * You may obtain a copy of the License at 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, software 00015 * distributed under the License is distributed on an "AS IS" BASIS, 00016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00017 * 00018 * See the License for the specific language governing permissions and 00019 * limitations under the License. 00020 */ 00021 00024 #include <openpgpsdk/types.h> 00025 #include <openpgpsdk/crypto.h> 00026 00028 struct ops_reader_info 00029 { 00030 ops_reader_t *reader; 00032 ops_reader_destroyer_t *destroyer; 00033 void *arg; 00035 ops_boolean_t accumulate:1; 00036 unsigned char *accumulated; 00037 unsigned asize; 00038 unsigned alength; 00039 /* XXX: what do we do about offsets into compressed packets? */ 00040 unsigned position; 00042 ops_reader_info_t *next; 00043 ops_parse_info_t *pinfo; 00044 }; 00045 00046 00050 struct ops_crypt_info 00051 { 00052 char *passphrase; /*<! passphrase to use, this is set by cb_get_passphrase */ 00053 ops_keyring_t *keyring; /*<! keyring to use */ 00054 const ops_keydata_t *keydata; /*<! keydata to use */ 00055 ops_parse_cb_t *cb_get_passphrase; /*<! callback to use to get the passphrase */ 00056 }; 00057 00059 struct ops_parse_cb_info 00060 { 00061 ops_parse_cb_t *cb; 00062 void *arg; 00063 ops_error_t** errors; 00065 ops_parse_cb_info_t *next; 00066 00067 ops_create_info_t *cinfo; 00068 ops_crypt_info_t cryptinfo; 00069 }; 00070 00072 typedef struct 00073 { 00074 ops_hash_t hash; 00075 unsigned char keyid[OPS_KEY_ID_SIZE]; 00076 } ops_parse_hash_info_t; 00077 00078 #define NTAGS 0x100 00079 00101 struct ops_parse_info 00102 { 00103 unsigned char ss_raw[NTAGS/8]; 00105 unsigned char ss_parsed[NTAGS/8]; 00108 ops_reader_info_t rinfo; 00109 ops_parse_cb_info_t cbinfo; 00110 ops_error_t *errors; 00111 ops_crypt_t decrypt; 00112 ops_crypt_info_t cryptinfo; 00113 size_t nhashes; 00114 ops_parse_hash_info_t *hashes; 00115 ops_boolean_t reading_v3_secret:1; 00116 ops_boolean_t reading_mpi_length:1; 00117 ops_boolean_t exact_read:1; 00118 };
1.4.6