Fossil SCM
experimentally added "PGP SIGNED" marker to PGP-signed commits in the timeline, per ML request.
Commit
d632a50e2a06c76b5f3432c2c9920110088fb43d
Parent
13161f39aa105b9…
1 file changed
+12
-3
+12
-3
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -60,10 +60,11 @@ | ||
| 60 | 60 | */ |
| 61 | 61 | struct Manifest { |
| 62 | 62 | Blob content; /* The original content blob */ |
| 63 | 63 | int type; /* Type of artifact. One of CFTYPE_xxxxx */ |
| 64 | 64 | int rid; /* The blob-id for this manifest */ |
| 65 | + int fSigned; /* True if the manifest was PGP-signed */ | |
| 65 | 66 | char *zBaseline; /* Baseline manifest. The B card. */ |
| 66 | 67 | Manifest *pBaseline; /* The actual baseline manifest */ |
| 67 | 68 | char *zComment; /* Decoded comment. The C card. */ |
| 68 | 69 | double rDate; /* Date and time from D card. 0.0 if no D card. */ |
| 69 | 70 | char *zUser; /* Name of the user from the U card. */ |
| @@ -356,10 +357,11 @@ | ||
| 356 | 357 | char *zUuid; |
| 357 | 358 | int sz = 0; |
| 358 | 359 | int isRepeat; |
| 359 | 360 | static Bag seen; |
| 360 | 361 | const char *zErr = 0; |
| 362 | + int fSigned = 0; | |
| 361 | 363 | |
| 362 | 364 | if( rid==0 ){ |
| 363 | 365 | isRepeat = 1; |
| 364 | 366 | }else if( bag_find(&seen, rid) ){ |
| 365 | 367 | isRepeat = 1; |
| @@ -381,11 +383,16 @@ | ||
| 381 | 383 | } |
| 382 | 384 | |
| 383 | 385 | /* Strip off the PGP signature if there is one. Then verify the |
| 384 | 386 | ** Z-card. |
| 385 | 387 | */ |
| 386 | - remove_pgp_signature(&z, &n); | |
| 388 | + { | |
| 389 | + int const oldLen = n; | |
| 390 | + remove_pgp_signature(&z, &n); | |
| 391 | + fSigned = n<oldLen; | |
| 392 | + } | |
| 393 | + | |
| 387 | 394 | if( verify_z_card(z, n)==2 ){ |
| 388 | 395 | blob_reset(pContent); |
| 389 | 396 | blob_appendf(pErr, "incorrect Z-card cksum"); |
| 390 | 397 | return 0; |
| 391 | 398 | } |
| @@ -405,10 +412,11 @@ | ||
| 405 | 412 | memset(p, 0, sizeof(*p)); |
| 406 | 413 | memcpy(&p->content, pContent, sizeof(p->content)); |
| 407 | 414 | p->rid = rid; |
| 408 | 415 | blob_zero(pContent); |
| 409 | 416 | pContent = &p->content; |
| 417 | + p->fSigned = fSigned; | |
| 410 | 418 | |
| 411 | 419 | /* Begin parsing, card by card. |
| 412 | 420 | */ |
| 413 | 421 | x.z = z; |
| 414 | 422 | x.zEnd = &z[n]; |
| @@ -1701,16 +1709,17 @@ | ||
| 1701 | 1709 | "VALUES('ci'," |
| 1702 | 1710 | " coalesce(" |
| 1703 | 1711 | " (SELECT julianday(value) FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1704 | 1712 | " %.17g" |
| 1705 | 1713 | " )," |
| 1706 | - " %d,%Q,%Q," | |
| 1714 | + " %d,%Q,%Q || %Q," | |
| 1707 | 1715 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," |
| 1708 | 1716 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1709 | 1717 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g);", |
| 1710 | 1718 | TAG_DATE, rid, p->rDate, |
| 1711 | - rid, p->zUser, p->zComment, | |
| 1719 | + rid, p->zUser, p->zComment, | |
| 1720 | + p->fSigned ? " (*PGP SIGNED*)" : "", | |
| 1712 | 1721 | TAG_BGCOLOR, rid, |
| 1713 | 1722 | TAG_USER, rid, |
| 1714 | 1723 | TAG_COMMENT, rid, p->rDate |
| 1715 | 1724 | ); |
| 1716 | 1725 | zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event" |
| 1717 | 1726 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -60,10 +60,11 @@ | |
| 60 | */ |
| 61 | struct Manifest { |
| 62 | Blob content; /* The original content blob */ |
| 63 | int type; /* Type of artifact. One of CFTYPE_xxxxx */ |
| 64 | int rid; /* The blob-id for this manifest */ |
| 65 | char *zBaseline; /* Baseline manifest. The B card. */ |
| 66 | Manifest *pBaseline; /* The actual baseline manifest */ |
| 67 | char *zComment; /* Decoded comment. The C card. */ |
| 68 | double rDate; /* Date and time from D card. 0.0 if no D card. */ |
| 69 | char *zUser; /* Name of the user from the U card. */ |
| @@ -356,10 +357,11 @@ | |
| 356 | char *zUuid; |
| 357 | int sz = 0; |
| 358 | int isRepeat; |
| 359 | static Bag seen; |
| 360 | const char *zErr = 0; |
| 361 | |
| 362 | if( rid==0 ){ |
| 363 | isRepeat = 1; |
| 364 | }else if( bag_find(&seen, rid) ){ |
| 365 | isRepeat = 1; |
| @@ -381,11 +383,16 @@ | |
| 381 | } |
| 382 | |
| 383 | /* Strip off the PGP signature if there is one. Then verify the |
| 384 | ** Z-card. |
| 385 | */ |
| 386 | remove_pgp_signature(&z, &n); |
| 387 | if( verify_z_card(z, n)==2 ){ |
| 388 | blob_reset(pContent); |
| 389 | blob_appendf(pErr, "incorrect Z-card cksum"); |
| 390 | return 0; |
| 391 | } |
| @@ -405,10 +412,11 @@ | |
| 405 | memset(p, 0, sizeof(*p)); |
| 406 | memcpy(&p->content, pContent, sizeof(p->content)); |
| 407 | p->rid = rid; |
| 408 | blob_zero(pContent); |
| 409 | pContent = &p->content; |
| 410 | |
| 411 | /* Begin parsing, card by card. |
| 412 | */ |
| 413 | x.z = z; |
| 414 | x.zEnd = &z[n]; |
| @@ -1701,16 +1709,17 @@ | |
| 1701 | "VALUES('ci'," |
| 1702 | " coalesce(" |
| 1703 | " (SELECT julianday(value) FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1704 | " %.17g" |
| 1705 | " )," |
| 1706 | " %d,%Q,%Q," |
| 1707 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," |
| 1708 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1709 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g);", |
| 1710 | TAG_DATE, rid, p->rDate, |
| 1711 | rid, p->zUser, p->zComment, |
| 1712 | TAG_BGCOLOR, rid, |
| 1713 | TAG_USER, rid, |
| 1714 | TAG_COMMENT, rid, p->rDate |
| 1715 | ); |
| 1716 | zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event" |
| 1717 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -60,10 +60,11 @@ | |
| 60 | */ |
| 61 | struct Manifest { |
| 62 | Blob content; /* The original content blob */ |
| 63 | int type; /* Type of artifact. One of CFTYPE_xxxxx */ |
| 64 | int rid; /* The blob-id for this manifest */ |
| 65 | int fSigned; /* True if the manifest was PGP-signed */ |
| 66 | char *zBaseline; /* Baseline manifest. The B card. */ |
| 67 | Manifest *pBaseline; /* The actual baseline manifest */ |
| 68 | char *zComment; /* Decoded comment. The C card. */ |
| 69 | double rDate; /* Date and time from D card. 0.0 if no D card. */ |
| 70 | char *zUser; /* Name of the user from the U card. */ |
| @@ -356,10 +357,11 @@ | |
| 357 | char *zUuid; |
| 358 | int sz = 0; |
| 359 | int isRepeat; |
| 360 | static Bag seen; |
| 361 | const char *zErr = 0; |
| 362 | int fSigned = 0; |
| 363 | |
| 364 | if( rid==0 ){ |
| 365 | isRepeat = 1; |
| 366 | }else if( bag_find(&seen, rid) ){ |
| 367 | isRepeat = 1; |
| @@ -381,11 +383,16 @@ | |
| 383 | } |
| 384 | |
| 385 | /* Strip off the PGP signature if there is one. Then verify the |
| 386 | ** Z-card. |
| 387 | */ |
| 388 | { |
| 389 | int const oldLen = n; |
| 390 | remove_pgp_signature(&z, &n); |
| 391 | fSigned = n<oldLen; |
| 392 | } |
| 393 | |
| 394 | if( verify_z_card(z, n)==2 ){ |
| 395 | blob_reset(pContent); |
| 396 | blob_appendf(pErr, "incorrect Z-card cksum"); |
| 397 | return 0; |
| 398 | } |
| @@ -405,10 +412,11 @@ | |
| 412 | memset(p, 0, sizeof(*p)); |
| 413 | memcpy(&p->content, pContent, sizeof(p->content)); |
| 414 | p->rid = rid; |
| 415 | blob_zero(pContent); |
| 416 | pContent = &p->content; |
| 417 | p->fSigned = fSigned; |
| 418 | |
| 419 | /* Begin parsing, card by card. |
| 420 | */ |
| 421 | x.z = z; |
| 422 | x.zEnd = &z[n]; |
| @@ -1701,16 +1709,17 @@ | |
| 1709 | "VALUES('ci'," |
| 1710 | " coalesce(" |
| 1711 | " (SELECT julianday(value) FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1712 | " %.17g" |
| 1713 | " )," |
| 1714 | " %d,%Q,%Q || %Q," |
| 1715 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," |
| 1716 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1717 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g);", |
| 1718 | TAG_DATE, rid, p->rDate, |
| 1719 | rid, p->zUser, p->zComment, |
| 1720 | p->fSigned ? " (*PGP SIGNED*)" : "", |
| 1721 | TAG_BGCOLOR, rid, |
| 1722 | TAG_USER, rid, |
| 1723 | TAG_COMMENT, rid, p->rDate |
| 1724 | ); |
| 1725 | zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event" |
| 1726 |