Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 32892e0

Browse files
committed
Rename verify_challenge to challenge_verify
Prefixing the box functions with the box name makes logical sense.
1 parent cd40c49 commit 32892e0

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

source/box-challenge.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static inline bool buffer_overlaps_box_context(const void *buffer, size_t length
7373
ctx_addr + ctx_length > buffer_addr);
7474
}
7575

76-
UVISOR_EXTERN bool __verify_secret(const uint8_t *secret, int len)
76+
UVISOR_EXTERN bool __challenge_verify(const uint8_t *secret, int len)
7777
{
7878
/* We only accept calls where 'len' equals CHALLENGE_SIZE.
7979
* Although this creates a timing side channel which exposes the
@@ -107,9 +107,10 @@ UVISOR_EXTERN bool __verify_secret(const uint8_t *secret, int len)
107107
return secure_compare(secret, uvisor_ctx->secret, len);
108108
}
109109

110-
bool verify_secret(const uint8_t *secret, int len)
110+
bool challenge_verify(const uint8_t *secret, int len)
111111
{
112-
/* A security transition happens here. This ensures that __verify_secret()
113-
* will run with the privileges of the box_challenge box. */
114-
return secure_gateway(box_challenge, __verify_secret, secret, len);
112+
/* A security transition happens here. This ensures that
113+
* __challenge_verify() will run with the privileges of the box_challenge
114+
* box. */
115+
return secure_gateway(box_challenge, __challenge_verify, secret, len);
115116
}

source/box-challenge.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013-2015, ARM Limited, All Rights Reserved
2+
* Copyright (c) 2013-2016, ARM Limited, All Rights Reserved
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -19,7 +19,7 @@
1919

2020
#define CHALLENGE_SIZE 16
2121

22-
extern bool verify_secret(const uint8_t *secret, int len);
22+
extern bool challenge_verify(const uint8_t *secret, int len);
2323
extern void *g_box_context;
2424

2525
#endif/*__UVISOR_HELLOWORLD_BOX_CHALLENGE_H__*/

source/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void retry_secret(void)
4747
{
4848
/* Check the secret. */
4949
pc.printf("verifying secret...");
50-
bool verified = verify_secret(g_challenge, sizeof(g_challenge));
50+
bool verified = challenge_verify(g_challenge, sizeof(g_challenge));
5151
pc.printf(" done\n\r");
5252

5353
/* Cancel the previous event for LED blinking. */

0 commit comments

Comments
 (0)