Changeset 385

Show
Ignore:
Timestamp:
02/22/06 17:15:37
Author:
ben
Message:

Get rid of the old-fashioned parse_info and use the new-fangled pinfo instead.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openpgpsdk/trunk/src/packet-parse.c

    r384 r385  
    2626 * \param len   Number of octets to read 
    2727 * \param subregion 
    28  * \param parse_info  How to parse 
     28 * \param pinfo       How to parse 
    2929 * 
    3030 * \return 1 on success, 0 on failure 
    3131 */ 
    3232static int limited_read_data(ops_data_t *data,unsigned int len, 
    33                              ops_region_t *subregion,ops_parse_info_t *parse_info) 
     33                             ops_region_t *subregion,ops_parse_info_t *pinfo) 
    3434    { 
    3535    data->len = len; 
     
    4141        return 0; 
    4242 
    43     if (!ops_limited_read(data->contents, data->len,subregion, 
    44                           &parse_info->errors,&parse_info->rinfo, 
    45                           &parse_info->cbinfo)) 
     43    if (!ops_limited_read(data->contents, data->len,subregion,&pinfo->errors, 
     44                          &pinfo->rinfo,&pinfo->cbinfo)) 
    4645        return 0; 
    4746     
     
    5554 * \param data 
    5655 * \param subregion 
    57  * \param parse_info 
     56 * \param pinfo 
    5857 *  
    5958 * \return 1 on success, 0 on failure 
    6059 */ 
    6160static int read_data(ops_data_t *data,ops_region_t *subregion, 
    62                      ops_parse_info_t *parse_info) 
     61                     ops_parse_info_t *pinfo) 
    6362    { 
    6463    int len; 
     
    6665    len=subregion->length-subregion->length_read; 
    6766 
    68     return(limited_read_data(data,len,subregion,parse_info)); 
     67    return(limited_read_data(data,len,subregion,pinfo)); 
    6968    } 
    7069 
     
    9695    } 
    9796 
    98 static int read_string(char **str, ops_region_t *subregion, ops_parse_info_t *parse_info) 
    99     { 
    100     return (read_unsigned_string((unsigned char **)str, subregion, parse_info)); 
     97static int read_string(char **str, ops_region_t *subregion, ops_parse_info_t *pinfo) 
     98    { 
     99    return (read_unsigned_string((unsigned char **)str, subregion, pinfo)); 
    101100    } 
    102101 
     
    149148 * Use this function, rather than calling the reader directly. 
    150149 * 
    151  * If the accumulate flag is set in *parse_info, the function 
     150 * If the accumulate flag is set in *pinfo, the function 
    152151 * adds the read data to the accumulated data, and updates  
    153152 * the accumulated length. This is useful if, for example,  
     
    158157 * \param *plength 
    159158 * \param flags 
    160  * \param *parse_info 
     159 * \param *pinfo 
    161160 * 
    162161 * \return OPS_R_OK 
     
    207206static ops_reader_ret_t base_read(unsigned char *dest,unsigned *plength, 
    208207                                  ops_reader_flags_t flags, 
    209                                   ops_parse_info_t *info) 
    210     { 
    211     return sub_base_read(dest,plength,flags,&info->errors,&info->rinfo, 
    212                          &info->cbinfo); 
     208                                  ops_parse_info_t *pinfo) 
     209    { 
     210    return sub_base_read(dest,plength,flags,&pinfo->errors,&pinfo->rinfo, 
     211                         &pinfo->cbinfo); 
    213212    } 
    214213 
     
    227226 */ 
    228227static ops_reader_ret_t read_scalar(unsigned *result,unsigned length, 
    229                                     ops_parse_info_t *parse_info) 
     228                                    ops_parse_info_t *pinfo) 
    230229    { 
    231230    unsigned t=0; 
     
    239238        unsigned one=1; 
    240239 
    241         ret=base_read(c,&one,0,parse_info); 
     240        ret=base_read(c,&one,0,pinfo); 
    242241        if(ret != OPS_R_OK) 
    243242            return ret; 
     
    262261 * \param length        How many bytes to read 
    263262 * \param *region       Pointer to packet region 
    264  * \param *parse_info How to parse, including callback function 
     263 * \param *pinfo      How to parse, including callback function 
    265264 * \return              1 on success, 0 on error 
    266265 */ 
     
    322321 * \param length        How many bytes to skip 
    323322 * \param *region       Pointer to packet region 
    324  * \param *parse_info How to parse 
     323 * \param *pinfo      How to parse 
    325324 * \return              1 on success, 0 on error (calls the cb with OPS_PARSER_ERROR in limited_read()). 
    326325 */ 
    327326static int limited_skip(unsigned length,ops_region_t *region, 
    328                         ops_parse_info_t *parse_info) 
     327                        ops_parse_info_t *pinfo) 
    329328    { 
    330329    unsigned char buf[8192]; 
     
    333332        { 
    334333        int n=length%8192; 
    335         if(!limited_read(buf,n,region,parse_info)) 
     334        if(!limited_read(buf,n,region,pinfo)) 
    336335            return 0; 
    337336        length-=n; 
     
    350349 * \param length        How many bytes make up this scalar (at most 4) 
    351350 * \param *region       Pointer to current packet region 
    352  * \param *parse_info How to parse 
     351 * \param *pinfo      How to parse 
    353352 * \param *cb           The callback 
    354353 * \return              1 on success, 0 on error (calls the cb with OPS_PARSER_ERROR in limited_read()). 
     
    358357static int limited_read_scalar(unsigned *dest,unsigned length, 
    359358                               ops_region_t *region, 
    360                                ops_parse_info_t *parse_info) 
     359                               ops_parse_info_t *pinfo) 
    361360    { 
    362361    unsigned char c[4]; 
     
    366365    assert(length <= 4); 
    367366    assert(sizeof(*dest) >= 4); 
    368     if(!limited_read(c,length,region,parse_info)) 
     367    if(!limited_read(c,length,region,pinfo)) 
    369368        return 0; 
    370369 
     
    389388 * \param length        How many bytes make up this scalar (at most 4) 
    390389 * \param *region       Pointer to current packet region 
    391  * \param *parse_info How to parse 
     390 * \param *pinfo      How to parse 
    392391 * \param *cb           The callback 
    393392 * \return              1 on success, 0 on error (calls the cb with OPS_PARSER_ERROR in limited_read()). 
     
    397396static int limited_read_size_t_scalar(size_t *dest,unsigned length, 
    398397                                      ops_region_t *region, 
    399                                       ops_parse_info_t *parse_info) 
     398                                      ops_parse_info_t *pinfo) 
    400399    { 
    401400    unsigned tmp; 
     
    405404    /* Note that because the scalar is at most 4 bytes, we don't care 
    406405       if size_t is bigger than usigned */ 
    407     if(!limited_read_scalar(&tmp,length,region,parse_info)) 
     406    if(!limited_read_scalar(&tmp,length,region,pinfo)) 
    408407        return 0; 
    409408 
     
    430429 */ 
    431430static int limited_read_time(time_t *dest,ops_region_t *region, 
    432                              ops_parse_info_t *parse_info) 
    433     { 
    434     return limited_read_scalar((unsigned *)dest,4,region,parse_info); 
     431                             ops_parse_info_t *pinfo) 
     432    { 
     433    return limited_read_scalar((unsigned *)dest,4,region,pinfo); 
    435434    } 
    436435 
     
    458457 */ 
    459458static int limited_read_mpi(BIGNUM **pbn,ops_region_t *region, 
    460                             ops_parse_info_t *parse_info) 
     459                            ops_parse_info_t *pinfo) 
    461460    { 
    462461    unsigned length; 
     
    468467    ops_boolean_t ret; 
    469468 
    470     parse_info->reading_mpi_length=ops_true; 
    471     ret=limited_read_scalar(&length,2,region,parse_info); 
    472     parse_info->reading_mpi_length=ops_false; 
     469    pinfo->reading_mpi_length=ops_true; 
     470    ret=limited_read_scalar(&length,2,region,pinfo); 
     471    pinfo->reading_mpi_length=ops_false; 
    473472    if(!ret) 
    474473        return 0; 
     
    480479 
    481480    assert(length <= 8192); 
    482     if(!limited_read(buf,length,region,parse_info)) 
     481    if(!limited_read(buf,length,region,pinfo)) 
    483482        return 0; 
    484483 
    485484    if((buf[0] >> nonzero) != 0 || !(buf[0]&(1 << (nonzero-1)))) 
    486485        { 
    487         ERRCODEP(parse_info,OPS_E_P_MPI_FORMAT_ERROR);  /* XXX: Ben, one part of this constraint does not apply to encrypted MPIs the draft says. -- peter */ 
     486        ERRCODEP(pinfo,OPS_E_P_MPI_FORMAT_ERROR);  /* XXX: Ben, one part of this constraint does not apply to encrypted MPIs the draft says. -- peter */ 
    488487        return 0; 
    489488        } 
     
    498497 * 
    499498 * \param *length       Where the decoded length will be put 
    500  * \param *parse_info How to parse 
     499 * \param *pinfo      How to parse 
    501500 * \return              1 if OK, else 0 
    502501 * 
    503502 */ 
    504503 
    505 static int read_new_length(unsigned *length,ops_parse_info_t *parse_info) 
     504static int read_new_length(unsigned *length,ops_parse_info_t *pinfo) 
    506505    { 
    507506    unsigned char c[1]; 
    508507    unsigned one=1; 
    509508 
    510     if(base_read(c,&one,0,parse_info) != OPS_R_OK) 
     509    if(base_read(c,&one,0,pinfo) != OPS_R_OK) 
    511510        return 0; 
    512511    if(c[0] < 192) 
     
    519518        unsigned t=(c[0]-192) << 8; 
    520519 
    521         if(base_read(c,&one,0,parse_info) != OPS_R_OK) 
     520        if(base_read(c,&one,0,pinfo) != OPS_R_OK) 
    522521            return 0; 
    523522        *length=t+c[0]+192; 
    524523        return 1; 
    525524        } 
    526     return (read_scalar(length,4,parse_info) == OPS_R_OK ? 1 : 0); 
     525    return (read_scalar(length,4,pinfo) == OPS_R_OK ? 1 : 0); 
    527526    } 
    528527 
     
    545544 */ 
    546545static int limited_read_new_length(unsigned *length,ops_region_t *region, 
    547                                    ops_parse_info_t *parse_info) 
     546                                   ops_parse_info_t *pinfo) 
    548547    { 
    549548    unsigned char c[1]; 
    550549 
    551     if(!limited_read(c,1,region,parse_info)) 
     550    if(!limited_read(c,1,region,pinfo)) 
    552551        return 0; 
    553552    if(c[0] < 192) 
     
    560559        unsigned t=(c[0]-192) << 8; 
    561560 
    562         if(!limited_read(c,1,region,parse_info)) 
     561        if(!limited_read(c,1,region,pinfo)) 
    563562            return 0; 
    564563        *length=t+c[0]+192; 
    565564        return 1; 
    566565        } 
    567     return limited_read_scalar(length,4,region,parse_info); 
     566    return limited_read_scalar(length,4,region,pinfo); 
    568567    } 
    569568 
     
    824823 
    825824static int parse_public_key_data(ops_public_key_t *key,ops_region_t *region, 
    826                                  ops_parse_info_t *parse_info) 
     825                                 ops_parse_info_t *pinfo) 
    827826    { 
    828827    ops_parser_content_t content; 
     
    831830    assert (region->length_read == 0);  /* We should not have read anything so far */ 
    832831 
    833     if(!limited_read(c,1,region,parse_info)) 
     832    if(!limited_read(c,1,region,pinfo)) 
    834833        return 0; 
    835834    key->version=c[0]; 
    836835    if(key->version < 2 || key->version > 4) 
    837         ERR1P(parse_info,"Bad public key version (0x%02x)",key->version); 
    838  
    839     if(!limited_read_time(&key->creation_time,region,parse_info)) 
     836        ERR1P(pinfo,"Bad public key version (0x%02x)",key->version); 
     837 
     838    if(!limited_read_time(&key->creation_time,region,pinfo)) 
    840839        return 0; 
    841840 
    842841    key->days_valid=0; 
    843842    if((key->version == 2 || key->version == 3) 
    844        && !limited_read_scalar(&key->days_valid,2,region,parse_info)) 
    845         return 0; 
    846  
    847     if(!limited_read(c,1,region,parse_info)) 
     843       && !limited_read_scalar(&key->days_valid,2,region,pinfo)) 
     844        return 0; 
     845 
     846    if(!limited_read(c,1,region,pinfo)) 
    848847        return 0; 
    849848 
     
    853852        { 
    854853    case OPS_PKA_DSA: 
    855         if(!limited_read_mpi(&key->key.dsa.p,region,parse_info) 
    856            || !limited_read_mpi(&key->key.dsa.q,region,parse_info) 
    857            || !limited_read_mpi(&key->key.dsa.g,region,parse_info) 
    858            || !limited_read_mpi(&key->key.dsa.y,region,parse_info)) 
     854        if(!limited_read_mpi(&key->key.dsa.p,region,pinfo) 
     855           || !limited_read_mpi(&key->key.dsa.q,region,pinfo) 
     856           || !limited_read_mpi(&key->key.dsa.g,region,pinfo) 
     857           || !limited_read_mpi(&key->key.dsa.y,region,pinfo)) 
    859858            return 0; 
    860859        break; 
     
    863862    case OPS_PKA_RSA_ENCRYPT_ONLY: 
    864863    case OPS_PKA_RSA_SIGN_ONLY: 
    865         if(!limited_read_mpi(&key->key.rsa.n,region,parse_info) 
    866            || !limited_read_mpi(&key->key.rsa.e,region,parse_info)) 
     864        if(!limited_read_mpi(&key->key.rsa.n,region,pinfo) 
     865           || !limited_read_mpi(&key->key.rsa.e,region,pinfo)) 
    867866            return 0; 
    868867        break; 
     
    870869    case OPS_PKA_ELGAMAL: 
    871870    case OPS_PKA_ELGAMAL_ENCRYPT_OR_SIGN: 
    872         if(!limited_read_mpi(&key->key.elgamal.p,region,parse_info) 
    873            || !limited_read_mpi(&key->key.elgamal.g,region,parse_info) 
    874            || !limited_read_mpi(&key->key.elgamal.y,region,parse_info)) 
     871        if(!limited_read_mpi(&key->key.elgamal.p,region,pinfo) 
     872           || !limited_read_mpi(&key->key.elgamal.g,region,pinfo) 
     873           || !limited_read_mpi(&key->key.elgamal.y,region,pinfo)) 
    875874            return 0; 
    876875        break; 
    877876 
    878877    default: 
    879         ERR1P(parse_info,"Unknown public key algorithm (%d)",key->algorithm); 
     878        ERR1P(pinfo,"Unknown public key algorithm (%d)",key->algorithm); 
    880879        } 
    881880 
     
    898897 */ 
    899898static int parse_public_key(ops_content_tag_t tag,ops_region_t *region, 
    900                             ops_parse_info_t *parse_info) 
     899                            ops_parse_info_t *pinfo) 
    901900    { 
    902901    ops_parser_content_t content; 
    903902 
    904     if(!parse_public_key_data(&C.public_key,region,parse_info)) 
     903    if(!parse_public_key_data(&C.public_key,region,pinfo)) 
    905904        return 0; 
    906905 
    907906    // XXX: this test should be done for all packets, surely? 
    908907    if(region->length_read != region->length) 
    909         ERR1P(parse_info,"Unconsumed data (%d)", 
     908        ERR1P(pinfo,"Unconsumed data (%d)", 
    910909              region->length-region->length_read); 
    911910 
    912     CBP(parse_info,tag,&content); 
     911    CBP(pinfo,tag,&content); 
    913912 
    914913    return 1; 
     
    946945 */ 
    947946 
    948 static int parse_user_attribute(ops_region_t *region, ops_parse_info_t *parse_info) 
     947static int parse_user_attribute(ops_region_t *region, ops_parse_info_t *pinfo) 
    949948    { 
    950949 
     
    956955    assert(region->length_read == 0);  /* We should not have read anything so far */ 
    957956 
    958     if(!read_data(&C.user_attribute.data,region,parse_info)) 
    959         return 0; 
    960  
    961     CBP(parse_info,OPS_PTAG_CT_USER_ATTRIBUTE,&content); 
     957    if(!read_data(&C.user_attribute.data,region,pinfo)) 
     958        return 0; 
     959 
     960    CBP(pinfo,OPS_PTAG_CT_USER_ATTRIBUTE,&content); 
    962961 
    963962    return 1; 
     
    988987 * \see RFC2440bis-12 5.11 
    989988 */ 
    990 static int parse_user_id(ops_region_t *region,ops_parse_info_t *parse_info) 
     989static int parse_user_id(ops_region_t *region,ops_parse_info_t *pinfo) 
    991990    { 
    992991    ops_parser_content_t content; 
     
    997996 
    998997    if(region->length && !limited_read(C.user_id.user_id,region->length,region, 
    999                                        parse_info)) 
     998                                       pinfo)) 
    1000999        return 0; 
    10011000 
    10021001    C.user_id.user_id[region->length]='\0'; /* terminate the string */ 
    10031002 
    1004     CBP(parse_info,OPS_PTAG_CT_USER_ID,&content); 
     1003    CBP(pinfo,OPS_PTAG_CT_USER_ID,&content); 
    10051004 
    10061005    return 1; 
     
    10781077 */ 
    10791078static int parse_v3_signature(ops_region_t *region, 
    1080                               ops_parse_info_t *parse_info) 
     1079                              ops_parse_info_t *pinfo) 
    10811080    { 
    10821081    unsigned char c[1]; 
     
    10861085 
    10871086    /* hash info length */ 
    1088     if(!limited_read(c,1,region,parse_info)) 
     1087    if(!limited_read(c,1,region,pinfo)) 
    10891088        return 0; 
    10901089    if(c[0] != 5) 
    1091         ERRP(parse_info,"bad hash info length"); 
    1092  
    1093     if(!limited_read(c,1,region,parse_info)) 
     1090        ERRP(pinfo,"bad hash info length"); 
     1091 
     1092    if(!limited_read(c,1,region,pinfo)) 
    10941093        return 0; 
    10951094    C.signature.type=c[0]; 
    10961095    /* XXX: check signature type */ 
    10971096 
    1098     if(!limited_read_time(&C.signature.creation_time,region,parse_info)) 
     1097    if(!limited_read_time(&C.signature.creation_time,region,pinfo)) 
    10991098        return 0; 
    11001099    C.signature.creation_time_set=ops_true; 
    11011100 
    1102     if(!limited_read(C.signature.signer_id,OPS_KEY_ID_SIZE,region,parse_info)) 
     1101    if(!limited_read(C.signature.signer_id,OPS_KEY_ID_SIZE,region,pinfo)) 
    11031102        return 0; 
    11041103    C.signature.signer_id_set=ops_true; 
    11051104 
    1106     if(!limited_read(c,1,region,parse_info)) 
     1105    if(!limited_read(c,1,region,pinfo)) 
    11071106        return 0; 
    11081107    C.signature.key_algorithm=c[0]; 
    11091108    /* XXX: check algorithm */ 
    11101109 
    1111     if(!limited_read(c,1,region,parse_info)) 
     1110    if(!limited_read(c,1,region,pinfo)) 
    11121111        return 0; 
    11131112    C.signature.hash_algorithm=c[0]; 
    11141113    /* XXX: check algorithm */ 
    11151114     
    1116     if(!limited_read(C.signature.hash2,2,region,parse_info)) 
     1115    if(!limited_read(C.signature.hash2,2,region,pinfo)) 
    11171116        return 0; 
    11181117 
     
    11211120    case OPS_PKA_RSA: 
    11221121    case OPS_PKA_RSA_SIGN_ONLY: 
    1123         if(!limited_read_mpi(&C.signature.signature.rsa.sig,region,parse_info)) 
     1122        if(!limited_read_mpi(&C.signature.signature.rsa.sig,region,pinfo)) 
    11241123            return 0; 
    11251124        break; 
    11261125 
    11271126    case OPS_PKA_DSA: 
    1128         if(!limited_read_mpi(&C.signature.signature.dsa.r,region,parse_info) 
    1129            || !limited_read_mpi(&C.signature.signature.dsa.s,region,parse_info)) 
     1127        if(!limited_read_mpi(&C.signature.signature.dsa.r,region,pinfo) 
     1128           || !limited_read_mpi(&C.signature.signature.dsa.s,region,pinfo)) 
    11301129            return 0; 
    11311130        break; 
    11321131 
    11331132    case OPS_PKA_ELGAMAL_ENCRYPT_OR_SIGN: 
    1134         if(!limited_read_mpi(&C.signature.signature.elgamal.r,region,parse_info) 
    1135            || !limited_read_mpi(&C.signature.signature.elgamal.s,region,parse_info)) 
     1133        if(!limited_read_mpi(&C.signature.signature.elgamal.r,region,pinfo) 
     1134           || !limited_read_mpi(&C.signature.signature.elgamal.s,region,pinfo)) 
    11361135            return 0; 
    11371136        break; 
    11381137 
    11391138    default: 
    1140         ERR1P(parse_info,"Bad signature key algorithm (%d)",C.signature.key_algorithm); 
     1139        ERR1P(pinfo,"Bad signature key algorithm (%d)",C.signature.key_algorithm); 
    11411140        } 
    11421141 
    11431142    if(region->length_read != region->length) 
    1144         ERR1P(parse_info,"Unconsumed data (%d)",region->length-region->length_read); 
    1145  
    1146     CBP(parse_info,OPS_PTAG_CT_SIGNATURE,&content); 
     1143        ERR1P(pinfo,"Unconsumed data (%d)",region->length-region->length_read); 
     1144 
     1145    CBP(pinfo,OPS_PTAG_CT_SIGNATURE,&content); 
    11471146 
    11481147    return 1; 
     
    11671166static int parse_one_signature_subpacket(ops_signature_t *sig, 
    11681167                                         ops_region_t *region, 
    1169                                          ops_parse_info_t *parse_info) 
     1168                                         ops_parse_info_t *pinfo) 
    11701169    { 
    11711170    ops_region_t subregion; 
     
    11771176 
    11781177    ops_init_subregion(&subregion,region); 
    1179     if(!limited_read_new_length(&subregion.length,region,parse_info)) 
     1178    if(!limited_read_new_length(&subregion.length,region,pinfo)) 
    11801179        return 0; 
    11811180 
    11821181    if(subregion.length > region->length) 
    1183         ERRP(parse_info,"Subpacket too long"); 
    1184  
    1185     if(!limited_read(c,1,&subregion,parse_info)) 
     1182        ERRP(pinfo,"Subpacket too long"); 
     1183 
     1184    if(!limited_read(c,1,&subregion,pinfo)) 
    11861185        return 0; 
    11871186 
     
    11931192 
    11941193    /* Application wants it delivered raw */ 
    1195     if(parse_info->ss_raw[t8]&t7) 
     1194    if(pinfo->ss_raw[t8]&t7) 
    11961195        { 
    11971196        C.ss_raw.tag=content.tag; 
    11981197        C.ss_raw.length=subregion.length-1; 
    11991198        C.ss_raw.raw=malloc(C.ss_raw.length); 
    1200         if(!limited_read(C.ss_raw.raw,C.ss_raw.length,&subregion,parse_info)) 
    1201             return 0; 
    1202         CBP(parse_info,OPS_PTAG_RAW_SS,&content); 
     1199        if(!limited_read(C.ss_raw.raw,C.ss_raw.length,&subregion,pinfo)) 
     1200            return 0; 
     1201        CBP(pinfo,OPS_PTAG_RAW_SS,&content); 
    12031202        return 1; 
    12041203        } 
     
    12091208    case OPS_PTAG_SS_EXPIRATION_TIME: 
    12101209    case OPS_PTAG_SS_KEY_EXPIRATION_TIME: 
    1211         if(!limited_read_time(&C.ss_time.time,&subregion,parse_info)) 
     1210        if(!limited_read_time(&C.ss_time.time,&subregion,pinfo)) 
    12121211            return 0; 
    12131212        if(content.tag == OPS_PTAG_SS_CREATION_TIME) 
     
    12191218 
    12201219    case OPS_PTAG_SS_TRUST: 
    1221         if(!limited_read(&C.ss_trust.level,1,&subregion,parse_info) 
    1222            || !limited_read(&C.ss_trust.amount,1,&subregion,parse_info)) 
     1220        if(!limited_read(&C.ss_trust.level,1,&subregion,pinfo) 
     1221           || !limited_read(&C.ss_trust.amount,1,&subregion,pinfo)) 
    12231222            return 0; 
    12241223        break; 
    12251224 
    12261225    case OPS_PTAG_SS_REVOCABLE: 
    1227         if(!limited_read(bool,1,&subregion,parse_info)) 
     1226        if(!limited_read(bool,1,&subregion,pinfo)) 
    12281227            return 0; 
    12291228        C.ss_revocable.revocable=!!bool; 
     
    12321231    case OPS_PTAG_SS_ISSUER_KEY_ID: 
    12331232        if(!limited_read(C.ss_issuer_key_id.key_id,OPS_KEY_ID_SIZE, 
    1234                              &subregion,parse_info)) 
     1233                             &subregion,pinfo)) 
    12351234            return 0; 
    12361235        memcpy(sig->signer_id,C.ss_issuer_key_id.key_id,OPS_KEY_ID_SIZE); 
     
    12391238 
    12401239    case OPS_PTAG_SS_PREFERRED_SKA: 
    1241         if(!read_data(&C.ss_preferred_ska.data,&subregion,parse_info)) 
     1240        if(!read_data(&C.ss_preferred_ska.data,&subregion,pinfo)) 
    12421241            return 0; 
    12431242        break; 
    12441243                                 
    12451244    case OPS_PTAG_SS_PREFERRED_HASH: 
    1246         if(!read_data(&C.ss_preferred_hash.data,&subregion,parse_info)) 
     1245        if(!read_data(&C.ss_preferred_hash.data,&subregion,pinfo)) 
    12471246            return 0; 
    12481247        break; 
    12491248                                 
    12501249    case OPS_PTAG_SS_PREFERRED_COMPRESSION: 
    1251         if(!read_data(&C.ss_preferred_compression.data,&subregion,parse_info)) 
     1250        if(!read_data(&C.ss_preferred_compression.data,&subregion,pinfo)) 
    12521251            return 0; 
    12531252        break; 
    12541253                                 
    12551254    case OPS_PTAG_SS_PRIMARY_USER_ID: 
    1256         if(!limited_read (bool,1,&subregion,parse_info)) 
     1255        if(!limited_read (bool,1,&subregion,pinfo)) 
    12571256            return 0; 
    12581257        C.ss_primary_user_id.primary_user_id = !!bool; 
     
    12601259  
    12611260    case OPS_PTAG_SS_KEY_FLAGS: 
    1262         if(!read_data(&C.ss_key_flags.data,&subregion,parse_info)) 
     1261        if(!read_data(&C.ss_key_flags.data,&subregion,pinfo)) 
    12631262            return 0; 
    12641263        break; 
    12651264 
    12661265    case OPS_PTAG_SS_KEY_SERVER_PREFS: 
    1267         if(!read_data(&C.ss_key_server_prefs.data,&subregion,parse_info)) 
     1266        if(!read_data(&C.ss_key_server_prefs.data,&subregion,pinfo)) 
    12681267            return 0; 
    12691268        break; 
    12701269 
    12711270    case OPS_PTAG_SS_FEATURES: 
    1272         if(!read_data(&C.ss_features.data,&subregion,parse_info)) 
     1271        if(!read_data(&C.ss_features.data,&subregion,pinfo)) 
    12731272            return 0; 
    12741273        break; 
    12751274 
    12761275    case OPS_PTAG_SS_SIGNERS_USER_ID: 
    1277         if(!read_unsigned_string(&C.ss_signers_user_id.user_id,&subregion,parse_info)) 
     1276        if(!read_unsigned_string(&C.ss_signers_user_id.user_id,&subregion,pinfo)) 
    12781277            return 0; 
    12791278        break; 
    12801279 
    12811280    case OPS_PTAG_SS_NOTATION_DATA: 
    1282         if(!limited_read_data(&C.ss_notation_data.flags,4,&subregion,parse_info)) 
     1281        if(!limited_read_data(&C.ss_notation_data.flags,4,&subregion,pinfo)) 
    12831282            return 0; 
    12841283        if(!limited_read_size_t_scalar(&C.ss_notation_data.name.len,2, 
    1285                                        &subregion,parse_info)) 
     1284                                       &subregion,pinfo)) 
    12861285            return 0; 
    12871286        if(!limited_read_size_t_scalar(&C.ss_notation_data.value.len,2, 
    1288                                        &subregion,parse_info)) 
     1287                                       &subregion,pinfo)) 
    12891288            return 0; 
    12901289        if(!limited_read_data(&C.ss_notation_data.name, 
    1291                               C.ss_notation_data.name.len,&subregion,parse_info)) 
     1290                              C.ss_notation_data.name.len,&subregion,pinfo)) 
    12921291            return 0; 
    12931292        if(!limited_read_data(&C.ss_notation_data.value, 
    1294                               C.ss_notation_data.value.len,&subregion,parse_info)) 
     1293                              C.ss_notation_data.value.len,&subregion,pinfo)) 
    12951294            return 0; 
    12961295        break; 
    12971296 
    12981297    case OPS_PTAG_SS_POLICY_URL: 
    1299         if(!read_string(&C.ss_policy_url.text,&subregion,parse_info)) 
     1298        if(!read_string(&C.ss_policy_url.text,&subregion,pinfo)) 
    13001299            return 0; 
    13011300        break; 
    13021301 
    13031302    case OPS_PTAG_SS_REGEXP: 
    1304         if(!read_string(&C.ss_regexp.text,&subregion, parse_info)) 
     1303        if(!read_string(&C.ss_regexp.text,&subregion, pinfo)) 
    13051304            return 0; 
    13061305        break; 
    13071306 
    13081307    case OPS_PTAG_SS_PREFERRED_KEY_SERVER: 
    1309         if(!read_string(&C.ss_preferred_key_server.text,&subregion,parse_info)) 
     1308        if(!read_string(&C.ss_preferred_key_server.text,&subregion,pinfo)) 
    13101309            return 0; 
    13111310        break; 
     
    13221321    case OPS_PTAG_SS_USERDEFINED09: 
    13231322    case OPS_PTAG_SS_USERDEFINED10: 
    1324         if(!read_data(&C.ss_userdefined.data,&subregion,parse_info)) 
     1323        if(!read_data(&C.ss_userdefined.data,&subregion,pinfo)) 
    13251324            return 0; 
    13261325        break; 
    13271326 
    13281327    case OPS_PTAG_SS_RESERVED: 
    1329         if(!read_data(&C.ss_unknown.data,&subregion,parse_info)) 
     1328        if(!read_data(&C.ss_unknown.data,&subregion,pinfo)) 
    13301329            return 0; 
    13311330        break; 
     
    13331332    case OPS_PTAG_SS_REVOCATION_REASON: 
    13341333        /* first byte is the machine-readable code */ 
    1335         if(!limited_read(&C.ss_revocation_reason.code,1,&subregion,parse_info)) 
     1334        if(!limited_read(&C.ss_revocation_reason.code,1,&subregion,pinfo)) 
    13361335            return 0; 
    13371336 
    13381337        /* the rest is a human-readable UTF-8 string */ 
    1339         if(!read_string(&C.ss_revocation_reason.text,&subregion,parse_info)) 
     1338        if(!read_string(&C.ss_revocation_reason.text,&subregion,pinfo)) 
    13401339            return 0; 
    13411340        break; 
     
    13431342    case OPS_PTAG_SS_REVOCATION_KEY: 
    13441343        /* octet 0 = class. Bit 0x80 must be set */ 
    1345         if(!limited_read (&C.ss_revocation_key.class,1,&subregion,parse_info)) 
     1344        if(!limited_read (&C.ss_revocation_key.class,1,&subregion,pinfo)) 
    13461345            return 0; 
    13471346        if(!(C.ss_revocation_key.class&0x80)) 
     
    13531352  
    13541353        /* octet 1 = algid */ 
    1355         if(!limited_read(&C.ss_revocation_key.algid,1,&subregion,parse_info)) 
     1354        if(!limited_read(&C.ss_revocation_key.algid,1,&subregion,pinfo)) 
    13561355            return 0; 
    13571356  
    13581357        /* octets 2-21 = fingerprint */ 
    13591358        if(!limited_read(&C.ss_revocation_key.fingerprint[0],20,&subregion, 
    1360                          parse_info)) 
     1359                         pinfo)) 
    13611360            return 0; 
    13621361        break; 
    13631362  
    13641363    default: 
    1365         if(parse_info->ss_parsed[t8]&t7) 
    1366             ERR1P(parse_info,"Unknown signature subpacket type (%d)", 
     1364        if(pinfo->ss_parsed[t8]&t7) 
     1365            ERR1P(pinfo,"Unknown signature subpacket type (%d)", 
    13671366                  c[0]&0x7f); 
    13681367        read=ops_false; 
     
    13711370 
    13721371    /* Application doesn't want it delivered parsed */ 
    1373     if(!(parse_info->ss_parsed[t8]&t7)) 
     1372    if(!(pinfo->ss_parsed[t8]&t7)) 
    13741373        { 
    13751374        if(content.critical) 
    1376             ERR1P(parse_info,"Critical signature subpacket ignored (%d)", 
     1375            ERR1P(pinfo,"Critical signature subpacket ignored (%d)", 
    13771376                  c[0]&0x7f); 
    1378         if(!read && !limited_skip(subregion.length-1,&subregion,parse_info)) 
     1377        if(!read && !limited_skip(subregion.length-1,&subregion,pinfo)) 
    13791378            return 0; 
    13801379        //      printf("skipped %d length %d\n",c[0]&0x7f,subregion.length); 
     
    13851384 
    13861385    if(read && subregion.length_read != subregion.length) 
    1387         ERR1P(parse_info,"Unconsumed data (%d)", subregion.length-subregion.length_read); 
     1386        ERR1P(pinfo,"Unconsumed data (%d)", subregion.length-subregion.length_read); 
    13881387  
    1389     CBP(parse_info,content.tag,&content); 
     1388    CBP(pinfo,content.tag,&content); 
    13901389 
    13911390    return 1; 
     
    14451444static int parse_signature_subpackets(ops_signature_t *sig, 
    14461445                                      ops_region_t *region, 
    1447                                       ops_parse_info_t *parse_info) 
     1446                                      ops_parse_info_t *pinfo) 
    14481447    { 
    14491448    ops_region_t subregion; 
     
    14511450 
    14521451    ops_init_subregion(&subregion,region); 
    1453     if(!limited_read_scalar(&subregion.length,2,region,parse_info)) 
     1452    if(!limited_read_scalar(&subregion.length,2,region,pinfo)) 
    14541453        return 0; 
    14551454 
    14561455    if(subregion.length > region->length) 
    1457         ERRP(parse_info,"Subpacket set too long"); 
     1456        ERRP(pinfo,"Subpacket set too long"); 
    14581457 
    14591458    while(subregion.length_read < subregion.length) 
    1460         if(!parse_one_signature_subpacket(sig,&subregion,parse_info)) 
     1459        if(!parse_one_signature_subpacket(sig,&subregion,pinfo)) 
    14611460            return 0; 
    14621461 
     
    14641463        { 
    14651464        if(!limited_skip(subregion.length-subregion.length_read,&subregion, 
    1466                          parse_info)) 
    1467             ERRP(parse_info,"Read failed while recovering from subpacket length mismatch"); 
    1468         ERRP(parse_info,"Subpacket length mismatch"); 
     1465                         pinfo)) 
     1466            ERRP(pinfo,"Read failed while recovering from subpacket length mismatch"); 
     1467        ERRP(pinfo,"Subpacket length mismatch"); 
    14691468        } 
    14701469 
     
    14851484 * \see RFC2440bis-12 5.2.3 
    14861485 */ 
    1487 static int parse_v4_signature(ops_region_t *region,ops_parse_info_t *parse_info, 
     1486static int parse_v4_signature(ops_region_t *region,ops_parse_info_t *pinfo, 
    14881487                              size_t v4_hashed_data_start) 
    14891488    { 
     
    14951494    C.signature.v4_hashed_data_start=v4_hashed_data_start; 
    14961495 
    1497     if(!limited_read(c,1,region,parse_info)) 
     1496    if(!limited_read(c,1,region,pinfo)) 
    14981497        return 0; 
    14991498    C.signature.type=c[0]; 
    15001499    /* XXX: check signature type */ 
    15011500 
    1502     if(!limited_read(c,1,region,parse_info)) 
     1501    if(!limited_read(c,1,region,pinfo)) 
    15031502        return 0; 
    15041503    C.signature.key_algorithm=c[0]; 
    15051504    /* XXX: check algorithm */ 
    15061505 
    1507     if(!limited_read(c,1,region,parse_info)) 
     1506    if(!limited_read(c,1,region,pinfo)) 
    15081507        return 0; 
    15091508    C.signature.hash_algorithm=c[0]; 
    15101509    /* XXX: check algorithm */ 
    15111510 
    1512     CBP(parse_info,OPS_PTAG_CT_SIGNATURE_HEADER,&content); 
    1513  
    1514     if(!parse_signature_subpackets(&C.signature,region,parse_info)) 
    1515         return 0; 
    1516     C.signature.v4_hashed_data_length=parse_info->rinfo.alength 
     1511    CBP(pinfo,OPS_PTAG_CT_SIGNATURE_HEADER,&content); 
     1512 
     1513    if(!parse_signature_subpackets(&C.signature,region,pinfo)) 
     1514        return 0; 
     1515    C.signature.v4_hashed_data_length=pinfo->rinfo.alength 
    15171516        -C.signature.v4_hashed_data_start; 
    15181517 
    1519     if(!parse_signature_subpackets(&C.signature,region,parse_info)) 
     1518    if(!parse_signature_subpackets(&C.signature,region,pinfo)) 
    15201519        return 0; 
    15211520     
    1522     if(!limited_read(C.signature.hash2,2,region,parse_info)) 
     1521    if(!limited_read(C.signature.hash2,2,region,pinfo)) 
    15231522        return 0; 
    15241523 
     
    15261525        { 
    15271526    case OPS_PKA_RSA: 
    1528         if(!limited_read_mpi(&C.signature.signature.rsa.sig,region,parse_info)) 
     1527        if(!limited_read_mpi(&C.signature.signature.rsa.sig,region,pinfo)) 
    15291528            return 0; 
    15301529        break; 
    15311530 
    15321531    case OPS_PKA_DSA: 
    1533         if(!limited_read_mpi(&C.signature.signature.dsa.r,region,parse_info))  
    1534             ERRP(parse_info,"Error reading DSA r field in signature"); 
    1535         if (!limited_read_mpi(&C.signature.signature.dsa.s,region,parse_info)) 
    1536             ERRP(parse_info,"Error reading DSA s field in signature"); 
     1532        if(!limited_read_mpi(&C.signature.signature.dsa.r,region,pinfo))  
     1533            ERRP(pinfo,"Error reading DSA r field in signature"); 
     1534        if (!limited_read_mpi(&C.signature.signature.dsa.s,region,pinfo)) 
     1535            ERRP(pinfo,"Error reading DSA s field in signature"); 
    15371536        break; 
    15381537 
    15391538    case OPS_PKA_ELGAMAL_ENCRYPT_OR_SIGN: 
    1540         if(!limited_read_mpi(&C.signature.signature.elgamal.r,region,parse_info) 
    1541            || !limited_read_mpi(&C.signature.signature.elgamal.s,region,parse_info)) 
     1539        if(!limited_read_mpi(&C.signature.signature.elgamal.r,region,pinfo) 
     1540           || !limited_read_mpi(&C.signature.signature.elgamal.s,region,pinfo)) 
    15421541            return 0; 
    15431542        break; 
     
    15541553    case OPS_PKA_PRIVATE09: 
    15551554    case OPS_PKA_PRIVATE10: 
    1556         if (!read_data(&C.signature.signature.unknown.data,region,parse_info)) 
     1555        if (!read_data(&C.signature.signature.unknown.data,region,pinfo)) 
    15571556            return 0; 
    15581557        break; 
    15591558 
    15601559    default: 
    1561         ERR1P(parse_info,"Bad v4 signature key algorithm (%d)", 
     1560        ERR1P(pinfo,"Bad v4 signature key algorithm (%d)", 
    15621561              C.signature.key_algorithm); 
    15631562        } 
    15641563 
    15651564    if(region->length_read != region->length) 
    1566         ERR1P(parse_info,"Unconsumed data (%d)", 
     1565        ERR1P(pinfo,"Unconsumed data (%d)", 
    15671566              region->length-region->length_read); 
    15681567 
    1569     CBP(parse_info,OPS_PTAG_CT_SIGNATURE_FOOTER,&content); 
     1568    CBP(pinfo,OPS_PTAG_CT_SIGNATURE_FOOTER,&content); 
    15701569 
    15711570    return 1; 
     
    15831582 * \return              1 on success, 0 on error 
    15841583 */ 
    1585 static int parse_signature(ops_region_t *region,ops_parse_info_t *parse_info) 
     1584static int parse_signature(ops_region_t *region,ops_parse_info_t *pinfo) 
    15861585    { 
    15871586    unsigned char c[1]; 
     
    15931592    memset(&content,'\0',sizeof content); 
    15941593 
    1595     v4_hashed_data_start=parse_info->rinfo.alength; 
    1596     if(!limited_read(c,1,region,parse_info)) 
     1594    v4_hashed_data_start=pinfo->rinfo.alength; 
     1595    if(!limited_read(c,1,region,pinfo)) 
    15971596        return 0; 
    15981597 
    15991598    if(c[0] == 2 || c[0] == 3) 
    1600         return parse_v3_signature(region,parse_info); 
     1599        return parse_v3_signature(region,pinfo); 
    16011600    else if(c[0] == 4) 
    1602         return parse_v4_signature(region,parse_info,v4_hashed_data_start); 
    1603     ERR1P(parse_info,"Bad signature version (%d)",c[0]); 
    1604     } 
    1605  
    1606 static int parse_compressed(ops_region_t *region,ops_parse_info_t *parse_info) 
     1601        return parse_v4_signature(region,pinfo,v4_hashed_data_start); 
     1602    ERR1P(pinfo,"Bad signature version (%d)",c[0]); 
     1603    } 
     1604 
     1605static int parse_compressed(ops_region_t *region,ops_parse_info_t *pinfo) 
    16071606    { 
    16081607    unsigned char c[1]; 
    16091608    ops_parser_content_t content; 
    16101609 
    1611     if(!limited_read(c,1,region,parse_info)) 
     1610    if(!limited_read(c,1,region,pinfo)) 
    16121611        return 0; 
    16131612 
    16141613    C.compressed.type=c[0]; 
    16151614 
    1616     CBP(parse_info,OPS_PTAG_CT_COMPRESSED,&content); 
     1615    CBP(pinfo,OPS_PTAG_CT_COMPRESSED,&content); 
    16171616 
    16181617    /* The content of a compressed data packet is more OpenPGP packets 
    16191618       once decompressed, so recursively handle them */ 
    16201619 
    1621     return ops_decompress(region,parse_info); 
    1622     } 
    1623  
    1624 static int parse_one_pass(ops_region_t *region,ops_parse_info_t *parse_info) 
     1620    return ops_decompress(region,pinfo); 
     1621    } 
     1622 
     1623static int parse_one_pass(ops_region_t *region,ops_parse_info_t *pinfo) 
    16251624    { 
    16261625    unsigned char c[1]; 
    16271626    ops_parser_content_t content; 
    16281627 
    1629     if(!limited_read(&C.one_pass_signature.version,1,region,parse_info)) 
     1628    if(!limited_read(&C.one_pass_signature.version,1,region,pinfo)) 
    16301629        return 0; 
    16311630    if(C.one_pass_signature.version != 3) 
    1632         ERR1P(parse_info,"Bad one-pass signature version (%d)", 
     1631        ERR1P(pinfo,"Bad one-pass signature version (%d)", 
    16331632             C.one_pass_signature.version); 
    16341633 
    1635     if(!limited_read(c,1,region,parse_info)) 
     1634    if(!limited_read(c,1,region,pinfo)) 
    16361635        return 0; 
    16371636    C.one_pass_signature.sig_type=c[0]; 
    16381637 
    1639     if(!limited_read(c,1,region,parse_info)) 
     1638    if(!limited_read(c,1,region,pinfo)) 
    16401639        return 0; 
    16411640    C.one_pass_signature.hash_algorithm=c[0]; 
    16421641 
    1643     if(!limited_read(c,1,region,parse_info)) 
     1642    if(!limited_read(c,1,region,pinfo)) 
    16441643        return 0; 
    16451644    C.one_pass_signature.key_algorithm=c[0]; 
    16461645 
    16471646    if(!limited_read(C.one_pass_signature.keyid, 
    1648                          sizeof C.one_pass_signature.keyid,region,parse_info)) 
    1649         return 0; 
    1650  
    1651     if(!limited_read(c,1,region,parse_info)) 
     1647                         sizeof C.one_pass_signature.keyid,region,pinfo)) 
     1648        return 0; 
     1649 
     1650    if(!limited_read(c,1,region,pinfo)) 
    16521651        return 0; 
    16531652    C.one_pass_signature.nested=!!c[0]; 
    16541653 
    1655     CBP(parse_info,OPS_PTAG_CT_ONE_PASS_SIGNATURE,&content); 
     1654    CBP(pinfo,OPS_PTAG_CT_ONE_PASS_SIGNATURE,&content); 
    16561655 
    16571656    return 1; 
     
    16901689 
    16911690static int 
    1692 parse_trust (ops_region_t *region, ops_parse_info_t *parse_info) 
     1691parse_trust (ops_region_t *region, ops_parse_info_t *pinfo) 
    16931692    { 
    16941693    ops_parser_content_t content; 
    16951694 
    1696     if(!read_data(&C.trust.data,region,parse_info)) 
    1697             return 0; 
    1698  
    1699     CBP(parse_info,OPS_PTAG_CT_TRUST, &content); 
     1695    if(!read_data(&C.trust.data,region,pinfo)) 
     1696            return 0; 
     1697 
     1698    CBP(pinfo,OPS_PTAG_CT_TRUST, &content); 
    17001699 
    17011700    return 1; 
    17021701    } 
    17031702 
    1704 static int parse_literal_data(ops_region_t *region,ops_parse_info_t *parse_info) 
     1703static int parse_literal_data(ops_region_t *region,ops_parse_info_t *pinfo) 
    17051704    { 
    17061705    ops_parser_content_t content; 
    17071706    unsigned char c[1]; 
    17081707 
    1709     if(!limited_read(c,1,region,parse_info)) 
     1708    if(!limited_read(c,1,region,pinfo)) 
    17101709        return 0; 
    17111710    C.literal_data_header.format=c[0]; 
    17121711 
    1713     if(!limited_read(c,1,region,parse_info)) 
     1712    if(!limited_read(c,1,region,pinfo)) 
    17141713        return 0; 
    17151714    if(!limited_read((unsigned char *)C.literal_data_header.filename,c[0], 
    1716                      region,parse_info)) 
     1715                     region,pinfo)) 
    17171716        return 0; 
    17181717    C.literal_data_header.filename[c[0]]='\0'; 
    17191718 
    1720     if(!limited_read_time(&C.literal_data_header.modification_time,region,parse_info)) 
    1721         return 0; 
    1722  
    1723     CBP(parse_info,OPS_PTAG_CT_LITERAL_DATA_HEADER,&content); 
     1719    if(!limited_read_time(&C.literal_data_header.modification_time,region,pinfo)) 
     1720        return 0; 
     1721 
     1722    CBP(pinfo,OPS_PTAG_CT_LITERAL_DATA_HEADER,&content); 
    17241723 
    17251724    while(region->length_read < region->length) 
     
    17301729            l=sizeof C.literal_data_body.data; 
    17311730 
    1732         if(!limited_read(C.literal_data_body.data,l,region,parse_info)) 
     1731        if(!limited_read(C.literal_data_body.data,l,region,pinfo)) 
    17331732            return 0; 
    17341733 
    17351734        C.literal_data_body.length=l; 
    17361735 
    1737         CBP(parse_info,OPS_PTAG_CT_LITERAL_DATA_BODY,&content); 
     1736        CBP(pinfo,OPS_PTAG_CT_LITERAL_DATA_BODY,&content); 
    17381737        } 
    17391738 
     
    17751774    } 
    17761775 
    1777 static int consume_packet(ops_region_t *region,ops_parse_info_t *parse_info, 
     1776static int consume_packet(ops_region_t *region,ops_parse_info_t *pinfo, 
    17781777                          ops_boolean_t warn) 
    17791778    { 
     
    17811780    ops_parser_content_t content; 
    17821781 
    1783     if(read_data(&remainder,region,parse_info)) 
     1782    if(read_data(&remainder,region,pinfo)) 
    17841783        { 
    17851784        /* now throw it away */ 
    17861785        data_free(&remainder); 
    17871786        if(warn) 
    1788             ERRCODEP(parse_info,OPS_E_P_PACKET_CONSUMED); 
     1787            ERRCODEP(pinfo,OPS_E_P_PACKET_CONSUMED); 
    17891788        } 
    17901789    else if(warn) 
    1791         WARNP(parse_info,"Problem consuming remainder of error packet."); 
     1790        WARNP(pinfo,"Problem consuming remainder of error packet."); 
    17921791    else 
    17931792        return 0; 
     
    17961795    } 
    17971796 
    1798 static int parse_secret_key(ops_region_t *region,ops_parse_info_t *parse_info) 
     1797static int parse_secret_key(ops_region_t *region,ops_parse_info_t *pinfo) 
    17991798    { 
    18001799    ops_parser_content_t content; 
     
    18101809 
    18111810    memset(&content,'\0',sizeof content); 
    1812     if(!parse_public_key_data(&C.secret_key.public_key,region,parse_info)) 
    1813         return 0; 
    1814  
    1815     parse_info->reading_v3_secret=C.secret_key.public_key.version != OPS_V4; 
    1816  
    1817     if(!limited_read(c,1,region,parse_info)) 
     1811    if(!parse_public_key_data(&C.secret_key.public_key,region,pinfo)) 
     1812        return 0; 
     1813 
     1814    pinfo->reading_v3_secret=C.secret_key.public_key.version != OPS_V4; 
     1815 
     1816    if(!limited_read(c,1,region,pinfo)) 
    18181817        return 0; 
    18191818    C.secret_key.s2k_usage=c[0]; 
     
    18251824       || C.secret_key.s2k_usage == OPS_S2KU_ENCRYPTED_AND_HASHED) 
    18261825        { 
    1827         if(!limited_read(c,1,region,parse_info)) 
     1826        if(!limited_read(c,1,region,pinfo)) 
    18281827            return 0; 
    18291828        C.secret_key.algorithm=c[0]; 
    18301829 
    1831         if(!limited_read(c,1,region,parse_info)) 
     1830        if(!limited_read(c,1,region,pinfo)) 
    18321831            return 0; 
    18331832        C.secret_key.s2k_specifier=c[0]; 
     
    18371836               || C.secret_key.s2k_specifier == OPS_S2KS_ITERATED_AND_SALTED); 
    18381837 
    1839         if(!limited_read(c,1,region,parse_info)) 
     1838        if(!limited_read(c,1,region,pinfo)) 
    18401839            return 0; 
    18411840        C.secret_key.hash_algorithm=c[0]; 
    18421841 
    18431842        if(C.secret_key.s2k_specifier != OPS_S2KS_SIMPLE 
    1844            && !limited_read(C.secret_key.salt,8,region,parse_info)) 
     1843           && !limited_read(C.secret_key.salt,8,region,pinfo)) 
    18451844            return 0; 
    18461845 
    18471846        if(C.secret_key.s2k_specifier == OPS_S2KS_ITERATED_AND_SALTED) 
    18481847            { 
    1849             if(!limited_read(c,1,region,parse_info)) 
     1848            if(!limited_read(c,1,region,pinfo)) 
    18501849                return 0; 
    18511850            C.secret_key.octet_count=(16+(c[0]&15)) << ((c[0] >> 4)+6); 
     
    18781877        assert(blocksize > 0 && blocksize <= OPS_MAX_BLOCK_SIZE); 
    18791878 
    1880         if(!limited_read(C.secret_key.iv,blocksize,region,parse_info)) 
     1879        if(!limited_read(C.secret_key.iv,blocksize,region,pinfo)) 
    18811880            return 0; 
    18821881 
     
    18851884        pc.content.secret_key_passphrase.passphrase=&passphrase; 
    18861885        pc.content.secret_key_passphrase.secret_key=&C.secret_key; 
    1887         CBP(parse_info,OPS_PARSER_CMD_GET_SK_PASSPHRASE,&pc); 
     1886        CBP(pinfo,OPS_PARSER_CMD_GET_SK_PASSPHRASE,&pc); 
    18881887        if(!passphrase) 
    18891888            { 
    1890             if(!consume_packet(region,parse_info,ops_false)) 
     1889            if(!consume_packet(region,pinfo,ops_false)) 
    18911890               return 0; 
    18921891 
    1893             CBP(parse_info,OPS_PTAG_CT_ENCRYPTED_SECRET_KEY,&content); 
     1892            CBP(pinfo,OPS_PTAG_CT_ENCRYPTED_SECRET_KEY,&content); 
    18941893 
    18951894            return 1; 
     
    19571956        decrypt.set_key(&decrypt,key); 
    19581957 
    1959         ops_reader_push_decrypt(parse_info,&decrypt,region); 
     1958        ops_reader_push_decrypt(pinfo,&decrypt,region); 
    19601959 
    19611960        /* Since all known encryption for PGP doesn't compress, we can 
     
    19731972        { 
    19741973        ops_hash_sha1(&checkhash); 
    1975         ops_reader_push_hash(parse_info,&checkhash); 
     1974        ops_reader_push_hash(pinfo,&checkhash); 
    19761975        } 
    19771976    else 
    1978         ops_reader_push_sum16(parse_info); 
     1977        ops_reader_push_sum16(pinfo); 
    19791978 
    19801979    switch(C.secret_key.public_key.algorithm) 
     
    19831982    case OPS_PKA_RSA_ENCRYPT_ONLY: 
    19841983    case OPS_PKA_RSA_SIGN_ONLY: 
    1985         if(!limited_read_mpi(&C.secret_key.key.rsa.d,region,parse_info) 
    1986            || !limited_read_mpi(&C.secret_key.key.rsa.p,region,parse_info) 
    1987            || !limited_read_mpi(&C.secret_key.key.rsa.q,region,parse_info) 
    1988            || !limited_read_mpi(&C.secret_key.key.rsa.u,region,parse_info)) 
     1984        if(!limited_read_mpi(&C.secret_key.key.rsa.d,region,pinfo) 
     1985           || !limited_read_mpi(&C.secret_key.key.rsa.p,region,pinfo) 
     1986           || !limited_read_mpi(&C.secret_key.key.rsa.q,region,pinfo) 
     1987           || !limited_read_mpi(&C.secret_key.key.rsa.u,region,pinfo)) 
    19891988            ret=0; 
    19901989        break; 
    19911990 
    19921991    case OPS_PKA_DSA: 
    1993         if(!limited_read_mpi(&C.secret_key.key.dsa.x,region,parse_info)) 
     1992        if(!limited_read_mpi(&C.secret_key.key.dsa.x,region,pinfo)) 
    19941993            ret=0; 
    19951994        break; 
     
    20022001        } 
    20032002 
    2004     parse_info->reading_v3_secret=ops_false; 
     2003    pinfo->reading_v3_secret=ops_false; 
    20052004 
    20062005    if(C.secret_key.s2k_usage == OPS_S2KU_ENCRYPTED_AND_HASHED) 
     
    20082007        unsigned char hash[20]; 
    20092008 
    2010         ops_reader_pop_hash(parse_info); 
     2009        ops_reader_pop_hash(pinfo); 
    20112010        checkhash.finish(&checkhash,hash); 
    20122011             
    20132012        if(crypted && C.secret_key.public_key.version != OPS_V4) 
    20142013            { 
    2015             ops_reader_pop_decrypt(parse_info); 
     2014            ops_reader_pop_decrypt(pinfo); 
    20162015            region=saved_region; 
    20172016            } 
     
    20192018        if(ret) 
    20202019            { 
    2021             if(!limited_read(C.secret_key.checkhash,20,region,parse_info)) 
     2020            if(!limited_read(C.secret_key.checkhash,20,region,pinfo)) 
    20222021                return 0; 
    20232022 
    20242023            if(memcmp(hash,C.secret_key.checkhash,20)) 
    2025                 ERRP(parse_info,"Hash mismatch in secret key"); 
     2024                ERRP(pinfo,"Hash mismatch in secret key"); 
    20262025            } 
    20272026        } 
     
    20302029        unsigned short sum; 
    20312030 
    2032         sum=ops_reader_pop_sum16(parse_info); 
     2031        sum=ops_reader_pop_sum16(pinfo); 
    20332032 
    20342033        if(crypted && C.secret_key.public_key.version != OPS_V4) 
    20352034            { 
    2036             ops_reader_pop_decrypt(parse_info); 
     2035            ops_reader_pop_decrypt(pinfo); 
    20372036            region=saved_region; 
    20382037            } 
     
    20412040            { 
    20422041            if(!limited_read_scalar(&C.secret_key.checksum,2,region, 
    2043                                     parse_info)) 
     2042                                    pinfo)) 
    20442043                return 0; 
    20452044 
    20462045            if(sum != C.secret_key.checksum) 
    2047                 ERRP(parse_info,"Checksum mismatch in secret key"); 
     2046                ERRP(pinfo,"Checksum mismatch in secret key"); 
    20482047            } 
    20492048        } 
    20502049 
    20512050    if(crypted && C.secret_key.public_key.version == OPS_V4) 
    2052         ops_reader_pop_decrypt(parse_info); 
     2051        ops_reader_pop_decrypt(pinfo); 
    20532052 
    20542053    assert(!ret || region->length_read == region->length); 
     
    20572056        return 0; 
    20582057 
    2059     CBP(parse_info,OPS_PTAG_CT_SECRET_KEY,&content); 
     2058    CBP(pinfo,OPS_PTAG_CT_SECRET_KEY,&content); 
    20602059 
    20612060    return 1; 
     
    20632062 
    20642063static int parse_pk_session_key(ops_region_t *region, 
    2065                                 ops_parse_info_t *parse_info) 
     2064                                ops_parse_info_t *pinfo) 
    20662065    { 
    20672066    unsigned char c[1]; 
     
    20742073    const ops_secret_key_t *secret; 
    20752074 
    2076     if(!limited_read(c,1,region,parse_info)) 
     2075    if(!limited_read(c,1,region,pinfo)) 
    20772076        return 0; 
    20782077    C.pk_session_key.version=c[0]; 
    20792078    if(C.pk_session_key.version != OPS_PKSK_V3) 
    2080         ERR1P(parse_info, 
     2079        ERR1P(pinfo, 
    20812080              "Bad public-key encrypted session key version (%d)", 
    20822081              C.pk_session_key.version); 
    20832082 
    20842083    if(!limited_read(C.pk_session_key.key_id, 
    2085                      sizeof C.pk_session_key.key_id,region,parse_info)) 
    2086         return 0; 
    2087  
    2088     if(!limited_read(c,1,region,parse_info)) 
     2084                     sizeof C.pk_session_key.key_id,region,pinfo)) 
     2085        return 0; 
     2086 
     2087    if(!limited_read(c,1,region,pinfo)) 
    20892088        return 0; 
    20902089    C.pk_session_key.algorithm=c[0]; 
     
    20932092    case OPS_PKA_RSA: 
    20942093        if(!limited_read_mpi(&C.pk_session_key.parameters.rsa.encrypted_m, 
    2095                              region,parse_info)) 
     2094                             region,pinfo)) 
    20962095            return 0; 
    20972096        enc_m=C.pk_session_key.parameters.rsa.encrypted_m; 
     
    21002099    case OPS_PKA_ELGAMAL: 
    21012100        if(!limited_read_mpi(&C.pk_session_key.parameters.elgamal.g_to_k, 
    2102                              region,parse_info) 
     2101                             region,pinfo) 
    21032102           || limited_read_mpi(&C.pk_session_key.parameters.elgamal.encrypted_m, 
    2104                              region,parse_info)) 
     2103                             region,pinfo)) 
    21052104            return 0; 
    21062105        enc_m=C.pk_session_key.parameters.elgamal.encrypted_m; 
     
    21082107 
    21092108    default: 
    2110         ERR1P(parse_info, 
     2109        ERR1P(pinfo, 
    21112110              "Unknown public key algorithm in session key (%d)", 
    21122111              C.pk_session_key.algorithm); 
     
    21192118    pc.content.get_secret_key.pk_session_key=&C.pk_session_key; 
    21202119 
    2121     CBP(parse_info,OPS_PARSER_CMD_GET_SECRET_KEY,&pc); 
     2120    CBP(pinfo,OPS_PARSER_CMD_GET_SECRET_KEY,&pc); 
    21222121 
    21232122    if(!secret) 
    21242123        { 
    2125         CBP(parse_info,OPS_PTAG_CT_ENCRYPTED_PK_SESSION_KEY,&content); 
     2124        CBP(pinfo,OPS_PTAG_CT_ENCRYPTED_PK_SESSION_KEY,&content); 
    21262125 
    21272126        return 1; 
     
    21312130 
    21322131    if(n < 1) 
    2133         ERRP(parse_info,"decrypted message too short"); 
     2132        ERRP(pinfo,"decrypted message too short"); 
    21342133 
    21352134    C.pk_session_key.symmetric_algorithm=buf[0]; 
     
    21372136 
    21382137    if((unsigned)n != k+3) 
    2139         ERR2P(parse_info,"decrypted message wrong length (got %d expected %d)", 
     2138        ERR2P(pinfo,"decrypted message wrong length (got %d expected %d)", 
    21402139              n,k+3); 
    21412140     
     
    21482147    // XXX: Check checksum! 
    21492148 
    2150     CBP(parse_info,OPS_PTAG_CT_PK_SESSION_KEY,&content); 
    2151  
    2152     ops_decrypt_any(&parse_info->decrypt,C.pk_session_key.symmetric_algorithm); 
    2153     parse_info->decrypt.set_key(&parse_info->decrypt,C.pk_session_key.key); 
     2149    CBP(pinfo,OPS_PTAG_CT_PK_SESSION_KEY,&content); 
     2150 
     2151    ops_decrypt_any(&pinfo->decrypt,C.pk_session_key.symmetric_algorithm); 
     2152    pinfo->decrypt.set_key(&pinfo->decrypt,C.pk_session_key.key); 
    21542153 
    21552154    return 1; 
     
    22122211    } 
    22132212 
    2214 static int parse_se_data(ops_region_t *region,ops_parse_info_t *parse_info) 
     2213static int parse_se_data(ops_region_t *region,ops_parse_info_t *pinfo) 
    22152214    { 
    22162215    ops_parser_content_t content; 
    22172216 
    22182217    /* there's no info to go with this, so just announce it */ 
    2219     CBP(parse_info,OPS_PTAG_CT_SE_DATA_HEADER,&content); 
     2218    CBP(pinfo,OPS_PTAG_CT_SE_DATA_HEADER,&content); 
    22202219 
    22212220    /* The content of an encrypted data packet is more OpenPGP packets 
    22222221       once decrypted, so recursively handle them */ 
    2223     return ops_decrypt_data(OPS_PTAG_CT_SE_DATA_BODY,region,parse_info); 
    2224     } 
    2225  
    2226 static int parse_se_ip_data(ops_region_t *region,ops_parse_info_t *parse_info) 
     2222    return ops_decrypt_data(OPS_PTAG_CT_SE_DATA_BODY,region,pinfo); 
     2223    } 
     2224 
     2225static int parse_se_ip_data(ops_region_t *region,ops_parse_info_t *pinfo) 
    22272226    { 
    22282227    unsigned char c[1]; 
    22292228    ops_parser_content_t content; 
    22302229 
    2231     if(!limited_read(c,1,region,parse_info)) 
     2230    if(!limited_read(c,1,region,pinfo)) 
    22322231        return 0; 
    22332232    C.se_ip_data_header.version=c[0]; 
    22342233    assert(C.se_ip_data_header.version == OPS_SE_IP_V1); 
    22352234 
    2236     CBP(parse_info,OPS_PTAG_CT_SE_IP_DATA_HEADER,&content); 
     2235    CBP(pinfo,OPS_PTAG_CT_SE_IP_DATA_HEADER,&content); 
    22372236 
    22382237    /* The content of an encrypted data packet is more OpenPGP packets 
    22392238       once decrypted, so recursively handle them */ 
    2240     return ops_decrypt_data(OPS_PTAG_CT_SE_IP_DATA_BODY,region,parse_info); 
     2239    return ops_decrypt_data(OPS_PTAG_CT_SE_IP_DATA_BODY,region,pinfo); 
    22412240    } 
    22422241 
     
    22472246 * content. 
    22482247 * 
    2249  * \param *parse_info How to parse 
     2248 * \param *pinfo      How to parse 
    22502249 * \param *pktlen       On return, will contain number of bytes in packet 
    22512250 * \return 1 on success, 0 on error, -1 on EOF */ 
    2252 static int ops_parse_one_packet(ops_parse_info_t *parse_info, 
     2251static int ops_parse_one_packet(ops_parse_info_t *pinfo, 
    22532252                                unsigned long *pktlen) 
    22542253    { 
     
    22612260    ops_boolean_t indeterminate=ops_false; 
    22622261 
    2263     C.ptag.position=parse_info->rinfo.position; 
    2264  
    2265     ret=base_read(ptag,&one,0,parse_info); 
     2262    C.ptag.position=pinfo->rinfo.position; 
     2263 
     2264    ret=base_read(ptag,&one,0,pinfo); 
    22662265    if(ret == OPS_R_EOF || ret == OPS_R_EARLY_EOF) 
    22672266        return -1; 
     
    22732272        { 
    22742273        C.error.error="Format error (ptag bit not set)"; 
    2275         CBP(parse_info,OPS_PARSER_ERROR,&content); 
     2274        CBP(pinfo,OPS_PARSER_ERROR,&content); 
    22762275        return 0; 
    22772276        } 
     
    22812280        C.ptag.content_tag=*ptag&OPS_PTAG_NF_CONTENT_TAG_MASK; 
    22822281        C.ptag.length_type=0; 
    2283         if(!read_new_length(&C.ptag.length,parse_info)) 
     2282        if(!read_new_length(&C.ptag.length,pinfo)) 
    22842283            return 0; 
    22852284 
     
    22932292            { 
    22942293        case OPS_PTAG_OF_LT_ONE_BYTE: 
    2295             ret=read_scalar(&C.ptag.length,1,parse_info); 
     2294            ret=read_scalar(&C.ptag.length,1,pinfo); 
    22962295            break; 
    22972296 
    22982297        case OPS_PTAG_OF_LT_TWO_BYTE: 
    2299             ret=read_scalar(&C.ptag.length,2,parse_info); 
     2298            ret=read_scalar(&C.ptag.length,2,pinfo); 
    23002299            break; 
    23012300 
    23022301        case OPS_PTAG_OF_LT_FOUR_BYTE: 
    2303             ret=read_scalar(&C.ptag.length,4,parse_info); 
     2302            ret=read_scalar(&C.ptag.length,4,pinfo); 
    23042303            break; 
    23052304 
     
    23142313        } 
    23152314 
    2316     CBP(parse_info,OPS_PARSER_PTAG,&content); 
     2315    CBP(pinfo,OPS_PARSER_PTAG,&content); 
    23172316 
    23182317    ops_init_subregion(&region,NULL); 
     
    23222321        { 
    23232322    case OPS_PTAG_CT_SIGNATURE: 
    2324         r=parse_signature(&region,parse_info); 
     2323        r=parse_signature(&region,pinfo); 
    23252324        break; 
    23262325 
    23272326    case OPS_PTAG_CT_PUBLIC_KEY: 
    23282327    case OPS_PTAG_CT_PUBLIC_SUBKEY: 
    2329         r=parse_public_key(C.ptag.content_tag,&region,parse_info); 
     2328        r=parse_public_key(C.ptag.content_tag,&region,pinfo); 
    23302329        break; 
    23312330 
    23322331    case OPS_PTAG_CT_TRUST: 
    2333         r=parse_trust(&region, parse_info); 
     2332        r=parse_trust(&region, pinfo); 
    23342333        break; 
    23352334       
    23362335    case OPS_PTAG_CT_USER_ID: 
    2337         r=parse_user_id(&region,parse_info); 
     2336        r=parse_user_id(&region,pinfo); 
    23382337        break; 
    23392338 
    23402339    case OPS_PTAG_CT_COMPRESSED: 
    2341         r=parse_compressed(&region,parse_info); 
     2340        r=parse_compressed(&region,pinfo); 
    23422341        break; 
    23432342 
    23442343    case OPS_PTAG_CT_ONE_PASS_SIGNATURE: 
    2345         r=parse_one_pass(&region,parse_info); 
     2344        r=parse_one_pass(&region,pinfo); 
    23462345        break; 
    23472346 
    23482347    case OPS_PTAG_CT_LITERAL_DATA: 
    2349         r=parse_literal_data(&region,parse_info); 
     2348        r=parse_literal_data(&region,pinfo); 
    23502349        break; 
    23512350 
    23522351    case OPS_PTAG_CT_USER_ATTRIBUTE: 
    2353         r=parse_user_attribute(&region,parse_info); 
     2352        r=parse_user_attribute(&region,pinfo); 
    23542353        break; 
    23552354 
    23562355    case OPS_PTAG_CT_SECRET_KEY: 
    2357         r=parse_secret_key(&region,parse_info); 
     2356        r=parse_secret_key(&region,pinfo); 
    23582357        break; 
    23592358 
    23602359    case OPS_PTAG_CT_PK_SESSION_KEY: 
    2361         r=parse_pk_session_key(&region,parse_info); 
     2360        r=parse_pk_session_key(&region,pinfo); 
    23622361        break; 
    23632362 
    23642363    case OPS_PTAG_CT_SE_DATA: 
    2365         r=parse_se_data(&region,parse_info); 
     2364        r=parse_se_data(&region,pinfo); 
    23662365        break; 
    23672366 
    23682367    case OPS_PTAG_CT_SE_IP_DATA: 
    2369         r=parse_se_ip_data(&region,parse_info); 
     2368        r=parse_se_ip_data(&region,pinfo); 
    23702369        break; 
    23712370 
     
    23732372        format_error(&content,"Format error (unknown content tag %d)", 
    23742373                     C.ptag.content_tag); 
    2375         ERRCODEP(parse_info,OPS_E_P_UNKNOWN_TAG); 
     2374        ERRCODEP(pinfo,OPS_E_P_UNKNOWN_TAG); 
    23762375        r=0; 
    23772376        } 
     
    23802379 
    23812380    if(region.length != region.length_read) 
    2382         consume_packet(&region,parse_info,ops_true); 
     2381        consume_packet(&region,pinfo,ops_true); 
    23832382 
    23842383    /* set pktlen */ 
    23852384 
    2386     *pktlen=parse_info->rinfo.alength; 
     2385    *pktlen=pinfo->rinfo.alength; 
    23872386 
    23882387    /* do callback on entire packet, if desired */ 
    23892388 
    2390     if(parse_info->rinfo.accumulate) 
    2391         { 
    2392         C.packet.length=parse_info->rinfo.alength; 
    2393         C.packet.raw=parse_info->rinfo.accumulated; 
    2394         parse_info->rinfo.accumulated=NULL; 
    2395         parse_info->rinfo.asize=0; 
    2396         CBP(parse_info,OPS_PARSER_PACKET_END,&content); 
    2397         } 
    2398     parse_info->rinfo.alength=0; 
     2389    if(pinfo->rinfo.accumulate) 
     2390        { 
     2391        C.packet.length=pinfo->rinfo.alength; 
     2392        C.packet.raw=pinfo->rinfo.accumulated; 
     2393        pinfo->rinfo.accumulated=NULL; 
     2394        pinfo->rinfo.asize=0; 
     2395        CBP(pinfo,OPS_PARSER_PACKET_END,&content); 
     2396        } 
     2397    pinfo->rinfo.alength=0; 
    23992398         
    24002399    return r ? 1 : 0; 
     
    24072406 * 
    24082407 * All the necessary information for parsing should have been set up by the 
    2409  * calling function in "*parse_info" beforehand. 
     2408 * calling function in "*pinfo" beforehand. 
    24102409 * 
    24112410 * That information includes : 
     
    24202419 * \sa See Detailed Description for usage. 
    24212420 * 
    2422  * \param *parse_info How to parse 
     2421 * \param *pinfo      How to parse 
    24232422 * \return              1 on success in all packets, 0 on error in any packet 
    2424  * \todo Add some error checking to make sure *parse_info contains a sensible setup? 
     2423 * \todo Add some error checking to make sure *pinfo contains a sensible setup? 
    24252424 */ 
    24262425 
    2427 int ops_parse(ops_parse_info_t *parse_info) 
     2426int ops_parse(ops_parse_info_t *pinfo) 
    24282427    { 
    24292428    int r; 
     
    24312430    do 
    24322431        { 
    2433         r=ops_parse_one_packet(parse_info,&pktlen); 
     2432        r=ops_parse_one_packet(pinfo,&pktlen); 
    24342433        //      offset+=pktlen; 
    24352434        } while (r!=-1); 
    24362435 
    2437     return parse_info->errors ? 0 : 1; 
     2436    return pinfo->errors ? 0 : 1; 
    24382437    } 
    24392438 
     
    24452444 */ 
    24462445 
    2447 int ops_parse_errs(ops_parse_info_t *parse_info, ops_ulong_list_t *errs) 
     2446int ops_parse_errs(ops_parse_info_t *pinfo, ops_ulong_list_t *errs) 
    24482447    { 
    24492448    unsigned err; 
     
    24552454    /* can only handle ops_reader_fd for now */ 
    24562455 
    2457     if (parse_info->rinfo.reader != ops_reader_fd) 
     2456    if (pinfo->rinfo.reader != ops_reader_fd) 
    24582457        { 
    24592458        fprintf(stderr,"ops_parse_errs: can only handle ops_reader_fd\n"); 
     
    24612460        } 
    24622461 
    2463     arg=parse_info->rinfo.arg; 
     2462    arg=pinfo->rinfo.arg; 
    24642463 
    24652464    /* store current state of accumulate flag */ 
    24662465 
    2467     orig_acc=parse_info->rinfo.accumulate; 
     2466    orig_acc=pinfo->rinfo.accumulate; 
    24682467 
    24692468    /* set accumulate flag */ 
    24702469 
    2471     parse_info->rinfo.accumulate=1; 
     2470    pinfo->rinfo.accumulate=1; 
    24722471 
    24732472    /* now parse each error in turn. */ 
     
    24892488        /* parse packet */ 
    24902489 
    2491         ops_parse_one_packet(parse_info,&pktlen); 
     2490        ops_parse_one_packet(pinfo,&pktlen); 
    24922491 
    24932492        } 
    24942493 
    24952494    /* restore accumulate flag original value */ 
    2496     parse_info->rinfo.accumulate=orig_acc; 
     2495    pinfo->rinfo.accumulate=orig_acc; 
    24972496 
    24982497    return 1; 
     
    25062505 * subpacket types should be returned parsed or raw or ignored. 
    25072506 * 
    2508  * \param       parse_info    Pointer to previously allocated structure 
     2507 * \param       pinfo Pointer to previously allocated structure 
    25092508 * \param       tag     Packet tag. OPS_PTAG_SS_ALL for all SS tags; or one individual signature subpacket tag 
    25102509 * \param       type    Parse type 
    25112510 * \todo XXX: Make all packet types optional, not just subpackets */ 
    2512 void ops_parse_options(ops_parse_info_t *parse_info, 
     2511void ops_parse_options(ops_parse_info_t *pinfo, 
    25132512                       ops_content_tag_t tag, 
    25142513                       ops_parse_type_t type) 
     
    25212520 
    25222521        for(n=0 ; n < 256 ; ++n) 
    2523             ops_parse_options(parse_info,OPS_PTAG_SIGNATURE_SUBPACKET_BASE+n, 
     2522            ops_parse_options(pinfo,OPS_PTAG_SIGNATURE_SUBPACKET_BASE+n, 
    25242523                              type); 
    25252524        return; 
     
    25332532        { 
    25342533    case OPS_PARSE_RAW: 
    2535         parse_info->ss_raw[t8] |= t7; 
    2536         parse_info->ss_parsed[t8] &= ~t7; 
     2534        pinfo->ss_raw[t8] |= t7; 
     2535        pinfo->ss_parsed[t8] &= ~t7; 
    25372536        break; 
    25382537 
    25392538    case OPS_PARSE_PARSED: 
    2540         parse_info->ss_raw[t8] &= ~t7; 
    2541         parse_info->ss_parsed[t8] |= t7; 
     2539        pinfo->ss_raw[t8] &= ~t7; 
     2540        pinfo->ss_parsed[t8] |= t7; 
    25422541        break; 
    25432542 
    25442543    case OPS_PARSE_IGNORE: 
    2545         parse_info->ss_raw[t8] &= ~t7; 
    2546         parse_info->ss_parsed[t8] &= ~t7; 
     2544        pinfo->ss_raw[t8] &= ~t7; 
     2545        pinfo->ss_parsed[t8] &= ~t7; 
    25472546        break; 
    25482547        }