packet.h

Go to the documentation of this file.
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 
00026 #ifndef OPS_PACKET_H
00027 #define OPS_PACKET_H
00028 
00029 #include "configure.h"
00030 
00031 #include <time.h>
00032 #include <openssl/bn.h>
00033 #include <openssl/sha.h>
00034 #include "types.h"
00035 #include "errors.h"
00036 
00040 typedef struct
00041     {
00042     size_t len;
00043     unsigned char *contents;
00044     } ops_data_t;
00045 
00046 /************************************/
00047 /* Packet Tags - RFC4880, 4.2 */
00048 /************************************/
00049 
00056 #define OPS_PTAG_ALWAYS_SET             0x80
00057 
00065 #define OPS_PTAG_NEW_FORMAT             0x40
00066 
00067 
00076 #define OPS_PTAG_OF_CONTENT_TAG_MASK    0x3c
00077 
00084 #define OPS_PTAG_OF_CONTENT_TAG_SHIFT   2
00085 
00093 #define OPS_PTAG_OF_LENGTH_TYPE_MASK    0x03
00094 
00095 
00102 typedef enum
00103     {
00104     OPS_PTAG_OF_LT_ONE_BYTE             =0x00, 
00105     OPS_PTAG_OF_LT_TWO_BYTE             =0x01, 
00106     OPS_PTAG_OF_LT_FOUR_BYTE            =0x02, 
00107     OPS_PTAG_OF_LT_INDETERMINATE        =0x03  
00108     } ops_ptag_of_lt_t;
00109 
00110 
00119 #define OPS_PTAG_NF_CONTENT_TAG_MASK    0x3f
00120 
00127 #define OPS_PTAG_NF_CONTENT_TAG_SHIFT   0
00128 
00129 
00131 typedef struct
00132     {
00133     const char *error; 
00134     } ops_parser_error_t;
00135 
00137 typedef struct
00138     {
00139     ops_errcode_t errcode;
00140     } ops_parser_errcode_t;
00141 
00145 typedef struct
00146     {
00147     unsigned            new_format;     
00148     unsigned            content_tag;    
00149     ops_ptag_of_lt_t    length_type;    
00150     unsigned            length;           /* XXX: Ben, is this correct? */
00153     unsigned            position;       
00154     } ops_ptag_t;
00155 
00163 typedef enum
00164     {
00165     OPS_PKA_RSA                 =1,     
00166     OPS_PKA_RSA_ENCRYPT_ONLY    =2,     
00167     OPS_PKA_RSA_SIGN_ONLY       =3,     
00168     OPS_PKA_ELGAMAL             =16,    
00169     OPS_PKA_DSA                 =17,    
00170     OPS_PKA_RESERVED_ELLIPTIC_CURVE     =18,    
00171     OPS_PKA_RESERVED_ECDSA              =19,    
00172     OPS_PKA_ELGAMAL_ENCRYPT_OR_SIGN     =20,    
00173     OPS_PKA_RESERVED_DH                 =21,    
00174     OPS_PKA_PRIVATE00           =100,   
00175     OPS_PKA_PRIVATE01           =101,   
00176     OPS_PKA_PRIVATE02           =102,   
00177     OPS_PKA_PRIVATE03           =103,   
00178     OPS_PKA_PRIVATE04           =104,   
00179     OPS_PKA_PRIVATE05           =105,   
00180     OPS_PKA_PRIVATE06           =106,   
00181     OPS_PKA_PRIVATE07           =107,   
00182     OPS_PKA_PRIVATE08           =108,   
00183     OPS_PKA_PRIVATE09           =109,   
00184     OPS_PKA_PRIVATE10           =110,   
00185     } ops_public_key_algorithm_t;
00186 
00191 typedef struct
00192     {
00193     BIGNUM *p;  
00194     BIGNUM *q;  
00195     BIGNUM *g;  
00196     BIGNUM *y;  
00197     } ops_dsa_public_key_t;
00198 
00203 typedef struct
00204     {
00205     BIGNUM *n;  
00206     BIGNUM *e;  
00207     } ops_rsa_public_key_t;
00208 
00213 typedef struct
00214     {
00215     BIGNUM *p;  
00216     BIGNUM *g;  
00217     BIGNUM *y;  
00218     } ops_elgamal_public_key_t;
00219 
00221 typedef union
00222     {
00223     ops_dsa_public_key_t        dsa;            
00224     ops_rsa_public_key_t        rsa;            
00225     ops_elgamal_public_key_t    elgamal;        
00226     } ops_public_key_union_t;
00227 
00233 typedef enum
00234     {
00235     OPS_V2=2,   /*<! Version 2 (essentially the same as v3) */
00236     OPS_V3=3,   /*<! Version 3 */
00237     OPS_V4=4,   /*<! Version 4 */
00238     } ops_version_t;
00239 
00241 typedef struct
00242     {
00243     ops_version_t               version;        
00244     time_t                      creation_time;  
00246     unsigned                    days_valid;     
00249     ops_public_key_algorithm_t  algorithm;      
00250     ops_public_key_union_t      key;            
00251     } ops_public_key_t;
00252 
00255 typedef struct
00256     {
00257     BIGNUM *d;
00258     BIGNUM *p;
00259     BIGNUM *q;
00260     BIGNUM *u;
00261     } ops_rsa_secret_key_t;
00262 
00264 typedef struct
00265     {
00266     BIGNUM *x;
00267     } ops_dsa_secret_key_t;
00268 
00270 typedef struct
00271     {
00272     ops_rsa_secret_key_t rsa;
00273     ops_dsa_secret_key_t dsa;
00274     } ops_secret_key_union_t;
00275 
00278 typedef enum
00279     {
00280     OPS_S2KU_NONE=0,
00281     OPS_S2KU_ENCRYPTED_AND_HASHED=254,
00282     OPS_S2KU_ENCRYPTED=255,
00283     } ops_s2k_usage_t;
00284 
00287 typedef enum
00288     {
00289     OPS_S2KS_SIMPLE=0,
00290     OPS_S2KS_SALTED=1,
00291     OPS_S2KS_ITERATED_AND_SALTED=3
00292     } ops_s2k_specifier_t;
00293 
00301 typedef enum
00302     {
00303     OPS_SA_PLAINTEXT    =0, 
00304     OPS_SA_IDEA         =1, 
00305     OPS_SA_TRIPLEDES    =2, 
00306     OPS_SA_CAST5        =3, 
00307     OPS_SA_BLOWFISH     =4, 
00308     OPS_SA_AES_128      =7, 
00309     OPS_SA_AES_192      =8, 
00310     OPS_SA_AES_256      =9, 
00311     OPS_SA_TWOFISH      =10, 
00312     OPS_SA_CAMELLIA_128 =11, 
00313     OPS_SA_CAMELLIA_192 =12, 
00314     OPS_SA_CAMELLIA_256 =13, 
00315     } ops_symmetric_algorithm_t;
00316 
00324 typedef enum
00325     {
00326     OPS_HASH_UNKNOWN    =-1,    
00327     OPS_HASH_MD5        = 1,    
00328     OPS_HASH_SHA1       = 2,    
00329     OPS_HASH_RIPEMD     = 3,    
00331     OPS_HASH_SHA256     = 8,    
00332     OPS_HASH_SHA384     = 9,    
00333     OPS_HASH_SHA512     =10,    
00334     OPS_HASH_SHA224 = 11,   
00335     } ops_hash_algorithm_t;
00336 
00337 // Maximum block size for symmetric crypto
00338 #define OPS_MAX_BLOCK_SIZE      16
00339 
00340 // Maximum key size for symmetric crypto
00341 #define OPS_MAX_KEY_SIZE        32
00342 
00343 // Salt size for hashing
00344 #define OPS_SALT_SIZE           8
00345 
00346 // Hash size for secret key check
00347 #define OPS_CHECKHASH_SIZE      20
00348 
00349 // SHA1 Hash Size \todo is this the same as OPS_CHECKHASH_SIZE??
00350 #define OPS_SHA1_HASH_SIZE              SHA_DIGEST_LENGTH
00351 #define OPS_SHA256_HASH_SIZE    SHA256_DIGEST_LENGTH
00352 
00353 // Max hash size
00354 #define OPS_MAX_HASH_SIZE       64
00355 
00358 typedef struct
00359     {
00360     ops_public_key_t            public_key;
00361     ops_s2k_usage_t             s2k_usage;
00362     ops_s2k_specifier_t         s2k_specifier;
00363     ops_symmetric_algorithm_t   algorithm;  // the algorithm used to encrypt
00364                                             // the key
00365     ops_hash_algorithm_t        hash_algorithm;
00366     unsigned char               salt[OPS_SALT_SIZE];
00367     unsigned                    octet_count;
00368     unsigned char               iv[OPS_MAX_BLOCK_SIZE];
00369     ops_secret_key_union_t      key;
00370     unsigned                    checksum;
00371     unsigned char               checkhash[OPS_CHECKHASH_SIZE];
00372     } ops_secret_key_t;
00373 
00376 typedef struct
00377     {
00378     ops_data_t data; /*<! Trust Packet */
00379     } ops_trust_t;
00380         
00382 typedef struct
00383     {
00384     unsigned char *user_id;     
00385     } ops_user_id_t;
00386 
00388 typedef struct
00389     {
00390     ops_data_t data; 
00391     } ops_user_attribute_t;
00392 
00403 typedef enum
00404     {
00405     OPS_SIG_BINARY      =0x00,  /*<! Signature of a binary document */
00406     OPS_SIG_TEXT        =0x01,  /*<! Signature of a canonical text document */
00407     OPS_SIG_STANDALONE  =0x02,  /*<! Standalone signature */
00408 
00409     OPS_CERT_GENERIC    =0x10,  /*<! Generic certification of a User ID and Public Key packet */
00410     OPS_CERT_PERSONA    =0x11,  /*<! Persona certification of a User ID and Public Key packet */
00411     OPS_CERT_CASUAL     =0x12,  /*<! Casual certification of a User ID and Public Key packet */
00412     OPS_CERT_POSITIVE   =0x13,  /*<! Positive certification of a User ID and Public Key packet */
00413 
00414     OPS_SIG_SUBKEY      =0x18,  /*<! Subkey Binding Signature */
00415     OPS_SIG_PRIMARY     =0x19,  /*<! Primary Key Binding Signature */
00416     OPS_SIG_DIRECT      =0x1f,  /*<! Signature directly on a key */
00417 
00418     OPS_SIG_REV_KEY     =0x20,  /*<! Key revocation signature */
00419     OPS_SIG_REV_SUBKEY  =0x28,  /*<! Subkey revocation signature */
00420     OPS_SIG_REV_CERT    =0x30,  /*<! Certification revocation signature */
00421 
00422     OPS_SIG_TIMESTAMP   =0x40,  /*<! Timestamp signature */
00423 
00424     OPS_SIG_3RD_PARTY   =0x50,  /*<! Third-Party Confirmation signature */
00425     } ops_sig_type_t;
00426 
00428 typedef struct
00429     {
00430     BIGNUM                      *sig;   
00431     } ops_rsa_signature_t;
00432 
00434 typedef struct
00435     {
00436     BIGNUM                      *r;     
00437     BIGNUM                      *s;     
00438     } ops_dsa_signature_t;
00439 
00441 typedef struct
00442     {
00443     BIGNUM                      *r;
00444     BIGNUM                      *s;
00445     } ops_elgamal_signature_t;
00446 
00448 typedef struct
00449     {
00450     ops_data_t  data;
00451     } ops_unknown_signature_t;
00452 
00454 typedef union
00455     {
00456     ops_rsa_signature_t         rsa;    
00457     ops_dsa_signature_t         dsa;    
00458     ops_elgamal_signature_t     elgamal; /* deprecated */
00459     ops_unknown_signature_t     unknown; /* private or experimental */
00460     } ops_signature_union_t;
00461 
00462 #define OPS_KEY_ID_SIZE         8
00463 
00469 typedef struct
00470     {
00471     ops_version_t               version;        
00472     ops_sig_type_t              type;           
00473     time_t                      creation_time;  
00474     unsigned char               signer_id[OPS_KEY_ID_SIZE];     
00475     ops_public_key_algorithm_t  key_algorithm;  
00476     ops_hash_algorithm_t        hash_algorithm; 
00477     ops_signature_union_t       signature;      
00478     size_t                      v4_hashed_data_length;
00479     unsigned char*              v4_hashed_data;
00480     ops_boolean_t               creation_time_set:1;
00481     ops_boolean_t               signer_id_set:1;
00482     } ops_signature_info_t;
00483 
00485 typedef struct
00486     {
00487     ops_signature_info_t        info; 
00488     /* The following fields are only used while parsing the signature */
00489     unsigned char               hash2[2];       
00490     size_t                      v4_hashed_data_start; /* only valid if accumulate is set */
00491     ops_hash_t                  *hash;          
00492     } ops_signature_t;
00493 
00496 typedef struct
00497     {
00498     ops_content_tag_t           tag;
00499     size_t                      length;
00500     unsigned char               *raw;
00501     } ops_ss_raw_t;
00502 
00505 typedef struct
00506     {
00507     unsigned char               level;  /*<! Trust Level */
00508     unsigned char               amount; /*<! Amount */
00509     } ops_ss_trust_t;
00510 
00512 typedef struct
00513         {
00514         ops_boolean_t   revocable;
00515         } ops_ss_revocable_t;
00516         
00518 typedef struct
00519     {
00520     time_t                      time;
00521     } ops_ss_time_t;
00522 
00524 typedef struct
00525     {
00526     unsigned char               key_id[OPS_KEY_ID_SIZE];
00527     } ops_ss_key_id_t;
00528 
00530 typedef struct
00531     {
00532     ops_data_t flags;
00533     ops_data_t name;
00534     ops_data_t value;
00535     } ops_ss_notation_data_t;
00536 
00538 typedef struct
00539     {
00540     ops_data_t data;
00541     } ops_ss_userdefined_t;
00542 
00544 typedef struct
00545     {
00546     ops_data_t data;
00547     } ops_ss_unknown_t;
00548 
00550 typedef struct
00551     {
00552     ops_data_t data;
00553     /* Note that value 0 may represent the plaintext algorithm
00554        so we cannot expect data->contents to be a null-terminated list */
00555     } ops_ss_preferred_ska_t;
00556 
00558 typedef struct
00559     {
00560     ops_data_t data;
00561     } ops_ss_preferred_hash_t;
00562 
00564 typedef struct
00565     {
00566     ops_data_t data;
00567     } ops_ss_preferred_compression_t;
00568 
00570 typedef struct
00571     {
00572     ops_data_t data;
00573     } ops_ss_key_flags_t;
00574 
00576 typedef struct
00577     {
00578     ops_data_t data;
00579     } ops_ss_key_server_prefs_t;
00580 
00582 typedef struct
00583     {
00584     ops_data_t data;
00585     } ops_ss_features_t;
00586 
00588 typedef struct
00589     {
00590     ops_public_key_algorithm_t pka_alg;
00591     ops_hash_algorithm_t hash_alg;
00592     ops_data_t hash;
00593     } ops_ss_signature_target_t;
00594     
00596 typedef struct
00597     {
00598     ops_data_t sig;
00599     } ops_ss_embedded_signature_t;
00600 
00603 typedef struct
00604     {
00605     size_t                      length;
00606     unsigned char               *raw;
00607     } ops_packet_t;
00608 
00610 typedef enum
00611     {
00612     OPS_C_NONE=0,
00613     OPS_C_ZIP=1,
00614     OPS_C_ZLIB=2,
00615     OPS_C_BZIP2=3,
00616     } ops_compression_type_t;
00617 
00618 /* unlike most structures, this will feed its data as a stream
00619  * to the application instead of directly including it */
00621 typedef struct
00622     {
00623     ops_compression_type_t      type;
00624     } ops_compressed_t;
00625 
00627 typedef struct
00628     {
00629     unsigned char               version;
00630     ops_sig_type_t              sig_type;
00631     ops_hash_algorithm_t        hash_algorithm;
00632     ops_public_key_algorithm_t  key_algorithm;
00633     unsigned char               keyid[OPS_KEY_ID_SIZE];
00634     ops_boolean_t               nested;
00635     } ops_one_pass_signature_t;
00636 
00638 typedef struct
00639     {
00640     ops_boolean_t       primary_user_id;
00641     } ops_ss_primary_user_id_t;
00642 
00644 typedef struct
00645     {
00646     char *text;
00647     } ops_ss_regexp_t;
00648 
00650 typedef struct
00651     {
00652     char *text;
00653     } ops_ss_policy_url_t;
00654 
00656 typedef struct
00657     {
00658     char *text;
00659     } ops_ss_preferred_key_server_t;
00660 
00662 typedef struct
00663     {
00664     unsigned char clss;  /* class - name changed for C++ */
00665     unsigned char algid;
00666     unsigned char fingerprint[20];
00667     } ops_ss_revocation_key_t;
00668 
00670 typedef struct
00671     {
00672     unsigned char code;
00673     char *text;
00674     } ops_ss_revocation_reason_t;
00675 
00677 typedef enum
00678     {
00679     OPS_LDT_BINARY='b',
00680     OPS_LDT_TEXT='t',
00681     OPS_LDT_UTF8='u',
00682     OPS_LDT_LOCAL='l',
00683     OPS_LDT_LOCAL2='1'
00684     } ops_literal_data_type_t;
00685 
00687 typedef struct
00688     {
00689     ops_literal_data_type_t             format;
00690     char                        filename[256];
00691     time_t                      modification_time;
00692     } ops_literal_data_header_t;
00693 
00695 typedef struct
00696     {
00697     unsigned                    length;
00698     unsigned char               *data;
00699     } ops_literal_data_body_t;
00700 
00702 typedef struct
00703     {
00704     unsigned char               data[20]; // size of SHA1 hash
00705     } ops_mdc_t;
00706 
00708 typedef struct
00709     {
00710     char *key;
00711     char *value;
00712     } ops_armoured_header_value_t;
00713 
00715 typedef struct
00716     {
00717     ops_armoured_header_value_t *headers;
00718     unsigned nheaders;
00719     } ops_headers_t;
00720 
00722 typedef struct
00723     {
00724     const char *type;
00725     ops_headers_t headers;
00726     } ops_armour_header_t;
00727 
00729 typedef struct
00730     {
00731     const char *type;
00732     } ops_armour_trailer_t;
00733 
00735 typedef struct
00736     {
00737     ops_headers_t headers;
00738     } ops_signed_cleartext_header_t;
00739 
00741 typedef struct
00742     {
00743     unsigned                    length;
00744     unsigned char               *data;
00745     } ops_signed_cleartext_body_t;
00746 
00748 typedef struct
00749     {
00750     struct _ops_hash_t          *hash;  
00751     } ops_signed_cleartext_trailer_t;
00752 
00754 typedef struct
00755     {
00756     unsigned                    length;
00757     unsigned char               *data;
00758     } ops_unarmoured_text_t;
00759 
00760 typedef enum
00761     {
00762     SE_IP_DATA_VERSION=1
00763     } ops_se_ip_data_version_t;
00764 
00765 typedef enum
00766     {
00767     OPS_PKSK_V3=3
00768     } ops_pk_session_key_version_t;
00769 
00771 typedef struct
00772     {
00773     BIGNUM                      *encrypted_m;
00774     BIGNUM                      *m;
00775     } ops_pk_session_key_parameters_rsa_t;
00776 
00778 typedef struct
00779     {
00780     BIGNUM                      *g_to_k;
00781     BIGNUM                      *encrypted_m;
00782     } ops_pk_session_key_parameters_elgamal_t;
00783 
00785 typedef union
00786     {
00787     ops_pk_session_key_parameters_rsa_t         rsa;
00788     ops_pk_session_key_parameters_elgamal_t     elgamal;
00789     } ops_pk_session_key_parameters_t;
00790 
00792 typedef struct
00793     {
00794     ops_pk_session_key_version_t version;
00795     unsigned char               key_id[OPS_KEY_ID_SIZE];
00796     ops_public_key_algorithm_t  algorithm;
00797     ops_pk_session_key_parameters_t parameters;
00798     ops_symmetric_algorithm_t   symmetric_algorithm;
00799     unsigned char               key[OPS_MAX_KEY_SIZE];
00800     unsigned short              checksum;
00801     } ops_pk_session_key_t;
00802 
00804 typedef struct
00805     {
00806     const ops_secret_key_t     *secret_key;
00807     char                       **passphrase; /* point somewhere that gets filled in to work around constness of content */
00808     } ops_secret_key_passphrase_t;
00809 
00810 typedef enum
00811     {
00812     OPS_SE_IP_V1=1
00813     } ops_se_ip_version_t;
00814 
00816 typedef struct
00817     {
00818     ops_se_ip_version_t         version;
00819     } ops_se_ip_data_header_t;
00820 
00822 typedef struct
00823     {
00824     unsigned                    length;
00825     unsigned char*              data; // \todo remember to free this
00826     } ops_se_ip_data_body_t;
00827 
00829 typedef struct
00830     {
00831     unsigned                    length;
00832     unsigned char               data[8192]; // \todo parameterise this!
00833     } ops_se_data_body_t;
00834 
00836 typedef struct
00837     {
00838     const ops_secret_key_t      **secret_key;
00839     const ops_pk_session_key_t *pk_session_key;
00840     } ops_get_secret_key_t;
00841 
00843 typedef union
00844     {
00845     ops_parser_error_t          error;
00846     ops_parser_errcode_t        errcode;
00847     ops_ptag_t                  ptag;
00848     ops_public_key_t            public_key;
00849     ops_trust_t                 trust;
00850     ops_user_id_t               user_id;
00851     ops_user_attribute_t        user_attribute;
00852     ops_signature_t             signature;
00853     ops_ss_raw_t                ss_raw;
00854     ops_ss_trust_t              ss_trust;
00855     ops_ss_revocable_t          ss_revocable;
00856     ops_ss_time_t               ss_time;
00857     ops_ss_key_id_t             ss_issuer_key_id;
00858     ops_ss_notation_data_t      ss_notation_data;
00859     ops_packet_t                packet;
00860     ops_compressed_t            compressed;
00861     ops_one_pass_signature_t    one_pass_signature;
00862     ops_ss_preferred_ska_t      ss_preferred_ska;
00863     ops_ss_preferred_hash_t     ss_preferred_hash;
00864     ops_ss_preferred_compression_t     ss_preferred_compression;
00865     ops_ss_key_flags_t          ss_key_flags;
00866     ops_ss_key_server_prefs_t   ss_key_server_prefs;
00867     ops_ss_primary_user_id_t    ss_primary_user_id;
00868     ops_ss_regexp_t             ss_regexp;
00869     ops_ss_policy_url_t         ss_policy_url;
00870     ops_ss_preferred_key_server_t       ss_preferred_key_server;
00871     ops_ss_revocation_key_t     ss_revocation_key;
00872     ops_ss_userdefined_t        ss_userdefined;
00873     ops_ss_unknown_t            ss_unknown;
00874     ops_literal_data_header_t   literal_data_header;
00875     ops_literal_data_body_t     literal_data_body;
00876         ops_mdc_t                               mdc;
00877     ops_ss_features_t           ss_features;
00878     ops_ss_signature_target_t ss_signature_target;
00879     ops_ss_embedded_signature_t ss_embedded_signature;
00880     ops_ss_revocation_reason_t  ss_revocation_reason;
00881     ops_secret_key_t            secret_key;
00882     ops_user_id_t               ss_signers_user_id;
00883     ops_armour_header_t         armour_header;
00884     ops_armour_trailer_t        armour_trailer;
00885     ops_signed_cleartext_header_t signed_cleartext_header;
00886     ops_signed_cleartext_body_t signed_cleartext_body;
00887     ops_signed_cleartext_trailer_t signed_cleartext_trailer;
00888     ops_unarmoured_text_t       unarmoured_text;
00889     ops_pk_session_key_t        pk_session_key;
00890     ops_secret_key_passphrase_t secret_key_passphrase;
00891     ops_se_ip_data_header_t     se_ip_data_header;
00892     ops_se_ip_data_body_t       se_ip_data_body;
00893     ops_se_data_body_t          se_data_body;
00894     ops_get_secret_key_t        get_secret_key;
00895     } ops_parser_content_union_t;
00896 
00898 struct ops_parser_content_t
00899     {
00900     ops_content_tag_t           tag;
00901     unsigned char               critical; /* for signature subpackets */
00902     ops_parser_content_union_t  content;
00903     };
00904 
00906 typedef struct
00907     {
00908     unsigned char               fingerprint[20];
00909     unsigned                    length;
00910     } ops_fingerprint_t;
00911 
00912 void ops_init(void);
00913 void ops_finish(void);
00914 void ops_keyid(unsigned char keyid[OPS_KEY_ID_SIZE],
00915                const ops_public_key_t *key);
00916 void ops_fingerprint(ops_fingerprint_t *fp, const ops_public_key_t *key);
00917 void ops_public_key_free(ops_public_key_t *key);
00918 void ops_public_key_copy(ops_public_key_t *dst, const ops_public_key_t *src);
00919 void ops_user_id_free(ops_user_id_t *id);
00920 void ops_user_attribute_free(ops_user_attribute_t *att);
00921 void ops_signature_free(ops_signature_t *sig);
00922 void ops_trust_free(ops_trust_t *trust);
00923 void ops_ss_preferred_ska_free(ops_ss_preferred_ska_t *ss_preferred_ska);
00924 void ops_ss_preferred_hash_free(ops_ss_preferred_hash_t *ss_preferred_hash);
00925 void ops_ss_preferred_compression_free(ops_ss_preferred_compression_t *ss_preferred_compression);
00926 void ops_ss_key_flags_free(ops_ss_key_flags_t *ss_key_flags);
00927 void ops_ss_key_server_prefs_free(ops_ss_key_server_prefs_t *ss_key_server_prefs);
00928 void ops_ss_features_free(ops_ss_features_t *ss_features);
00929 void ops_ss_notation_data_free(ops_ss_notation_data_t *ss_notation_data);
00930 void ops_ss_policy_url_free(ops_ss_policy_url_t *ss_policy_url);
00931 void ops_ss_preferred_key_server_free(ops_ss_preferred_key_server_t *ss_preferred_key_server);
00932 void ops_ss_regexp_free(ops_ss_regexp_t *ss_regexp);
00933 void ops_ss_userdefined_free(ops_ss_userdefined_t *ss_userdefined);
00934 void ops_ss_reserved_free(ops_ss_unknown_t *ss_unknown);
00935 void ops_ss_revocation_reason_free(ops_ss_revocation_reason_t *ss_revocation_reason);
00936 void ops_ss_signature_target_free(ops_ss_signature_target_t *ss_signature_target);
00937 void ops_ss_embedded_signature_free(ops_ss_embedded_signature_t *ss_embedded_signature);
00938 
00939 void ops_packet_free(ops_packet_t *packet);
00940 void ops_parser_content_free(ops_parser_content_t *c);
00941 void ops_secret_key_free(ops_secret_key_t *key);
00942 void ops_secret_key_copy(ops_secret_key_t *dst, const ops_secret_key_t *src);
00943 void ops_pk_session_key_free(ops_pk_session_key_t *sk);
00944 
00945 /* vim:set textwidth=120: */
00946 /* vim:set ts=8: */
00947 
00948 #endif

Generated on Fri May 24 00:00:03 2013 for OpenPGP:SDK by  doxygen 1.4.6