-/* Used for binary document signatures (to be compatible with older software)
- * DSA/SHA-1 is always 65 bytes */
-struct signature_packet_v3_t
-{
- uint8_t header[2];
- uint8_t version; /* 3 */
- uint8_t hashed_data_len; /* MUST be 5 */
- uint8_t type;
- uint8_t timestamp[4]; /* 4 bytes scalar number */
- uint8_t issuer_longid[8]; /* The key which signed the document */
- uint8_t public_key_algo; /* we only know about DSA */
- uint8_t digest_algo; /* and his little sister SHA-1 */
- uint8_t hash_verification[2];/* the 2 1st bytes of the SHA-1 hash */
+ uint8_t hash_verification[2];
+ uint8_t issuer_longid[8];
+
+ union /* version specific data */
+ {
+ struct
+ {
+ uint8_t hashed_data_len[2]; /* scalar number */
+ uint8_t *hashed_data; /* hashed_data_len bytes */
+ uint8_t unhashed_data_len[2]; /* scalar number */
+ uint8_t *unhashed_data; /* unhashed_data_len bytes */
+ } v4;
+ struct
+ {
+ uint8_t hashed_data_len; /* MUST be 5 */
+ uint8_t timestamp[4]; /* 4 bytes scalar number */
+ } v3;
+ } specific;