Skip to content

Commit 33581f7

Browse files
maryruthvenchrome-bot
authored andcommitted
cr50_rma_open: add support for new challenge format
We started printing the challenge as generated challenge: ABHNDKD4Q7P6KHTKPN9E7...full challenge instead of ABHND KD4Q7 P6KHT KPN9E 7FSQX P249S PCP64 LVA8S W4XCH 7PZX6 FVWN5 QTUSK U3KBJ HH7RQ SEE5T JX78X add support for extracting the challenge from both formats. BUG=none BRANCH=none TEST=try to open tot image, 0.4.7 image, and 0.3.4 image Change-Id: I99a81f1f78284b21777242d27edaa474a0f12367 Signed-off-by: Mary Ruthven <mruthven@google.com> Reviewed-on: https://chromium-review.googlesource.com/1088130 Commit-Ready: Mary Ruthven <mruthven@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
1 parent ac4246b commit 33581f7

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

extra/cr50_rma_open/cr50_rma_open.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import sys
1414
import time
1515

16-
SCRIPT_VERSION = 2
16+
SCRIPT_VERSION = 3
1717
CCD_IS_UNRESTRICTED = 1 << 0
1818
WP_IS_DISABLED = 1 << 1
1919
TESTLAB_IS_ENABLED = 1 << 2
@@ -243,12 +243,30 @@ def device_is_running_with_servo_ccd(self):
243243
def get_rma_challenge(self):
244244
"""Get the rma_auth challenge
245245
246+
There are two challenge formats
247+
248+
"
249+
ABEQ8 UGA4F AVEQP SHCKV
250+
DGGPR N8JHG V8PNC LCHR2
251+
T27VF PRGBS N3ZXF RCCT2
252+
UBMKP ACM7E WUZUA A4GTN
253+
"
254+
and
255+
"
256+
generated challenge:
257+
258+
CBYRYBEMH2Y75TC...rest of challenge
259+
"
260+
support extracting the challenge from both.
261+
246262
Returns:
247263
The RMA challenge with all whitespace removed.
248264
"""
249265
output = self.send_cmd_get_output('rma_auth').strip()
250266
print 'rma_auth output:\n', output
251267
# Extract the challenge from the console output
268+
if 'generated challenge:' in output:
269+
return output.split('generated challenge:')[-1].strip()
252270
challenge = ''.join(re.findall(' \S{5}' * 4, output))
253271
# Remove all whitespace
254272
return re.sub('\s', '', challenge)

0 commit comments

Comments
 (0)