i'm trying to build a custom firmware with the SDK for a RUT950, i can't get my head around this error tho, seems like something is breaking when it tries to build the RSA keygen
This is the error, i'm currently trying to figure out if there is a rsa package that helps solving the problem.
the machine is Ubuntu 18.04 LTS, node version is 12.22.12 and npm is 6.14.16
Building rsa_pkey_tool utility...
rsa_pkey_tool.c: In function 'int write_bignum_to_header(FILE*, const char*, BIGNUM*, int)':
rsa_pkey_tool.c:87:2: error: 'uint32_t' was not declared in this scope
uint32_t *buf, *ptr;
^~~~~~~~
rsa_pkey_tool.c:87:2: note: suggested alternative: 'u_int32_t'
uint32_t *buf, *ptr;
^~~~~~~~
u_int32_t
rsa_pkey_tool.c:87:12: error: 'buf' was not declared in this scope
uint32_t *buf, *ptr;
^~~
rsa_pkey_tool.c:87:18: error: 'ptr' was not declared in this scope
uint32_t *buf, *ptr;
^~~
rsa_pkey_tool.c:120:19: error: expected primary-expression before ')' token
buf = (uint32_t *)malloc(size);
^
rsa_pkey_tool.c: At global scope:
rsa_pkey_tool.c:176:39: error: 'uint64_t' has not been declared
static int rsa_get_exponent(RSA *key, uint64_t *e)
^~~~~~~~
rsa_pkey_tool.c: In function 'int rsa_get_exponent(RSA*, int*)':
rsa_pkey_tool.c:181:2: error: 'uint64_t' was not declared in this scope
uint64_t te;
^~~~~~~~
rsa_pkey_tool.c:181:2: note: suggested alternative: 'u_int64_t'
uint64_t te;
^~~~~~~~
u_int64_t
rsa_pkey_tool.c:189:2: error: 'RSA_get0_key' was not declared in this scope
RSA_get0_key(key, NULL, &key_e, NULL);
^~~~~~~~~~~~
rsa_pkey_tool.c:189:2: note: suggested alternative: 'RSA_check_key'
RSA_get0_key(key, NULL, &key_e, NULL);
^~~~~~~~~~~~
RSA_check_key
rsa_pkey_tool.c:210:2: error: 'te' was not declared in this scope
te = BN_get_word(bn_te);
^~
rsa_pkey_tool.c:210:2: note: suggested alternative: 'e'
te = BN_get_word(bn_te);
^~
e
rsa_pkey_tool.c: At global scope:
rsa_pkey_tool.c:226:37: error: 'uint64_t' has not been declared
static int rsa_get_params(RSA *key, uint64_t *exponent, uint32_t *n0_invp,
^~~~~~~~
rsa_pkey_tool.c:226:57: error: 'uint32_t' has not been declared
static int rsa_get_params(RSA *key, uint64_t *exponent, uint32_t *n0_invp,
^~~~~~~~
rsa_pkey_tool.c: In function 'int rsa_get_params(RSA*, int*, int*, BIGNUM**, BIGNUM**)':
rsa_pkey_tool.c:253:2: error: 'RSA_get0_key' was not declared in this scope
RSA_get0_key(key, &key_n, NULL, NULL);
^~~~~~~~~~~~
rsa_pkey_tool.c:253:2: note: suggested alternative: 'RSA_check_key'
RSA_get0_key(key, &key_n, NULL, NULL);
^~~~~~~~~~~~
RSA_check_key
rsa_pkey_tool.c: In function 'int main(int, char**)':
rsa_pkey_tool.c:302:2: error: 'uint64_t' was not declared in this scope
uint64_t exponent;
^~~~~~~~
rsa_pkey_tool.c:302:2: note: suggested alternative: 'u_int64_t'
uint64_t exponent;
^~~~~~~~
u_int64_t
rsa_pkey_tool.c:303:2: error: 'uint32_t' was not declared in this scope
uint32_t n0_inv;
^~~~~~~~
rsa_pkey_tool.c:303:2: note: suggested alternative: 'u_int32_t'
uint32_t n0_inv;
^~~~~~~~
u_int32_t
rsa_pkey_tool.c:310:11: error: expected ';' before 'n0_inv_tmp'
uint32_t n0_inv_tmp;
^~~~~~~~~~
rsa_pkey_tool.c:340:26: error: 'exponent' was not declared in this scope
if(rsa_get_params(rsa, &exponent, &n0_inv_tmp,
^~~~~~~~
rsa_pkey_tool.c:340:26: note: suggested alternative: 'popen'
if(rsa_get_params(rsa, &exponent, &n0_inv_tmp,
^~~~~~~~
popen
rsa_pkey_tool.c:340:37: error: 'n0_inv_tmp' was not declared in this scope
if(rsa_get_params(rsa, &exponent, &n0_inv_tmp,
^~~~~~~~~~
rsa_pkey_tool.c:340:37: note: suggested alternative: 'nlink_t'
if(rsa_get_params(rsa, &exponent, &n0_inv_tmp,
^~~~~~~~~~
nlink_t
rsa_pkey_tool.c:369:2: error: 'n0_inv' was not declared in this scope
n0_inv = cpu_to_le32(n0_inv_tmp);
^~~~~~
rsa_pkey_tool.c:369:2: note: suggested alternative: 'u_int'
n0_inv = cpu_to_le32(n0_inv_tmp);
^~~~~~
u_int
rsa_pkey_tool.c:369:23: error: 'n0_inv_tmp' was not declared in this scope
n0_inv = cpu_to_le32(n0_inv_tmp);
^
rsa_pkey_tool.c:43:27: note: in definition of macro 'cpu_to_le32'
# define cpu_to_le32(x) (x)
^
rsa_pkey_tool.c:369:23: note: suggested alternative: 'nlink_t'
n0_inv = cpu_to_le32(n0_inv_tmp);
^
rsa_pkey_tool.c:43:27: note: in definition of macro 'cpu_to_le32'
# define cpu_to_le32(x) (x)
^
rsa_pkey_tool.c: At global scope:
rsa_pkey_tool.c:226:12: warning: 'int rsa_get_params(RSA*, int*, int*, BIGNUM**, BIGNUM**)' defined but not used [-Wunused-function]
static int rsa_get_params(RSA *key, uint64_t *exponent, uint32_t *n0_invp,
^~~~~~~~~~~~~~
Makefile:17: recipe for target 'rsa_pkey_tool.o' failed
make[2]: *** [rsa_pkey_tool.o] Error 1
Makefile:366: recipe for target 'rsa_pkey_tool_host' failed
make[1]: *** [rsa_pkey_tool_host] Error 2
Makefile:348: recipe for target 'tlt-rut9xx-vboot-64k' failed
make: *** [tlt-rut9xx-vboot-64k] Error 2
make: Leaving directory '/home/vboxuser/Desktop/RUTX_R/rutos-ath79-rut9-gpl/build_dir/target-mips_74kc_musl/uboot-ath79-4.3.0'
Makefile:41: recipe for target '/home/vboxuser/Desktop/RUTX_R/rutos-ath79-rut9-gpl/build_dir/target-mips_74kc_musl/uboot-ath79-4.3.0/.built' failed
make[3]: *** [/home/vboxuser/Desktop/RUTX_R/rutos-ath79-rut9-gpl/build_dir/target-mips_74kc_musl/uboot-ath79-4.3.0/.built] Error 2
make[3]: Leaving directory '/home/vboxuser/Desktop/RUTX_R/rutos-ath79-rut9-gpl/package/boot/uboot-ath79'
time: package/boot/uboot-ath79/compile#8.12#2.81#10.83
ERROR: package/boot/uboot-ath79 failed to build.
package/Makefile:112: recipe for target 'package/boot/uboot-ath79/compile' failed
make[2]: *** [package/boot/uboot-ath79/compile] Error 1
make[2]: Leaving directory '/home/vboxuser/Desktop/RUTX_R/rutos-ath79-rut9-gpl'
package/Makefile:108: recipe for target '/home/vboxuser/Desktop/RUTX_R/rutos-ath79-rut9-gpl/staging_dir/target-mips_74kc_musl/stamp/.package_compile' failed
make[1]: *** [/home/vboxuser/Desktop/RUTX_R/rutos-ath79-rut9-gpl/staging_dir/target-mips_74kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/vboxuser/Desktop/RUTX_R/rutos-ath79-rut9-gpl'
/home/vboxuser/Desktop/RUTX_R/rutos-ath79-rut9-gpl/include/toplevel.mk:236: recipe for target 'world' failed
make: *** [world] Error 2
Thanks