summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-03-08 09:38:26 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-03-08 09:38:26 +0100
commite01e72695022ae50af68a47c4aef2c338eff8c8e (patch)
tree955ec8b273a7bd6cd92948d9949f28fa16c51b77
parentb19a3072bde93afa1ad04c684a38ad0a3177ab22 (diff)
downloadrsyslog-e01e72695022ae50af68a47c4aef2c338eff8c8e.tar.gz
rsyslog-e01e72695022ae50af68a47c4aef2c338eff8c8e.tar.bz2
rsyslog-e01e72695022ae50af68a47c4aef2c338eff8c8e.zip
logsig: update hash chain algorithm to match updated paper
-rw-r--r--runtime/librsgt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/librsgt.c b/runtime/librsgt.c
index b3e23628..16dc3995 100644
--- a/runtime/librsgt.c
+++ b/runtime/librsgt.c
@@ -515,7 +515,7 @@ sigblkAddRecord(gtctx ctx, const uchar *rec, const size_t len)
hash_m(ctx, &m);
hash_r(ctx, &r, rec, len);
- hash_node(ctx, &x, m, r, 0); /* hash leaf */
+ hash_node(ctx, &x, m, r, 1); /* hash leaf */
/* persists x here if Merkle tree needs to be persisted! */
/* add x to the forest as new leaf, update roots list */
t = x;
@@ -527,7 +527,7 @@ sigblkAddRecord(gtctx ctx, const uchar *rec, const size_t len)
t = NULL;
} else if(t != NULL) {
/* hash interim node */
- hash_node(ctx, &t, ctx->roots_hash[j], t, j+1);
+ hash_node(ctx, &t, ctx->roots_hash[j], t, j+2);
ctx->roots_valid[j] = 0;
}
}
@@ -601,7 +601,7 @@ sigblkFinish(gtctx ctx)
ctx->roots_valid[j] = 0; /* guess this is redundant with init, maybe del */
} else if(ctx->roots_valid[j]) {
rootDel = root;
- hash_node(ctx, &root, ctx->roots_hash[j], root, j+1);
+ hash_node(ctx, &root, ctx->roots_hash[j], root, j+2);
ctx->roots_valid[j] = 0; /* guess this is redundant with init, maybe del */
GTDataHash_free(rootDel);
}