@@ -23,7 +23,7 @@ def __init__(self):
23
23
self .component_count = 2
24
24
self .component_ids = ["0x" + secrets .token_hex (4 ) for _ in range (self .component_count )]
25
25
self .boot_message_ap = f"boot_msg ap ({ secrets .token_hex (8 )} )"
26
- self .component_dat = [(f"boot_msg comp{ _ } ({ secrets .token_hex (8 )} " , # boot msg
26
+ self .component_dat = [(f"boot_msg comp{ _ } ({ secrets .token_hex (8 )} ) " , # boot msg
27
27
secrets .token_hex (4 ), # attestation location
28
28
secrets .token_hex (8 ), # attestation cust
29
29
f"{ random .randint (1 , 12 )} /{ random .randint (1 , 31 )} /{ random .randint (1950 , 2024 )} " ) # attestation date
@@ -35,7 +35,7 @@ def __init__(self, hash:str, author:str, name:str, run_id: str):
35
35
self .name = name
36
36
self .author = author
37
37
self .run_id = run_id
38
- self .out_path = hash
38
+ self .out_path = hash [: 7 ]
39
39
def to_json (self ):
40
40
return {
41
41
"hash" : self .hash ,
@@ -54,7 +54,7 @@ def __init__(self, conn: socket.socket, info: CommitInfo, status: str, time: int
54
54
def to_json (self ):
55
55
return {
56
56
"result" : self .status ,
57
- "actionStart" : round (self .time * 1000 ),
57
+ "actionStart" : round (self .time ),
58
58
"commit" : self .info .to_json ()
59
59
}
60
60
@@ -96,7 +96,7 @@ def upload(req: ActionResult, ip: str):
96
96
sh = Shell ()
97
97
sh .output_conn = req .conn
98
98
try :
99
- sh .run_cmd (f'rsync --rsh="ssh -o StrictHostKeyChecking=accept-new" -av --progress --rsync-path="rm -rf ~/CI/rpi/upload/{ req .info .out_path } ; mkdir -p ~/CI/rpi/upload/{ req .info .out_path } && rsync" 2024-ectf-secure-example/build/{ req .info .out_path } /*.img 2024-ectf-secure-example/build/ { req . info . out_path } / test_data { ip } :~/CI/rpi/upload/{ req .info .out_path } ' )
99
+ sh .run_cmd (f'rsync --rsh="ssh -o StrictHostKeyChecking=accept-new" -av --progress --rsync-path="rm -rf ~/CI/rpi/upload/{ req .info .out_path } ; mkdir -p ~/CI/rpi/upload/{ req .info .out_path } && rsync" 2024-ectf-secure-example/build/{ req .info .out_path } /{{ *.img, test_data}} { ip } :~/CI/rpi/upload/{ req .info .out_path } ' )
100
100
except Exception :
101
101
print ("Failed to upload!" )
102
102
req .conn .send ((colorama .Fore .RED + f"Failed to upload!" + colorama .Fore .RESET + "\n " ).encode ())
0 commit comments