Changeset 601
- Timestamp:
- 08/27/08 11:22:41
- Files:
-
- openpgpsdk/trunk/include/openpgpsdk/packet.h (modified) (20 diffs)
- openpgpsdk/trunk/src/lib/packet-parse.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/include/openpgpsdk/packet.h
r585 r601 45 45 46 46 /************************************/ 47 /* Packet Tags - RFC 2440bis-12, 4.2 */47 /* Packet Tags - RFC4880, 4.2 */ 48 48 /************************************/ 49 49 … … 52 52 * has bit 7 set. This is the mask for it. 53 53 * 54 * \see RFC 2440bis-124.254 * \see RFC4880 4.2 55 55 */ 56 56 #define OPS_PTAG_ALWAYS_SET 0x80 … … 61 61 * old format is used. 62 62 * 63 * \see RFC 2440bis-124.263 * \see RFC4880 4.2 64 64 */ 65 65 #define OPS_PTAG_NEW_FORMAT 0x40 … … 72 72 * shift by #OPS_PTAG_OF_CONTENT_TAG_SHIFT bits. 73 73 * 74 * \see RFC 2440bis-124.274 * \see RFC4880 4.2 75 75 */ 76 76 #define OPS_PTAG_OF_CONTENT_TAG_MASK 0x3c … … 80 80 * out from the Packet Tag. 81 81 * 82 * \see RFC 2440bis-124.282 * \see RFC4880 4.2 83 83 */ 84 84 #define OPS_PTAG_OF_CONTENT_TAG_SHIFT 2 … … 89 89 * See #ops_ptag_of_lt_t for the meaning of the values. 90 90 * 91 * \see RFC 2440bis-124.291 * \see RFC4880 4.2 92 92 */ 93 93 #define OPS_PTAG_OF_LENGTH_TYPE_MASK 0x03 … … 98 98 * old packet format. 99 99 * 100 * \see RFC 2440bis-124.2.1100 * \see RFC4880 4.2.1 101 101 */ 102 102 typedef enum … … 115 115 * shift by #OPS_PTAG_NF_CONTENT_TAG_SHIFT bits. 116 116 * 117 * \see RFC 2440bis-124.2117 * \see RFC4880 4.2 118 118 */ 119 119 #define OPS_PTAG_NF_CONTENT_TAG_MASK 0x3f … … 123 123 * out from the Packet Tag. 124 124 * 125 * \see RFC 2440bis-124.2125 * \see RFC4880 4.2 126 126 */ 127 127 #define OPS_PTAG_NF_CONTENT_TAG_SHIFT 0 … … 136 136 * signature subpacket type values that we understand. 137 137 * 138 * \see RFC 2440bis-124.3139 * \see RFC 2440bis-125.2.3.1138 * \see RFC4880 4.3 139 * \see RFC4880 5.2.3.1 140 140 */ 141 141 enum ops_content_tag_t … … 251 251 252 252 /** Structure to hold one packet tag. 253 * \see RFC 2440bis-124.2253 * \see RFC4880 4.2 254 254 */ 255 255 typedef struct … … 269 269 * This lists algorithm numbers for public key algorithms. 270 270 * 271 * \see RFC 2440bis-129.1271 * \see RFC4880 9.1 272 272 */ 273 273 typedef enum 274 274 { 275 275 OPS_PKA_RSA =1, /*!< RSA (Encrypt or Sign) */ 276 OPS_PKA_RSA_ENCRYPT_ONLY =2, /*!< RSA Encrypt-Only (deprecated - \see RFC 2440bis-12 12.4) */277 OPS_PKA_RSA_SIGN_ONLY =3, /*!< RSA Sign-Only (deprecated - \see RFC 2440bis-12 12.4) */276 OPS_PKA_RSA_ENCRYPT_ONLY =2, /*!< RSA Encrypt-Only (deprecated - \see RFC4880 13.5) */ 277 OPS_PKA_RSA_SIGN_ONLY =3, /*!< RSA Sign-Only (deprecated - \see RFC4880 13.5) */ 278 278 OPS_PKA_ELGAMAL =16, /*!< Elgamal (Encrypt-Only) */ 279 279 OPS_PKA_DSA =17, /*!< DSA (Digital Signature Algorithm) */ … … 297 297 /** Structure to hold one DSA public key parameters. 298 298 * 299 * \see RFC 2440bis-125.5.2299 * \see RFC4880 5.5.2 300 300 */ 301 301 typedef struct … … 309 309 /** Structure to hold on RSA public key. 310 310 * 311 * \see RFC 2440bis-125.5.2311 * \see RFC4880 5.5.2 312 312 */ 313 313 typedef struct … … 319 319 /** Structure to hold on ElGamal public key parameters. 320 320 * 321 * \see RFC 2440bis-125.5.2321 * \see RFC4880 5.5.2 322 322 */ 323 323 typedef struct … … 339 339 * OpenPGP has two different protocol versions: version 3 and version 4. 340 340 * 341 * \see RFC 2440bis-125.2341 * \see RFC4880 5.2 342 342 */ 343 343 typedef enum … … 407 407 * This lists algorithm numbers for symmetric key algorithms. 408 408 * 409 * \see RFC 2440bis-129.2409 * \see RFC4880 9.2 410 410 */ 411 411 typedef enum … … 427 427 * This lists algorithm numbers for hash algorithms. 428 428 * 429 * \see RFC 2440bis-129.4429 * \see RFC4880 9.4 430 430 */ 431 431 typedef enum … … 503 503 * subkey binding has no place on a UserID). 504 504 * 505 * \see RFC 2440bis-125.2.1505 * \see RFC4880 5.2.1 506 506 */ 507 507 typedef enum … … 568 568 /** Struct to hold a signature packet. 569 569 * 570 * \see RFC 2440bis-125.2.2571 * \see RFC 2440bis-125.2.3570 * \see RFC4880 5.2.2 571 * \see RFC4880 5.2.3 572 572 */ 573 573 typedef struct openpgpsdk/trunk/src/lib/packet-parse.c
r596 r601 457 457 * \return 1 on success, 0 on error (calls the cb with OPS_PARSER_ERROR in limited_read()). 458 458 * 459 * \see RFC 2440bis-123.1459 * \see RFC4880 3.1 460 460 */ 461 461 static int limited_read_scalar(unsigned *dest,unsigned length, … … 496 496 * \return 1 on success, 0 on error (calls the cb with OPS_PARSER_ERROR in limited_read()). 497 497 * 498 * \see RFC 2440bis-123.1498 * \see RFC4880 3.1 499 499 */ 500 500 static int limited_read_size_t_scalar(size_t *dest,unsigned length, … … 530 530 * \return see limited_read_scalar() 531 531 * 532 * \see RFC 2440bis-123.5532 * \see RFC4880 3.5 533 533 */ 534 534 static int limited_read_time(time_t *dest,ops_region_t *region, … … 579 579 * see comment below - the callback is called with a OPS_PARSER_ERROR in case of an error) 580 580 * 581 * \see RFC 2440bis-123.2581 * \see RFC4880 3.2 582 582 */ 583 583 static int limited_read_mpi(BIGNUM **pbn,ops_region_t *region, … … 620 620 /** Read some data with a New-Format length from reader. 621 621 * 622 * \sa Internet-Draft RFC 2440bis-13.txt Section 4.2.2622 * \sa Internet-Draft RFC4880.txt Section 4.2.2 623 623 * 624 624 * \param *length Where the decoded length will be put … … 682 682 * see comment below) 683 683 * 684 * \see RFC 2440bis-124.2.2684 * \see RFC4880 4.2.2 685 685 * \see ops_ptag_t 686 686 */ … … 1049 1049 * \return 1 on success, 0 on error 1050 1050 * 1051 * \see RFC 2440bis-125.5.21051 * \see RFC4880 5.5.2 1052 1052 */ 1053 1053 static int parse_public_key(ops_content_tag_t tag,ops_region_t *region, … … 1143 1143 * \return 1 on success, 0 on error 1144 1144 * 1145 * \see RFC 2440bis-125.111145 * \see RFC4880 5.11 1146 1146 */ 1147 1147 static int parse_user_id(ops_region_t *region,ops_parse_info_t *pinfo) … … 1232 1232 * \return 1 on success, 0 on error 1233 1233 * 1234 * \see RFC 2440bis-125.2.21234 * \see RFC4880 5.2.2 1235 1235 */ 1236 1236 static int parse_v3_signature(ops_region_t *region, … … 1329 1329 * \return 1 on success, 0 on error 1330 1330 * 1331 * \see RFC 2440bis-125.2.31331 * \see RFC4880 5.2.3 1332 1332 */ 1333 1333 static int parse_one_signature_subpacket(ops_signature_t *sig, … … 1613 1613 * \return 1 on success, 0 on error 1614 1614 * 1615 * \see RFC 2440bis-125.2.31615 * \see RFC4880 5.2.3 1616 1616 */ 1617 1617 static int parse_signature_subpackets(ops_signature_t *sig, … … 1655 1655 * \return 1 on success, 0 on error 1656 1656 * 1657 * \see RFC 2440bis-125.2.31657 * \see RFC4880 5.2.3 1658 1658 */ 1659 1659 static int parse_v4_signature(ops_region_t *region,ops_parse_info_t *pinfo)
