projects
/
cfe_generate_password.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ca32fa
)
remove trailing spaces
author
Tj
<hacker@iam.tj>
Wed, 7 Oct 2015 22:05:29 +0000
(23:05 +0100)
committer
Tj
<hacker@iam.tj>
Wed, 7 Oct 2015 22:05:29 +0000
(23:05 +0100)
cfe_generate_password.c
patch
|
blob
|
history
diff --git
a/cfe_generate_password.c
b/cfe_generate_password.c
index
47a4ba8
..
0fe8273
100644
(file)
--- a/
cfe_generate_password.c
+++ b/
cfe_generate_password.c
@@
-5,7
+5,7
@@
Licenced on the terms of the GNU General Public Licence version 3
To build:
Licenced on the terms of the GNU General Public Licence version 3
To build:
-
+
gcc -o cfe_gen_pass cfe_generate_password.c
Or:
gcc -o cfe_gen_pass cfe_generate_password.c
Or:
@@
-20,7
+20,7
@@
Broadcom Common Firmware Environment (CFE) bootbase which has a debug mode
that is enabled using the "ATEN 1 XXXXXXXX" command, where XXXXXXXX is an
eight digit hexadecimal 'password'.
Broadcom Common Firmware Environment (CFE) bootbase which has a debug mode
that is enabled using the "ATEN 1 XXXXXXXX" command, where XXXXXXXX is an
eight digit hexadecimal 'password'.
-
+
It is NOT necessary to have the device generate a 'seed' using "ATSE [MODEL-ID]"
because this tool can generate the seed from the device's first (base) MAC address
*provided* the "ATSE" command has NOT been executed since the device last booted.
It is NOT necessary to have the device generate a 'seed' using "ATSE [MODEL-ID]"
because this tool can generate the seed from the device's first (base) MAC address
*provided* the "ATSE" command has NOT been executed since the device last booted.
@@
-96,7
+96,7
@@
pr_error_exit(unsigned int usage, const char *error, ...)
if (usage) pr_usage();
if (usage) pr_usage();
- exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
static const unsigned int passwords[8] = {
}
static const unsigned int passwords[8] = {
@@
-120,7
+120,7
@@
generate_seed(char *mac, char *timestamp, char *seed)
size_t ts_len = strlen(timestamp);
for (i = 0; i <= SEED_SIZE; ++i) {
/* if no timestamp assume CFE get_time() returned 0 and CFE g_pw_timestamp == 0x00000000 */
size_t ts_len = strlen(timestamp);
for (i = 0; i <= SEED_SIZE; ++i) {
/* if no timestamp assume CFE get_time() returned 0 and CFE g_pw_timestamp == 0x00000000 */
- if (i < 6)
+ if (i < 6)
seed[i] = ts_len ? timestamp[i] : '0';
else {
if (*mac_ptr == ':' || *mac_ptr == '-')
seed[i] = ts_len ? timestamp[i] : '0';
else {
if (*mac_ptr == ':' || *mac_ptr == '-')
@@
-200,7
+200,7
@@
main(int argc, char **argv, char **env)
} else if (opt_pass == 1 && opt_seed == 0) {
if (arg_len != SEED_SIZE)
pr_error_exit(1, "seed length must be %d characters", SEED_SIZE);
} else if (opt_pass == 1 && opt_seed == 0) {
if (arg_len != SEED_SIZE)
pr_error_exit(1, "seed length must be %d characters", SEED_SIZE);
-
+
strncpy(seed, argv[arg], SEED_SIZE);
++opt_pass;
} else if (opt_ts == 1) {
strncpy(seed, argv[arg], SEED_SIZE);
++opt_pass;
} else if (opt_ts == 1) {