Fossil SCM

experimentally added "PGP SIGNED" marker to PGP-signed commits in the timeline, per ML request.

stephan 2013-08-20 12:57 UTC trunk
Commit d632a50e2a06c76b5f3432c2c9920110088fb43d
1 file changed +12 -3
+12 -3
--- src/manifest.c
+++ src/manifest.c
@@ -60,10 +60,11 @@
6060
*/
6161
struct Manifest {
6262
Blob content; /* The original content blob */
6363
int type; /* Type of artifact. One of CFTYPE_xxxxx */
6464
int rid; /* The blob-id for this manifest */
65
+ int fSigned; /* True if the manifest was PGP-signed */
6566
char *zBaseline; /* Baseline manifest. The B card. */
6667
Manifest *pBaseline; /* The actual baseline manifest */
6768
char *zComment; /* Decoded comment. The C card. */
6869
double rDate; /* Date and time from D card. 0.0 if no D card. */
6970
char *zUser; /* Name of the user from the U card. */
@@ -356,10 +357,11 @@
356357
char *zUuid;
357358
int sz = 0;
358359
int isRepeat;
359360
static Bag seen;
360361
const char *zErr = 0;
362
+ int fSigned = 0;
361363
362364
if( rid==0 ){
363365
isRepeat = 1;
364366
}else if( bag_find(&seen, rid) ){
365367
isRepeat = 1;
@@ -381,11 +383,16 @@
381383
}
382384
383385
/* Strip off the PGP signature if there is one. Then verify the
384386
** Z-card.
385387
*/
386
- remove_pgp_signature(&z, &n);
388
+ {
389
+ int const oldLen = n;
390
+ remove_pgp_signature(&z, &n);
391
+ fSigned = n<oldLen;
392
+ }
393
+
387394
if( verify_z_card(z, n)==2 ){
388395
blob_reset(pContent);
389396
blob_appendf(pErr, "incorrect Z-card cksum");
390397
return 0;
391398
}
@@ -405,10 +412,11 @@
405412
memset(p, 0, sizeof(*p));
406413
memcpy(&p->content, pContent, sizeof(p->content));
407414
p->rid = rid;
408415
blob_zero(pContent);
409416
pContent = &p->content;
417
+ p->fSigned = fSigned;
410418
411419
/* Begin parsing, card by card.
412420
*/
413421
x.z = z;
414422
x.zEnd = &z[n];
@@ -1701,16 +1709,17 @@
17011709
"VALUES('ci',"
17021710
" coalesce("
17031711
" (SELECT julianday(value) FROM tagxref WHERE tagid=%d AND rid=%d),"
17041712
" %.17g"
17051713
" ),"
1706
- " %d,%Q,%Q,"
1714
+ " %d,%Q,%Q || %Q,"
17071715
" (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0),"
17081716
" (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),"
17091717
" (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g);",
17101718
TAG_DATE, rid, p->rDate,
1711
- rid, p->zUser, p->zComment,
1719
+ rid, p->zUser, p->zComment,
1720
+ p->fSigned ? " (*PGP SIGNED*)" : "",
17121721
TAG_BGCOLOR, rid,
17131722
TAG_USER, rid,
17141723
TAG_COMMENT, rid, p->rDate
17151724
);
17161725
zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event"
17171726
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button