-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved functions and simplified some logic
- Loading branch information
Showing
6 changed files
with
178 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package monitor | ||
|
||
import ( | ||
"CTng/gossip" | ||
"fmt" | ||
"time" | ||
) | ||
|
||
//Need to discuss about this ****************************************************** | ||
func Process_valid_object(c *MonitorContext, g gossip.Gossip_object) { | ||
//if the valid object is from the logger in the monitor config logger URL list | ||
//This handles the STHS | ||
if IsLogger(c, g.Signer) && g.Type == gossip.STH { | ||
sig_frag, err := c.Config.Crypto.ThresholdSign(g.Payload[0]) | ||
if err != nil { | ||
fmt.Printf(err.Error()) | ||
} | ||
Send_to_gossiper(c, g) | ||
f := func() { | ||
pom_err := Check_entity_pom(c, g.Signer) | ||
//if there is no conflicting information/PoM send the Threshold signed version to the gossiper | ||
if pom_err == nil { | ||
g.Type = gossip.STH_FRAG | ||
g.Signature[0] = sig_frag.String() | ||
g.Signer = c.Config.Crypto.SelfID.String() | ||
Send_to_gossiper(c, g) | ||
} | ||
|
||
} | ||
time.AfterFunc(time.Duration(c.Config.Public.Gossip_wait_time), f) | ||
return | ||
} | ||
//if the object is from a CA, revocation information | ||
//this handles revocation information | ||
if IsAuthority(c, g.Signer) && g.Type == gossip.REVOCATION { | ||
sig_frag, err := c.Config.Crypto.ThresholdSign(g.Payload[0]) | ||
if err != nil { | ||
fmt.Printf(err.Error()) | ||
} | ||
Send_to_gossiper(c, g) | ||
f := func() { | ||
pom_err := Check_entity_pom(c, g.Signer) | ||
if pom_err == nil { | ||
g.Type = gossip.REVOCATION_FRAG | ||
g.Signature[0] = sig_frag.String() | ||
g.Signer = c.Config.Crypto.SelfID.String() | ||
Send_to_gossiper(c, g) | ||
} | ||
|
||
} | ||
time.AfterFunc(time.Duration(c.Config.Public.Gossip_wait_time), f) | ||
return | ||
} | ||
//if the object is from its own gossiper | ||
// Note didn't implement the directory separation here*************************************************************** | ||
if g.Type == gossip.ACCUSATION_POM || g.Type == gossip.GOSSIP_POM || g.Type == gossip.APPLICATION_POM || g.Type == gossip.REVOCATION_FULL || g.Type == gossip.STH_FULL { | ||
c.StoreObject(g) | ||
return | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters