Skip to content

Commit c12dacf

Browse files
committed
bug bixes
1 parent 1045d4a commit c12dacf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self):
2323
self.component_count = 2
2424
self.component_ids = ["0x" + secrets.token_hex(4) for _ in range(self.component_count)]
2525
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
2727
secrets.token_hex(4), # attestation location
2828
secrets.token_hex(8), # attestation cust
2929
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):
3535
self.name = name
3636
self.author = author
3737
self.run_id = run_id
38-
self.out_path = hash
38+
self.out_path = hash[:7]
3939
def to_json(self):
4040
return {
4141
"hash": self.hash,
@@ -54,7 +54,7 @@ def __init__(self, conn: socket.socket, info: CommitInfo, status: str, time: int
5454
def to_json(self):
5555
return {
5656
"result": self.status,
57-
"actionStart": round(self.time * 1000),
57+
"actionStart": round(self.time),
5858
"commit": self.info.to_json()
5959
}
6060

@@ -96,7 +96,7 @@ def upload(req: ActionResult, ip: str):
9696
sh = Shell()
9797
sh.output_conn = req.conn
9898
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}')
100100
except Exception:
101101
print("Failed to upload!")
102102
req.conn.send((colorama.Fore.RED + f"Failed to upload!" + colorama.Fore.RESET + "\n").encode())

subshell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self):
1818
def relay(self, msg):
1919
try:
2020
if self.output_conn is not None:
21-
self.output_conn.send(msg.encode())
21+
self.output_conn.send((msg + "\n").encode())
2222
except Exception:
2323
pass
2424
def read_stdout(self):

0 commit comments

Comments
 (0)