Changeset 345
- Timestamp:
- 01/30/06 16:33:42
- Files:
-
- openpgpsdk/trunk/src/packet-parse.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/src/packet-parse.c
r344 r345 1936 1936 decrypt.set_key(&decrypt,key); 1937 1937 1938 /* We need to prevent the decrypter from reading the trailing1939 checksum */1940 region->length-=checksum_length;1941 1938 ops_reader_push_decrypt(parse_info,&decrypt,region); 1942 1939 1943 1940 /* Since all known encryption for PGP doesn't compress, we can 1944 limit to the same length as the current region (for now), 1945 allowing for the trailing checksum. 1941 limit to the same length as the current region (for now). 1946 1942 */ 1947 1943 … … 1977 1973 } 1978 1974 1979 if(saved_region) 1975 if(ret) 1976 { 1977 // XXX: check the checksum 1978 1979 if(C.secret_key.s2k_usage == OPS_S2KU_ENCRYPTED_AND_HASHED) 1980 { 1981 if(!limited_read(C.secret_key.checkhash,20,region,parse_info)) 1982 return 0; 1983 } 1984 else 1985 { 1986 if(!limited_read_scalar(&C.secret_key.checksum,2,region, 1987 parse_info)) 1988 return 0; 1989 } 1990 } 1991 1992 if(C.secret_key.s2k_usage == OPS_S2KU_ENCRYPTED 1993 || C.secret_key.s2k_usage == OPS_S2KU_ENCRYPTED_AND_HASHED) 1980 1994 { 1981 1995 ops_reader_pop_decrypt(parse_info); 1982 1996 assert(region->length_read == region->length); 1983 region=saved_region;1984 /* put back checksum data */1985 region->length+=checksum_length;1986 1997 } 1987 1998 1988 1999 if(!ret) 1989 2000 return 0; 1990 1991 // XXX: check the checksum1992 1993 if(C.secret_key.s2k_usage == OPS_S2KU_ENCRYPTED_AND_HASHED)1994 {1995 if(!limited_read(C.secret_key.checkhash,20,region,parse_info))1996 return 0;1997 }1998 else1999 {2000 if(!limited_read_scalar(&C.secret_key.checksum,2,region,parse_info))2001 return 0;2002 }2003 2001 2004 2002 CBP(parse_info,OPS_PTAG_CT_SECRET_KEY,&content);
