diff --git a/.cargo-ok b/.cargo-ok deleted file mode 100644 index e69de29b..00000000 diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index d3324cc0..45906a67 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -9,10 +9,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Tests - env: - LOADSTONE_CONFIG: "" - run: cargo test + - name: Loadstone tests + run: ./x.py test /dev/null + - name: Tool tests + run: cd tools && cargo test clippy: runs-on: ubuntu-latest @@ -40,20 +40,16 @@ jobs: - name: Check sample stm32f4 build with external flash env: SCRIPT_MODE: true - LOADSTONE_CONFIG: "(port:Stm32F412,memory_configuration:(internal_memory_map:(bootloader_location:134217728,bootloader_length_kb:64,banks:[(start_address:134283264,size_kb:16,),(start_address:134299648,size_kb:850,),],bootable_index:Some(0),),external_memory_map:(banks:[(start_address:0,size_kb:7500,),],),external_flash:Some((name:\"Micronn25q128a\",internal:false,start:0,end:16777215,region_size:4096,)),golden_index:Some(2),),feature_configuration:(serial:Enabled(recovery_enabled:true,tx_pin:(peripheral:\"USART1\",bank:\"a\",index:15,af_index:6,),rx_pin:(peripheral:\"USART1\",bank:\"b\",index:3,af_index:7,),),boot_metrics:Enabled(timing:true,),update_signal: Disabled,greetings: Default,),security_configuration:(security_mode:Crc,verifying_key_raw:\"\",),)" - run: cargo check --features 'stm32f412' --target thumbv7em-none-eabihf + run: ./x.py check .github/workflows/examples/stm32f4_external.ron stm32f412 - name: Check sample stm32f4 build without external flash env: SCRIPT_MODE: true - LOADSTONE_CONFIG: "(port:Stm32F412,memory_configuration:(internal_memory_map:(bootloader_location:134217728,bootloader_length_kb:64,banks:[(start_address:134283264,size_kb:16,),(start_address:134299648,size_kb:850,),(start_address:135170048,size_kb:16,),],bootable_index:Some(0),),external_memory_map:(banks:[],),external_flash:None,golden_index:Some(2),),feature_configuration:(serial:Disabled,boot_metrics:Enabled(timing:true,),update_signal: Enabled,greetings: Custom( loadstone: \"hi\", demo: \"hello\",),),security_configuration:(security_mode:Crc,verifying_key_raw:\"\",),)" - run: cargo check --features 'stm32f412' --target thumbv7em-none-eabihf + run: ./x.py check .github/workflows/examples/stm32f4.ron stm32f412 - name: Check sample wgm160p build env: SCRIPT_MODE: true - LOADSTONE_CONFIG: "(port:Wgm160P,memory_configuration:(internal_memory_map:(bootloader_location:0,bootloader_length_kb:1,banks:[(start_address:4096,size_kb:4,),],bootable_index:Some(0),),external_memory_map:(banks:[],),external_flash:None,golden_index:Some(3),),feature_configuration:(serial:Disabled,boot_metrics:Enabled(timing:false,),update_signal: Enabled,greetings: Default,),security_configuration:(security_mode:Crc,verifying_key_raw:\"\",),)" - run: cargo check --features 'wgm160p' --target thumbv7em-none-eabihf + run: ./x.py check .github/workflows/examples/wgm160p.ron wgm160p - name: Check sample stm32f4 build with encryption env: SCRIPT_MODE: true - LOADSTONE_CONFIG: "(port:Stm32F412,memory_configuration:(internal_memory_map:(bootloader_location:134217728,bootloader_length_kb:64,banks:[(start_address:134283264,size_kb:16,),],bootable_index:Some(0),),external_memory_map:(banks:[],),external_flash:None,golden_index:None,),feature_configuration:(serial:Enabled(recovery_enabled:false,tx_pin:(peripheral:\"USART1\",bank:\"a\",index:9,af_index:7,),rx_pin:(peripheral:\"USART1\",bank:\"b\",index:3,af_index:7,),),boot_metrics:Disabled,update_signal: Disabled,greetings: Default,),security_configuration:(security_mode:P256ECDSA,verifying_key_raw:\"-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPdEmj0oKViN8nvnri0I6JZsy7PQp\nv7TUuHT5jFnFsx4xxOmA+MyGXk/fsZHnKiUfWb4smzrWxJCKKwI2vHBw8A==\n-----END PUBLIC KEY-----\n\",),)" - run: cargo check --features 'stm32f412,ecdsa-verify' --target thumbv7em-none-eabihf + run: ./x.py check .github/workflows/examples/stm32f4_encrypted.ron stm32f412 ecdsa-verify diff --git a/.github/workflows/examples/.gitignore b/.github/workflows/examples/.gitignore new file mode 100644 index 00000000..4b8c3e3f --- /dev/null +++ b/.github/workflows/examples/.gitignore @@ -0,0 +1,2 @@ +# Allow tracking of .ron files. +!*.ron diff --git a/.github/workflows/examples/stm32f4.ron b/.github/workflows/examples/stm32f4.ron new file mode 100644 index 00000000..eff47b15 --- /dev/null +++ b/.github/workflows/examples/stm32f4.ron @@ -0,0 +1 @@ +(port:Stm32F412,memory_configuration:(internal_memory_map:(bootloader_location:134217728,bootloader_length_kb:64,banks:[(start_address:134283264,size_kb:16,),(start_address:134299648,size_kb:850,),(start_address:135170048,size_kb:16,),],bootable_index:Some(0),),external_memory_map:(banks:[],),external_flash:None,golden_index:Some(2),),feature_configuration:(serial:Disabled,boot_metrics:Enabled(timing:true,),update_signal: Enabled,greetings: Custom( loadstone: "hi", demo: "hello",),),security_configuration:(security_mode:Crc,verifying_key_raw:"",),) diff --git a/.github/workflows/examples/stm32f4_encrypted.ron b/.github/workflows/examples/stm32f4_encrypted.ron new file mode 100644 index 00000000..f29d9315 --- /dev/null +++ b/.github/workflows/examples/stm32f4_encrypted.ron @@ -0,0 +1,5 @@ +(port:Stm32F412,memory_configuration:(internal_memory_map:(bootloader_location:134217728,bootloader_length_kb:64,banks:[(start_address:134283264,size_kb:16,),],bootable_index:Some(0),),external_memory_map:(banks:[],),external_flash:None,golden_index:None,),feature_configuration:(serial:Enabled(recovery_enabled:false,tx_pin:(peripheral:"USART1",bank:"a",index:9,af_index:7,),rx_pin:(peripheral:"USART1",bank:"b",index:3,af_index:7,),),boot_metrics:Disabled,update_signal: Disabled,greetings: Default,),security_configuration:(security_mode:P256ECDSA,verifying_key_raw:"-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPdEmj0oKViN8nvnri0I6JZsy7PQp +v7TUuHT5jFnFsx4xxOmA+MyGXk/fsZHnKiUfWb4smzrWxJCKKwI2vHBw8A== +-----END PUBLIC KEY----- +",),) diff --git a/.github/workflows/examples/stm32f4_external.ron b/.github/workflows/examples/stm32f4_external.ron new file mode 100644 index 00000000..585dc937 --- /dev/null +++ b/.github/workflows/examples/stm32f4_external.ron @@ -0,0 +1 @@ +(port:Stm32F412,memory_configuration:(internal_memory_map:(bootloader_location:134217728,bootloader_length_kb:64,banks:[(start_address:134283264,size_kb:16,),(start_address:134299648,size_kb:850,),],bootable_index:Some(0),),external_memory_map:(banks:[(start_address:0,size_kb:7500,),],),external_flash:Some((name:"Micronn25q128a",internal:false,start:0,end:16777215,region_size:4096,)),golden_index:Some(2),),feature_configuration:(serial:Enabled(recovery_enabled:true,tx_pin:(peripheral:"USART1",bank:"a",index:15,af_index:6,),rx_pin:(peripheral:"USART1",bank:"b",index:3,af_index:7,),),boot_metrics:Enabled(timing:true,),update_signal: Disabled,greetings: Default,),security_configuration:(security_mode:Crc,verifying_key_raw:"",),) diff --git a/.github/workflows/examples/wgm160p.ron b/.github/workflows/examples/wgm160p.ron new file mode 100644 index 00000000..ca855aec --- /dev/null +++ b/.github/workflows/examples/wgm160p.ron @@ -0,0 +1 @@ +(port:Wgm160P,memory_configuration:(internal_memory_map:(bootloader_location:0,bootloader_length_kb:1,banks:[(start_address:4096,size_kb:4,),],bootable_index:Some(0),),external_memory_map:(banks:[],),external_flash:None,golden_index:Some(3),),feature_configuration:(serial:Disabled,boot_metrics:Enabled(timing:false,),update_signal: Enabled,greetings: Default,),security_configuration:(security_mode:Crc,verifying_key_raw:"",),) diff --git a/.rustfmt.toml b/.rustfmt.toml deleted file mode 100644 index 8d626dfd..00000000 --- a/.rustfmt.toml +++ /dev/null @@ -1,6 +0,0 @@ -imports_granularity="Crate" -fn_single_line = true -overflow_delimited_expr = true -use_field_init_shorthand = true -use_small_heuristics = "Max" -reorder_modules = false diff --git a/Cargo.lock b/Cargo.lock index ef6e3656..aeafb40f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,15 +23,15 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5069e21ec61f3b243a4a4c56d920d3206e6ee86022a67c23e9fe36eb60fc1efd" dependencies = [ - "cortex-m 0.7.4", + "cortex-m 0.7.6", "linked_list_allocator", ] [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "a26fa4d7e3f2eebadf743988fc8aec9fa9a9e82611acafd77c1462ed6262440a" [[package]] name = "as-slice" @@ -41,7 +41,7 @@ checksum = "45403b49e3954a4b8428a0ac21a4b7afadccf92bfd96273f1a58cd4812496ae0" dependencies = [ "generic-array 0.12.4", "generic-array 0.13.3", - "generic-array 0.14.5", + "generic-array 0.14.6", "stable_deref_trait", ] @@ -62,9 +62,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64ct" -version = "1.3.3" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874f8444adcb4952a8bc51305c8be95c8ec8237bb0d2e78d2e039f771f8828a0" +checksum = "ea2b2456fd614d856680dcd9fcc660a51a820fa09daef2e49772b56a193c8474" [[package]] name = "bitfield" @@ -96,7 +96,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -106,7 +106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "002b03a638d3a79abd2e39615606cd763f198679083a87dc4690d0ff20a4e562" dependencies = [ "bytemuck", - "cortex-m 0.7.4", + "cortex-m 0.7.6", "cortex-m-rt", "cortex-m-semihosting", "crc", @@ -131,9 +131,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bytemuck" -version = "1.7.3" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" +checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" [[package]] name = "cfg-if" @@ -168,15 +168,15 @@ dependencies = [ "aligned 0.3.5", "bare-metal", "bitfield", - "cortex-m 0.7.4", + "cortex-m 0.7.6", "volatile-register", ] [[package]] name = "cortex-m" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ff967e867ca14eba0c34ac25cd71ea98c678e741e3915d923999bb2fe7c826" +checksum = "70858629a458fdfd39f9675c4dc309411f2a3f83bede76988d81bf1a0ecee9e0" dependencies = [ "bare-metal", "bitfield", @@ -211,14 +211,14 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bffa6c1454368a6aa4811ae60964c38e6996d397ff8095a8b9211b1c1f749bc" dependencies = [ - "cortex-m 0.7.4", + "cortex-m 0.7.6", ] [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" dependencies = [ "libc", ] @@ -238,7 +238,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -249,7 +249,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15fe96f5d208164afa70583ff8f062e7697cbbb0b98e5076fbf8ac6da9edff0f" dependencies = [ "defmt-macros", - "semver 1.0.5", + "semver 1.0.13", ] [[package]] @@ -296,7 +296,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -325,9 +325,9 @@ dependencies = [ [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "elliptic-curve" @@ -337,7 +337,7 @@ checksum = "c13e9b0c3c4170dcc2a12783746c4205d98e18957f57854251eea3f9750fe005" dependencies = [ "bitvec", "ff", - "generic-array 0.14.5", + "generic-array 0.14.6", "group", "pkcs8", "rand_core", @@ -412,9 +412,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -452,9 +452,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.117" +version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "linked_list_allocator" @@ -521,16 +521,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1270d2f554d26b8c898ce6c19e7cba25a4b5a65299f4eadfe261e0acb9ff463d" dependencies = [ - "cortex-m 0.7.4", + "cortex-m 0.7.6", "cortex-m-rt", "vcell", ] [[package]] name = "memchr" -version = "2.3.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "nb" @@ -549,9 +549,9 @@ checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" [[package]] name = "nom" -version = "6.2.1" +version = "6.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c5c51b9083a3c620fa67a2a635d1ce7d95b897e957d6b28ff9a5da960a103a6" +checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" dependencies = [ "memchr", "version_check", @@ -580,15 +580,15 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d55dedd501dfd02514646e0af4d7016ce36bc12ae177ef52056989966a1eec" dependencies = [ - "cortex-m 0.7.4", + "cortex-m 0.7.6", "cortex-m-semihosting", ] [[package]] name = "paste" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" [[package]] name = "pkcs8" @@ -610,18 +610,18 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.15" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -675,9 +675,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.5" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" +checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" [[package]] name = "semver-parser" @@ -687,18 +687,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.136" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", @@ -769,13 +769,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.86" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -786,18 +786,18 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "3d0a539a918745651435ac7db7a18761589a94cd7e94cd56999f828bf73c8a57" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "c251e90f708e16c49a16f4917dc2131e75222b72edfa9cb7f7c58ae56aae0c09" dependencies = [ "proc-macro2", "quote", @@ -822,9 +822,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ufmt" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7ecea7ef79d3f8f878eee614afdf5256475c63ad76139d4da6125617c784a0" +checksum = "31d3c0c63312dfc9d8e5c71114d617018a19f6058674003c0da29ee8d8036cdd" dependencies = [ "proc-macro-hack", "ufmt-macros", @@ -833,9 +833,9 @@ dependencies = [ [[package]] name = "ufmt-macros" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed813e34a2bfa9dc58ee2ed8c8314d25e6d70c911486d64b8085cb695cfac069" +checksum = "e4ab6c92f30c996394a8bd525aef9f03ce01d0d7ac82d81902968057e37dd7d9" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -850,10 +850,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "unicode-ident" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" [[package]] name = "vcell" @@ -890,6 +890,6 @@ checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" [[package]] name = "zeroize" -version = "1.5.2" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" diff --git a/Cargo.toml b/Cargo.toml index 0a6ded23..6d4619a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,107 +1,9 @@ -[package] -edition = "2021" -name = "loadstone" -version = "1.1.0" -default-run = "loadstone" -license = "MIT" -description = "Portable secure bootloader for Cortex-M MCUs" -repository = "https://github.com/absw/loadstone" -readme = "README.md" -keywords = ["embedded", "bootloader", "cortex", "secure", "bare_metal"] -categories = ["embedded", "no-std"] -exclude = ["docker/*", "docs/*", "documentation/*", "svd/*"] - -[features] -default = [ - "defmt-default", +[workspace] +members = [ + "loadstone", + "loadstone_config", ] -# The features below reflect the hierarchy of stm32 families. -# Choosing a f4 family implies f4, which implies stm32, which -# implies cortex M... -stm32f429 = ["blue_hal/stm32f429", "stm32f4_any"] -stm32f469 = ["blue_hal/stm32f469", "stm32f4_any"] -stm32f407 = ["blue_hal/stm32f407", "stm32f4_any"] -stm32f412 = ["blue_hal/stm32f412", "stm32f4_any"] -stm32f4_any = ["blue_hal/stm32_any", "stm32_any"] -stm32_any = ["cortex_m_any"] - -efm32gg11b_any = ["cortex_m_any"] -wgm160p = ["blue_hal/wgm160p", "efm32gg11b_any"] - -max32631 = ["blue_hal/max32631", "max3263_any"] -max3263_any = ["blue_hal/max3263_any", "max32_any"] -max32_any = ["cortex_m_any"] - -cortex_m_any = [] - -defmt-default = [] -defmt-trace = [] -defmt-debug = [] -defmt-info = [] -defmt-warn = [] -defmt-error = [] - -ecdsa-verify = ["ecdsa", "p256"] -# Bases the binary address space on the first bootable -# bank rather than the first valid Flash address of the -# target board. This is mainly useful for the demo app, -# which is generally booted by loadstone. -relocate-to-bootable-bank = [] - -[dependencies] -cortex-m = "0.6.0" -cortex-m-rt = "0.6.10" -cortex-m-semihosting = "0.3.3" -nb = "0.1.*" -panic-semihosting = "0.5.*" -static_assertions = "1.1.*" -defmt = "0.2" -defmt-rtt = "0.2" -alloc-cortex-m = "0.4.1" -marker-blanket = "0.1.*" - -[dependencies.funty] -version = "=1.1.0" -default-features = false - -[dependencies.crc] -version = "1.8.1" -default-features = false - -[dependencies.ecdsa] -version = "0.11" -default-features = false -features = ["pem"] -optional = true - -[dependencies.sha2] -version = "0.9.5" -default-features = false - -[dependencies.p256] -version = "0.8.*" -default-features = false -features = ["ecdsa", "sha256", "pem"] -optional = true - -[dependencies.blue_hal] -version = "1.0.0" - -[dependencies.ufmt] -version = "0.1.*" -default-features = false - -[lib] -name = "loadstone_lib" -test = true -bench = false - -[[bin]] -name = "loadstone" -test = true -bench = false - [profile.release] opt-level = "z" codegen-units = 1 # better optimizations @@ -112,12 +14,3 @@ lto = true # better optimizations opt-level = 1 # Some optimization not to tank the binary size codegen-units = 1 # better optimizations lto = true # better optimizations - -[build-dependencies] -anyhow = "1.0.*" -ron = "0.6.*" -serde = "1.0.*" - -[build-dependencies.loadstone_config] -path = "loadstone_config" -version = "1.0.0" diff --git a/Dockerfile b/Dockerfile index c8a670af..84acce64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM rust:buster # Install zip RUN apt-get update -RUN apt-get install zip -y +RUN apt-get install zip libxcb-shape0-dev libxcb-xfixes0-dev -y # Install rust dependencies RUN rustup default nightly @@ -10,5 +10,6 @@ RUN rustup update RUN cargo install cargo-binutils RUN rustup component add llvm-tools-preview RUN rustup component add rustfmt +RUN rustup component add clippy RUN rustup target add thumbv7em-none-eabi RUN rustup target add thumbv7em-none-eabihf diff --git a/documentation/building.md b/documentation/building.md new file mode 100644 index 00000000..3e1a5f03 --- /dev/null +++ b/documentation/building.md @@ -0,0 +1,7 @@ +# Using x.py + +The intended way to build loadstone is using the x.py script in the root of the project. For usage information do `./x.py help SUBCOMMAND`. + +To generate bootloader configurations, build and execute the `loadstone_front` tool in `tools/loadstone_front`. The produced config file can be passed into x.py for a build. (eg. `./x.py build tools/loadstone_front/loadstone_config.ron stm32f412`) + +Testing and linting can also be performed this way. diff --git a/.cargo/.gitignore b/loadstone/.cargo/.gitignore similarity index 100% rename from .cargo/.gitignore rename to loadstone/.cargo/.gitignore diff --git a/.cargo/config b/loadstone/.cargo/config similarity index 100% rename from .cargo/config rename to loadstone/.cargo/config diff --git a/.cargo/debug_max32631.sh b/loadstone/.cargo/debug_max32631.sh similarity index 100% rename from .cargo/debug_max32631.sh rename to loadstone/.cargo/debug_max32631.sh diff --git a/.cargo/debug_wgm160p.sh b/loadstone/.cargo/debug_wgm160p.sh similarity index 100% rename from .cargo/debug_wgm160p.sh rename to loadstone/.cargo/debug_wgm160p.sh diff --git a/.cargo/max3263x.gdb b/loadstone/.cargo/max3263x.gdb similarity index 100% rename from .cargo/max3263x.gdb rename to loadstone/.cargo/max3263x.gdb diff --git a/.cargo/runner-wrapper b/loadstone/.cargo/runner-wrapper similarity index 100% rename from .cargo/runner-wrapper rename to loadstone/.cargo/runner-wrapper diff --git a/loadstone/Cargo.toml b/loadstone/Cargo.toml new file mode 100644 index 00000000..aef551ed --- /dev/null +++ b/loadstone/Cargo.toml @@ -0,0 +1,112 @@ +[package] +edition = "2021" +name = "loadstone" +version = "1.1.0" +default-run = "loadstone" +license = "MIT" +description = "Portable secure bootloader for Cortex-M MCUs" +repository = "https://github.com/absw/loadstone" +readme = "README.md" +keywords = ["embedded", "bootloader", "cortex", "secure", "bare_metal"] +categories = ["embedded", "no-std"] +exclude = ["docker/*", "docs/*", "documentation/*", "svd/*"] + +[features] +default = [ + "defmt-default", +] + +# The features below reflect the hierarchy of stm32 families. +# Choosing a f4 family implies f4, which implies stm32, which +# implies cortex M... +stm32f429 = ["blue_hal/stm32f429", "stm32f4_any"] +stm32f469 = ["blue_hal/stm32f469", "stm32f4_any"] +stm32f407 = ["blue_hal/stm32f407", "stm32f4_any"] +stm32f412 = ["blue_hal/stm32f412", "stm32f4_any"] +stm32f4_any = ["blue_hal/stm32_any", "stm32_any"] +stm32_any = ["cortex_m_any"] + +efm32gg11b_any = ["cortex_m_any"] +wgm160p = ["blue_hal/wgm160p", "efm32gg11b_any"] + +max32631 = ["blue_hal/max32631", "max3263_any"] +max3263_any = ["blue_hal/max3263_any", "max32_any"] +max32_any = ["cortex_m_any"] + +cortex_m_any = [] + +defmt-default = [] +defmt-trace = [] +defmt-debug = [] +defmt-info = [] +defmt-warn = [] +defmt-error = [] + +ecdsa-verify = ["ecdsa", "p256"] +# Bases the binary address space on the first bootable +# bank rather than the first valid Flash address of the +# target board. This is mainly useful for the demo app, +# which is generally booted by loadstone. +relocate-to-bootable-bank = [] + +[dependencies] +cortex-m = "0.6.0" +cortex-m-rt = "0.6.10" +cortex-m-semihosting = "0.3.3" +nb = "0.1.*" +panic-semihosting = "0.5.*" +static_assertions = "1.1.*" +defmt = "0.2" +defmt-rtt = "0.2" +alloc-cortex-m = "0.4.1" +marker-blanket = "0.1.*" + +[dependencies.funty] +version = "=1.1.0" +default-features = false + +[dependencies.crc] +version = "1.8.1" +default-features = false + +[dependencies.ecdsa] +version = "0.11" +default-features = false +features = ["pem"] +optional = true + +[dependencies.sha2] +version = "0.9.5" +default-features = false + +[dependencies.p256] +version = "0.8.*" +default-features = false +features = ["ecdsa", "sha256", "pem"] +optional = true + +[dependencies.blue_hal] +version = "1.0.0" + +[dependencies.ufmt] +version = "0.1.*" +default-features = false + +[lib] +name = "loadstone_lib" +test = true +bench = false + +[[bin]] +name = "loadstone" +test = true +bench = false + +[build-dependencies] +anyhow = "1.0.*" +ron = "0.6.*" +serde = "1.0.*" + +[build-dependencies.loadstone_config] +path = "../loadstone_config" +version = "1.0.0" diff --git a/build.rs b/loadstone/build.rs similarity index 96% rename from build.rs rename to loadstone/build.rs index 765ffdf7..5168e9a4 100644 --- a/build.rs +++ b/loadstone/build.rs @@ -1,5 +1,3 @@ -#![feature(bool_to_option)] - use anyhow::Result; use loadstone_config::{codegen::generate_modules, security::SecurityMode, Configuration}; use std::fs; @@ -11,7 +9,9 @@ fn configure_runner(target: &str) { fs::write(RUNNER_TARGET_FILE, target).unwrap(); } -fn main() -> Result<()> { process_configuration_file() } +fn main() -> Result<()> { + process_configuration_file() +} fn process_configuration_file() -> Result<()> { println!("cargo:rerun-if-env-changed=LOADSTONE_CONFIG"); diff --git a/src/bin/demo_app.rs b/loadstone/src/bin/demo_app.rs similarity index 100% rename from src/bin/demo_app.rs rename to loadstone/src/bin/demo_app.rs diff --git a/src/bin/loadstone.rs b/loadstone/src/bin/loadstone.rs similarity index 100% rename from src/bin/loadstone.rs rename to loadstone/src/bin/loadstone.rs diff --git a/src/devices/boot_manager.rs b/loadstone/src/devices/boot_manager.rs similarity index 98% rename from src/devices/boot_manager.rs rename to loadstone/src/devices/boot_manager.rs index 59e61048..097c191b 100644 --- a/src/devices/boot_manager.rs +++ b/loadstone/src/devices/boot_manager.rs @@ -103,7 +103,9 @@ impl ! { SCB::sys_reset(); } + pub fn reset(&mut self) -> ! { + SCB::sys_reset(); + } pub fn set_update_signal(&mut self, plan: UpdatePlan) -> Result<(), Error> { if let Some(us) = self.update_signal.as_mut() { diff --git a/src/devices/boot_metrics.rs b/loadstone/src/devices/boot_metrics.rs similarity index 93% rename from src/devices/boot_metrics.rs rename to loadstone/src/devices/boot_metrics.rs index 21178e77..4aa06b07 100644 --- a/src/devices/boot_metrics.rs +++ b/loadstone/src/devices/boot_metrics.rs @@ -74,9 +74,7 @@ impl BootMetrics { /// application. pub unsafe fn boot_metrics_mut() -> &'static mut BootMetrics { let ram_end = 0x20010000; - let boot_metrics_raw: *mut BootMetrics = core::mem::transmute::( - ram_end - core::mem::size_of::(), - ); + let boot_metrics_raw = (ram_end - core::mem::size_of::()) as *mut BootMetrics; boot_metrics_raw.as_mut().unwrap() } @@ -87,4 +85,6 @@ pub unsafe fn boot_metrics_mut() -> &'static mut BootMetrics { /// Horrendously unsafe. Simply returns a block at end of RAM reinterpreted as an arbitrary struct. /// Only useful right after bootstrapping the app, to retrieve metrics information before having a /// chance to clobber it. -pub unsafe fn boot_metrics() -> &'static BootMetrics { boot_metrics_mut() } +pub unsafe fn boot_metrics() -> &'static BootMetrics { + boot_metrics_mut() +} diff --git a/src/devices/bootloader/copy.rs b/loadstone/src/devices/bootloader/copy.rs similarity index 84% rename from src/devices/bootloader/copy.rs rename to loadstone/src/devices/bootloader/copy.rs index bec9b88e..20f840c5 100644 --- a/src/devices/bootloader/copy.rs +++ b/loadstone/src/devices/bootloader/copy.rs @@ -40,10 +40,14 @@ impl self.boot(image).expect("FATAL: Failed to boot from verified image!"), + Ok(image) => self + .boot(image) + .expect("FATAL: Failed to boot from verified image!"), Err(e) => { info!("Failed to restore. Error: {:?}", e); @@ -116,8 +118,10 @@ impl UpdatePlan { self.plan } + fn read_update_plan(&self) -> UpdatePlan { + self.plan + } } impl WriteUpdateSignal for FakeUpdatePlanner { - fn write_update_plan(&mut self, plan: UpdatePlan) { self.plan = plan; } + fn write_update_plan(&mut self, plan: UpdatePlan) { + self.plan = plan; + } } pub type BootloaderDouble = super::Bootloader< @@ -240,7 +248,10 @@ pub mod doubles { } pub fn with_external_banks(self, external_banks: &'static [Bank
]) -> Self { - Self { external_banks, ..self } + Self { + external_banks, + ..self + } } } diff --git a/src/devices/bootloader/recover.rs b/loadstone/src/devices/bootloader/recover.rs similarity index 92% rename from src/devices/bootloader/recover.rs rename to loadstone/src/devices/bootloader/recover.rs index 02b626b4..ef49d8db 100644 --- a/src/devices/bootloader/recover.rs +++ b/loadstone/src/devices/bootloader/recover.rs @@ -16,7 +16,10 @@ impl { duprintln!(self.serial, "Finished flashing golden image."); @@ -33,7 +36,10 @@ impl { duprintln!(self.serial, "Finished flashing golden image."); @@ -86,7 +92,11 @@ impl Option> { let output = self.boot_bank(); - for input_bank in - self.mcu_banks.iter().filter(|b| b.is_golden == golden && b.index != output.index) + for input_bank in self + .mcu_banks + .iter() + .filter(|b| b.is_golden == golden && b.index != output.index) { duprintln!( self.serial, @@ -78,7 +82,9 @@ impl None, Some(UpdatePlan::None) => { - duprintln!(self.serial, "Update signal set to None, refusing to update."); + duprintln!( + self.serial, + "Update signal set to None, refusing to update." + ); return Some(current_image); } Some(UpdatePlan::Any) => { - duprintln!(self.serial, "Update signal set to Any, checking for image updates."); + duprintln!( + self.serial, + "Update signal set to Any, checking for image updates." + ); None } Some(UpdatePlan::Index(i)) => { @@ -85,18 +91,27 @@ impl Result, Error> { // Restore the update plan so the attempt is done only once. - self.update_planner.as_mut().unwrap().write_update_plan(UpdatePlan::None); + self.update_planner + .as_mut() + .unwrap() + .write_update_plan(UpdatePlan::None); let boot_bank = self.boot_bank(); if let Some(serial) = self.serial.as_mut() { uprintln!(serial, "Please send firmware image via XMODEM."); - if self.mcu_flash.write_from_blocks(boot_bank.location, serial.blocks(None)).is_err() { + if self + .mcu_flash + .write_from_blocks(boot_bank.location, serial.blocks(None)) + .is_err() + { return Err(Error::FlashCorrupted); } } else { - return Err(Error::DeviceError("Cannot perform serial update without serial console.")); + return Err(Error::DeviceError( + "Cannot perform serial update without serial console.", + )); } R::image_at(&mut self.mcu_flash, boot_bank) @@ -209,7 +224,11 @@ impl, boot_bank: Bank, ) -> Option> { - duprintln!(self.serial, "Replacing current image with bank {:?}.", bank.index,); + duprintln!( + self.serial, + "Replacing current image with bank {:?}.", + bank.index, + ); Self::copy_image_single_flash( &mut self.serial, &mut self.mcu_flash, @@ -218,7 +237,12 @@ impl, boot_bank: Bank, ) -> Option> { - duprintln!(self.serial, "Replacing current image with bank {:?}.", bank.index,); + duprintln!( + self.serial, + "Replacing current image with bank {:?}.", + bank.index, + ); Self::copy_image( &mut self.serial, self.external_flash.as_mut().unwrap(), @@ -239,7 +267,12 @@ impl Iterator for BlockIterator<'a, S> { 'block_loop: while self.max_retries.is_none() || retries < self.max_retries.unwrap() { let mut buffer_index = 0usize; - let message = if self.received_block { xmodem::ACK } else { xmodem::NAK }; + let message = if self.received_block { + xmodem::ACK + } else { + xmodem::NAK + }; if self.serial.write_char(message as char).is_err() { retries += 1; continue 'block_loop; @@ -128,5 +132,7 @@ impl<'a, S: TimeoutRead + Write + ?Sized> BlockIterator<'a, S> { impl<'a, S: TimeoutRead + Write + ?Sized> Drop for BlockIterator<'a, S> { // Must fully consume the iterator on drop // to close the xmodem communication cleanly - fn drop(&mut self) { self.for_each(drop); } + fn drop(&mut self) { + self.for_each(drop); + } } diff --git a/src/devices/cli/mod.rs b/loadstone/src/devices/cli/mod.rs similarity index 88% rename from src/devices/cli/mod.rs rename to loadstone/src/devices/cli/mod.rs index 43144105..5c0ff4b8 100644 --- a/src/devices/cli/mod.rs +++ b/loadstone/src/devices/cli/mod.rs @@ -27,7 +27,7 @@ pub mod file_transfer; const PROMPT: &str = "\n> "; const BUFFER_SIZE: usize = 256; -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum Error { CommandEmpty, CommandUnknown, @@ -44,7 +44,9 @@ pub enum Error { } impl From for Error { - fn from(e: ApplicationError) -> Self { Error::ApplicationError(e) } + fn from(e: ApplicationError) -> Self { + Error::ApplicationError(e) + } } pub const DEFAULT_GREETING: &str = "--=Loadstone demo app CLI + Boot Manager=--"; @@ -118,7 +120,9 @@ impl<'a> Parsable<'a> for u8 { } impl<'a> Parsable<'a> for &'a str { - fn parse(text: &'a str) -> Result { Ok(text) } + fn parse(text: &'a str) -> Result { + Ok(text) + } } trait RetrieveArgument { @@ -215,15 +219,23 @@ impl Cli { uwriteln!(self.serial, "[CLI Error] Command missing an argument") } Err(Error::DuplicateArguments) => { - uwriteln!(self.serial, "[CLI Error] Command contains duplicate arguments") + uwriteln!( + self.serial, + "[CLI Error] Command contains duplicate arguments" + ) } Err(Error::ApplicationError(e)) => { - uwriteln!(self.serial, "[CLI Error] Internal boot manager error: ").ok().unwrap(); + uwriteln!(self.serial, "[CLI Error] Internal boot manager error: ") + .ok() + .unwrap(); e.report(&mut self.serial); Ok(()) } Err(Error::UnexpectedArguments) => { - uwriteln!(self.serial, "[CLI Error] Command contains an unexpected argument") + uwriteln!( + self.serial, + "[CLI Error] Command contains an unexpected argument" + ) } Err(Error::ArgumentOutOfRange) => { uwriteln!(self.serial, "[CLI Error] Argument is out of valid range") @@ -239,7 +251,9 @@ impl Cli { } /// Returns the serial driver the CLI is using. - pub fn serial(&mut self) -> &mut SRL { &mut self.serial } + pub fn serial(&mut self) -> &mut SRL { + &mut self.serial + } /// Attempts to parse a given string into a command name and arguments. fn parse(text: &str) -> Result<(Name, ArgumentIterator), Error> { @@ -247,7 +261,10 @@ impl Cli { if text.is_empty() { return Err(Error::CommandEmpty); } - if !text.chars().all(|c| c.is_ascii_alphanumeric() || ALLOWED_TOKENS.contains(c)) { + if !text + .chars() + .all(|c| c.is_ascii_alphanumeric() || ALLOWED_TOKENS.contains(c)) + { return Err(Error::CharactersNotAllowed); } @@ -281,7 +298,11 @@ impl Cli { /// Creates a new CLI using the given serial. pub fn new(serial: SRL) -> Result { - Ok(Cli { serial, greeted: false, needs_prompt: true }) + Ok(Cli { + serial, + greeted: false, + needs_prompt: true, + }) } fn read_line(&mut self, buffer: &mut [u8]) -> nb::Result<(), Error> { @@ -289,7 +310,11 @@ impl Cli { Err(_) => true, Ok(b) => *b as char != LINE_TERMINATOR, }); - if bytes.try_collect_slice(buffer).map_err(|_| Error::SerialReadError)? < buffer.len() { + if bytes + .try_collect_slice(buffer) + .map_err(|_| Error::SerialReadError)? + < buffer.len() + { Ok(()) } else { Err(nb::Error::Other(Error::SerialBufferOverflow)) @@ -386,7 +411,9 @@ mod test { use blue_hal::hal::doubles::serial::*; impl Convertible for SerialStubError { - fn into(self) -> ApplicationError { ApplicationError::DeviceError("Serial stub failed") } + fn into(self) -> ApplicationError { + ApplicationError::DeviceError("Serial stub failed") + } } #[test] @@ -394,13 +421,19 @@ mod test { let sample_command = "my_command an_option=5000 some_flag"; let (name, mut arguments) = Cli::::parse(sample_command).unwrap(); assert_eq!("my_command", name); - assert_eq!(Argument::Pair("an_option", "5000"), arguments.next().unwrap()); + assert_eq!( + Argument::Pair("an_option", "5000"), + arguments.next().unwrap() + ); assert_eq!(Argument::Single("some_flag"), arguments.next().unwrap()); let sample_command = "command with_too_much_whitespace but still=valid \n\n"; let (name, mut arguments) = Cli::::parse(sample_command).unwrap(); assert_eq!("command", name); - assert_eq!(Argument::Single("with_too_much_whitespace"), arguments.next().unwrap()); + assert_eq!( + Argument::Single("with_too_much_whitespace"), + arguments.next().unwrap() + ); assert_eq!(Argument::Single("but"), arguments.next().unwrap()); assert_eq!(Argument::Pair("still", "valid"), arguments.next().unwrap()); } @@ -410,19 +443,25 @@ mod test { let bad_command_no_fields = ""; assert_eq!( Error::CommandEmpty, - Cli::::parse(bad_command_no_fields).err().unwrap() + Cli::::parse(bad_command_no_fields) + .err() + .unwrap() ); let bad_command_strange_formatting = "command with=a=strange=argument"; assert_eq!( Error::MalformedArguments, - Cli::::parse(bad_command_strange_formatting).err().unwrap() + Cli::::parse(bad_command_strange_formatting) + .err() + .unwrap() ); let bad_command_characters_not_allowed = "com-mand with? bad+characters"; assert_eq!( Error::CharactersNotAllowed, - Cli::::parse(bad_command_characters_not_allowed).err().unwrap() + Cli::::parse(bad_command_characters_not_allowed) + .err() + .unwrap() ); } } diff --git a/src/devices/image/image_crc.rs b/loadstone/src/devices/image/image_crc.rs similarity index 87% rename from src/devices/image/image_crc.rs rename to loadstone/src/devices/image/image_crc.rs index 8b463b35..88876797 100644 --- a/src/devices/image/image_crc.rs +++ b/loadstone/src/devices/image/image_crc.rs @@ -112,9 +112,16 @@ mod tests { #[test] fn retrieving_image_with_correct_crc_succeeds() { let mut flash = FakeFlash::new(Address(0)); - let bank = - Bank { index: 1, size: 512, location: Address(0), bootable: false, is_golden: false }; - flash.write(Address(0), &TEST_IMAGE_WITH_CORRECT_CRC).unwrap(); + let bank = Bank { + index: 1, + size: 512, + location: Address(0), + bootable: false, + is_golden: false, + }; + flash + .write(Address(0), &TEST_IMAGE_WITH_CORRECT_CRC) + .unwrap(); let image = CrcImageReader::image_at(&mut flash, bank).unwrap(); assert_eq!(image.size, 12usize); @@ -126,10 +133,18 @@ mod tests { #[test] fn retrieving_image_with_incorrect_crc_fails() { let mut flash = FakeFlash::new(Address(0)); - let bank = - Bank { index: 1, size: 512, location: Address(0), bootable: false, is_golden: false }; + let bank = Bank { + index: 1, + size: 512, + location: Address(0), + bootable: false, + is_golden: false, + }; flash.write(Address(0), &TEST_IMAGE_WITH_BAD_CRC).unwrap(); - assert_eq!(Err(Error::CrcInvalid), CrcImageReader::image_at(&mut flash, bank)); + assert_eq!( + Err(Error::CrcInvalid), + CrcImageReader::image_at(&mut flash, bank) + ); } } diff --git a/src/devices/image/image_ecdsa.rs b/loadstone/src/devices/image/image_ecdsa.rs similarity index 80% rename from src/devices/image/image_ecdsa.rs rename to loadstone/src/devices/image/image_ecdsa.rs index ef3ace3b..d69bd11d 100644 --- a/src/devices/image/image_ecdsa.rs +++ b/loadstone/src/devices/image/image_ecdsa.rs @@ -44,7 +44,12 @@ impl Reader for EcdsaImageReader { // Development build shorcut: We're checking that the image does *not* start with 0xFF. This // will not be part of the final Loadstone release build, but it helps speed up the // verification for invalid images during development. - if flash.bytes(bank.location).next().ok_or(Error::BankInvalid)? == 0xFF { + if flash + .bytes(bank.location) + .next() + .ok_or(Error::BankInvalid)? + == 0xFF + { return Err(Error::BankEmpty); } let key = retrieve_key(); @@ -57,11 +62,14 @@ impl Reader for EcdsaImageReader { .bytes(bank.location) .take(bank.size) .until_sequence(&magic_string_inverted()) - .fold((sha2::Sha256::default(), 0usize), |(mut digest, mut byte_count), byte| { - digest.update(&[byte]); - byte_count += 1; - (digest, byte_count) - }); + .fold( + (sha2::Sha256::default(), 0usize), + |(mut digest, mut byte_count), byte| { + digest.update(&[byte]); + byte_count += 1; + (digest, byte_count) + }, + ); if image_size == bank.size { return Err(Error::BankEmpty); @@ -76,7 +84,8 @@ impl Reader for EcdsaImageReader { let signature = Signature::from_bytes(signature_bytes).map_err(|_| Error::SignatureInvalid)?; - key.verify_digest(digest, &signature).map_err(|_| Error::SignatureInvalid)?; + key.verify_digest(digest, &signature) + .map_err(|_| Error::SignatureInvalid)?; let golden_string_position = bank.location + image_size.saturating_sub(GOLDEN_STRING.len()); let golden_bytes = &mut buffer[0..GOLDEN_STRING.len()]; @@ -198,8 +207,13 @@ mod tests { #[test] fn retrieving_signed_image_succeeds() { let mut flash = FakeFlash::new(Address(0)); - let bank = - Bank { index: 1, size: 512, location: Address(0), bootable: false, is_golden: false }; + let bank = Bank { + index: 1, + size: 512, + location: Address(0), + bootable: false, + is_golden: false, + }; flash.write(Address(0), &TEST_SIGNED_IMAGE).unwrap(); let image = EcdsaImageReader::image_at(&mut flash, bank).unwrap(); @@ -212,8 +226,13 @@ mod tests { #[test] fn retrieving_signed_golden_key_succeeds() { let mut flash = FakeFlash::new(Address(0)); - let bank = - Bank { index: 1, size: 512, location: Address(0), bootable: false, is_golden: false }; + let bank = Bank { + index: 1, + size: 512, + location: Address(0), + bootable: false, + is_golden: false, + }; flash.write(Address(0), &TEST_SIGNED_GOLDEN_IMAGE).unwrap(); let image = EcdsaImageReader::image_at(&mut flash, bank).unwrap(); @@ -226,35 +245,64 @@ mod tests { #[test] fn retrieving_images_signed_by_another_key_fails() { let mut flash = FakeFlash::new(Address(0)); - let bank = - Bank { index: 1, size: 512, location: Address(0), bootable: false, is_golden: false }; - - flash.write(Address(0), &TEST_IMAGE_SIGNED_BY_ANOTHER_KEY).unwrap(); - assert_eq!(Err(Error::SignatureInvalid), EcdsaImageReader::image_at(&mut flash, bank)); - - flash.write(Address(0), &TEST_GOLDEN_IMAGE_SIGNED_BY_ANOTHER_KEY).unwrap(); - assert_eq!(Err(Error::SignatureInvalid), EcdsaImageReader::image_at(&mut flash, bank)); + let bank = Bank { + index: 1, + size: 512, + location: Address(0), + bootable: false, + is_golden: false, + }; + + flash + .write(Address(0), &TEST_IMAGE_SIGNED_BY_ANOTHER_KEY) + .unwrap(); + assert_eq!( + Err(Error::SignatureInvalid), + EcdsaImageReader::image_at(&mut flash, bank) + ); + + flash + .write(Address(0), &TEST_GOLDEN_IMAGE_SIGNED_BY_ANOTHER_KEY) + .unwrap(); + assert_eq!( + Err(Error::SignatureInvalid), + EcdsaImageReader::image_at(&mut flash, bank) + ); } #[test] fn retrieving_broken_image_fails() { let mut flash = FakeFlash::new(Address(0)); - let bank = - Bank { index: 1, size: 512, location: Address(0), bootable: false, is_golden: false }; + let bank = Bank { + index: 1, + size: 512, + location: Address(0), + bootable: false, + is_golden: false, + }; let mut image: [u8; 98] = TEST_SIGNED_IMAGE.try_into().unwrap(); image[0] = 0xCC; // Corrupted image body; flash.write(Address(0), &image).unwrap(); - assert_eq!(Err(Error::SignatureInvalid), EcdsaImageReader::image_at(&mut flash, bank)); + assert_eq!( + Err(Error::SignatureInvalid), + EcdsaImageReader::image_at(&mut flash, bank) + ); let mut image: [u8; 98] = TEST_SIGNED_IMAGE.try_into().unwrap(); image[3] = 0xCC; // Corrupted magic string flash.write(Address(0), &image).unwrap(); - assert_eq!(Err(Error::BankEmpty), EcdsaImageReader::image_at(&mut flash, bank)); + assert_eq!( + Err(Error::BankEmpty), + EcdsaImageReader::image_at(&mut flash, bank) + ); let mut image: [u8; 98] = TEST_SIGNED_IMAGE.try_into().unwrap(); image[96] = 0xCC; // Corrupted signature flash.write(Address(0), &image).unwrap(); - assert_eq!(Err(Error::SignatureInvalid), EcdsaImageReader::image_at(&mut flash, bank)); + assert_eq!( + Err(Error::SignatureInvalid), + EcdsaImageReader::image_at(&mut flash, bank) + ); } } diff --git a/src/devices/image/mod.rs b/loadstone/src/devices/image/mod.rs similarity index 82% rename from src/devices/image/mod.rs rename to loadstone/src/devices/image/mod.rs index fdcc212c..e5f23301 100644 --- a/src/devices/image/mod.rs +++ b/loadstone/src/devices/image/mod.rs @@ -70,13 +70,31 @@ pub struct Bank { impl Bank { pub fn golden(index: u8, size: usize, location: A) -> Self { - Self { index, size, location, bootable: false, is_golden: true } + Self { + index, + size, + location, + bootable: false, + is_golden: true, + } } pub fn bootable(index: u8, size: usize, location: A) -> Self { - Self { index, size, location, bootable: true, is_golden: false } + Self { + index, + size, + location, + bootable: true, + is_golden: false, + } } pub fn regular(index: u8, size: usize, location: A) -> Self { - Self { index, size, location, bootable: false, is_golden: false } + Self { + index, + size, + location, + bootable: false, + is_golden: false, + } } } @@ -84,7 +102,7 @@ impl Bank { /// /// An image descriptor can only be constructed by scanning the flash and finding /// a correctly decorated and signed firmware image. -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct Image { size: usize, location: A, @@ -107,16 +125,24 @@ pub trait Reader { impl Image { /// Address of the start of the firmware image. Will generally coincide /// with the start of its associated image bank. - pub fn location(&self) -> A { self.location } + pub fn location(&self) -> A { + self.location + } /// Size of the firmware image, excluding decoration and signature/crc. - pub fn size(&self) -> usize { self.size } + pub fn size(&self) -> usize { + self.size + } /// Size of the firmware image, including decoration and signature. #[cfg(feature = "ecdsa-verify")] pub fn total_size(&self) -> usize { self.size() + image_ecdsa::SignatureSize::::to_usize() + MAGIC_STRING.len() - + if self.is_golden() { GOLDEN_STRING.len() } else { 0 } + + if self.is_golden() { + GOLDEN_STRING.len() + } else { + 0 + } } /// Size of the firmware image, including decoration and crc. #[cfg(not(feature = "ecdsa-verify"))] @@ -124,18 +150,28 @@ impl Image { self.size() + core::mem::size_of::() + MAGIC_STRING.len() - + if self.is_golden() { GOLDEN_STRING.len() } else { 0 } + + if self.is_golden() { + GOLDEN_STRING.len() + } else { + 0 + } } /// Whether the image is verified to be golden (contains a golden string). /// A golden image is a high reliability, 'blessed' image able /// to be used as a last resort fallback. - pub fn is_golden(&self) -> bool { self.golden } + pub fn is_golden(&self) -> bool { + self.golden + } #[cfg(feature = "ecdsa-verify")] /// ECDSA signature of the firmware image. This is also used as an unique /// identifier for the firmware image for the purposes of updating. - pub fn identifier(&self) -> image_ecdsa::Signature { self.signature } + pub fn identifier(&self) -> image_ecdsa::Signature { + self.signature + } #[cfg(not(feature = "ecdsa-verify"))] /// Firmware image CRC. This is also used as an unique /// identifier for the firmware image for the purposes of updating. - pub fn identifier(&self) -> u32 { self.crc } + pub fn identifier(&self) -> u32 { + self.crc + } } diff --git a/src/devices/mod.rs b/loadstone/src/devices/mod.rs similarity index 100% rename from src/devices/mod.rs rename to loadstone/src/devices/mod.rs diff --git a/src/devices/update_signal.rs b/loadstone/src/devices/update_signal.rs similarity index 100% rename from src/devices/update_signal.rs rename to loadstone/src/devices/update_signal.rs diff --git a/src/error.rs b/loadstone/src/error.rs similarity index 87% rename from src/error.rs rename to loadstone/src/error.rs index 3f5b455a..c0bfd0d5 100644 --- a/src/error.rs +++ b/loadstone/src/error.rs @@ -7,7 +7,7 @@ use ufmt::{uwrite, uwriteln}; /// Top level error type for the bootloader. Unlike the specific /// module errors, this error contains textual descriptions of the /// problem as it is meant to be directly reported through USART. -#[derive(Debug, Copy, Clone, PartialEq, Format)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Format)] pub enum Error { /// Error caused by a low level peripheral driver DriverError(&'static str), @@ -32,7 +32,9 @@ pub trait Convertible { fn into(self) -> Error; } impl From for Error { - fn from(t: T) -> Self { t.into() } + fn from(t: T) -> Self { + t.into() + } } /// Exposes a report_unwrap() method that behaves like @@ -87,10 +89,16 @@ impl Error { "[Logic Error] -> Bank doesn't exist or is invalid in this context" ), Error::BankEmpty => { - uwriteln!(serial, "[Logic Error] -> Bank is empty (contains no firmware image)") + uwriteln!( + serial, + "[Logic Error] -> Bank is empty (contains no firmware image)" + ) } Error::FlashCorrupted => { - uwriteln!(serial, "[Logic Error] -> Flash memory is corrupted or outdated") + uwriteln!( + serial, + "[Logic Error] -> Flash memory is corrupted or outdated" + ) } Error::SignatureInvalid => { uwriteln!(serial, "[LogicError] -> Image signature is invalid") @@ -99,7 +107,10 @@ impl Error { uwriteln!(serial, "[Logic Error] -> No image to restore from") } Error::NoExternalFlash => { - uwriteln!(serial, "[Logic Error] -> No external flash in this configuration") + uwriteln!( + serial, + "[Logic Error] -> No external flash in this configuration" + ) } Error::ImageIsNotGolden => { uwriteln!(serial, "[Logic Error] -> Image is not golden") diff --git a/src/lib.rs b/loadstone/src/lib.rs similarity index 97% rename from src/lib.rs rename to loadstone/src/lib.rs index cf921b2f..0d428df0 100644 --- a/src/lib.rs +++ b/loadstone/src/lib.rs @@ -1,8 +1,7 @@ //! # Loadstone Library #![feature(never_type)] -#![feature(bool_to_option)] -#![feature(associated_type_bounds)] #![feature(alloc_error_handler)] +#![feature(associated_type_bounds)] #![cfg_attr(test, allow(unused_imports))] #![cfg_attr(target_arch = "arm", no_std)] diff --git a/src/ports/max32631/bootloader.rs b/loadstone/src/ports/max32631/bootloader.rs similarity index 100% rename from src/ports/max32631/bootloader.rs rename to loadstone/src/ports/max32631/bootloader.rs diff --git a/src/ports/max32631/update_signal.rs b/loadstone/src/ports/max32631/update_signal.rs similarity index 100% rename from src/ports/max32631/update_signal.rs rename to loadstone/src/ports/max32631/update_signal.rs diff --git a/src/ports/mod.rs b/loadstone/src/ports/mod.rs similarity index 100% rename from src/ports/mod.rs rename to loadstone/src/ports/mod.rs diff --git a/src/ports/stm32f412/boot_manager.rs b/loadstone/src/ports/stm32f412/boot_manager.rs similarity index 100% rename from src/ports/stm32f412/boot_manager.rs rename to loadstone/src/ports/stm32f412/boot_manager.rs diff --git a/src/ports/stm32f412/bootloader.rs b/loadstone/src/ports/stm32f412/bootloader.rs similarity index 100% rename from src/ports/stm32f412/bootloader.rs rename to loadstone/src/ports/stm32f412/bootloader.rs diff --git a/src/ports/stm32f412/update_signal.rs b/loadstone/src/ports/stm32f412/update_signal.rs similarity index 100% rename from src/ports/stm32f412/update_signal.rs rename to loadstone/src/ports/stm32f412/update_signal.rs diff --git a/src/ports/wgm160p/bootloader.rs b/loadstone/src/ports/wgm160p/bootloader.rs similarity index 100% rename from src/ports/wgm160p/bootloader.rs rename to loadstone/src/ports/wgm160p/bootloader.rs diff --git a/src/ports/wgm160p/update_signal.rs b/loadstone/src/ports/wgm160p/update_signal.rs similarity index 100% rename from src/ports/wgm160p/update_signal.rs rename to loadstone/src/ports/wgm160p/update_signal.rs diff --git a/loadstone_config/Cargo.toml b/loadstone_config/Cargo.toml index e611820e..ee1da3ba 100644 --- a/loadstone_config/Cargo.toml +++ b/loadstone_config/Cargo.toml @@ -9,13 +9,19 @@ keywords = ["embedded", "bootloader", "cortex", "secure", "bare_metal"] categories = ["embedded", "no-std"] [dependencies] -serde = { version = "1.0", features = ["derive"] } -syn = { version = "1.0.63", features = ["full", "fold"] } -quote = "1.0.9" -anyhow = "1.0.*" -tightness = "1.0.*" -enum-iterator = "0.6.*" -itertools = "0.10.*" +quote = "1" +anyhow = "1" +tightness = "1" +enum-iterator = "0.6" +itertools = "0.10" + +[dependencies.serde] +version = "1" +features = ["derive"] + +[dependencies.syn] +version = "1" +features = ["full", "fold"] [dependencies.ecdsa] version = "0.11" @@ -23,10 +29,10 @@ default-features = false features = ["pem"] [dependencies.sha2] -version = "0.9.5" +version = "0.9" default-features = false [dependencies.p256] -version = "0.8.1" +version = "0.8" default-features = false features = ["ecdsa", "sha256", "pem"] diff --git a/loadstone_config/src/codegen/devices.rs b/loadstone_config/src/codegen/devices.rs index 2f6e15f8..7032d9e4 100644 --- a/loadstone_config/src/codegen/devices.rs +++ b/loadstone_config/src/codegen/devices.rs @@ -12,7 +12,11 @@ pub fn generate>( configuration: &Configuration, ) -> Result<()> { let filename = autogenerated_folder_path.as_ref().join("devices.rs"); - let mut file = OpenOptions::new().write(true).create(true).truncate(true).open(&filename)?; + let mut file = OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(&filename)?; let mut code = quote! {}; match configuration.port { diff --git a/loadstone_config/src/codegen/linker_script.rs b/loadstone_config/src/codegen/linker_script.rs index 799a211a..ac23b756 100644 --- a/loadstone_config/src/codegen/linker_script.rs +++ b/loadstone_config/src/codegen/linker_script.rs @@ -6,13 +6,17 @@ use anyhow::{anyhow, Result}; /// Generates the linker script `memory.x`, which describes the amount and location /// of flash and RAM memory available to a particular Loadstone instance. pub fn generate_linker_script(configuration: &Configuration) -> Result<()> { - let mut file = OpenOptions::new().write(true).create(true).truncate(true).open("memory.x")?; + let mut file = OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open("memory.x")?; #[allow(unused_mut)] let mut constants = configuration .port .linker_script_constants() - .ok_or(anyhow!("Current board doesn't have linker script constants defined."))?; + .ok_or_else(|| anyhow!("Current board doesn't have linker script constants defined."))?; if std::env::var("CARGO_FEATURE_RELOCATE_TO_BOOTABLE_BANK").is_ok() { relocate_to_bootable_bank(&mut constants, configuration)?; @@ -39,9 +43,12 @@ fn relocate_to_bootable_bank( constants: &mut LinkerScriptConstants, configuration: &Configuration, ) -> Result<()> { - let bootable_address = configuration.memory_configuration.bootable_address().ok_or(anyhow!( - "Impossible to relocate: bootable bank is undefined in configuration file." - ))?; + let bootable_address = configuration + .memory_configuration + .bootable_address() + .ok_or_else(|| { + anyhow!("Impossible to relocate: bootable bank is undefined in configuration file.") + })?; let offset = bootable_address - constants.flash.origin; constants.flash.size = constants.flash.size.saturating_sub(offset as usize); constants.flash.origin = bootable_address; diff --git a/loadstone_config/src/codegen/memory_map.rs b/loadstone_config/src/codegen/memory_map.rs index 0af8a4d5..e7954267 100644 --- a/loadstone_config/src/codegen/memory_map.rs +++ b/loadstone_config/src/codegen/memory_map.rs @@ -19,9 +19,13 @@ pub fn generate>( ) -> Result<()> { validate_bank_count(memory_configuration)?; let filename = autogenerated_folder_path.as_ref().join("memory_map.rs"); - let mut file = OpenOptions::new().write(true).create(true).truncate(true).open(&filename)?; + let mut file = OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(&filename)?; let base_index = 1usize; - let imports = generate_imports(&memory_configuration, port)?; + let imports = generate_imports(memory_configuration, port)?; let mcu_banks = generate_mcu_banks( base_index, &memory_configuration.internal_memory_map, @@ -47,7 +51,10 @@ fn validate_bank_count(configuration: &MemoryConfiguration) -> Result<()> { Ok(()) } else { Err(anyhow::format_err!( - "A bank count greater than {} is not supported (found {}).", u8::MAX, count)) + "A bank count greater than {} is not supported (found {}).", + u8::MAX, + count + )) } } @@ -100,13 +107,22 @@ fn generate_external_banks( golden_index: Option, ) -> Result { let number_of_external_banks = map.banks.len(); - let index: Vec = - map.banks.iter().enumerate().map(|(i, _)| (i + base_index) as u8).collect(); + let index: Vec = map + .banks + .iter() + .enumerate() + .map(|(i, _)| (i + base_index) as u8) + .collect(); let bootable = vec![false; number_of_external_banks]; let location: Vec = map.banks.iter().map(|b| b.start_address).collect(); - let size: Vec = map.banks.iter().map(|b| (b.size_kb * 1024) as usize).collect(); - let golden: Vec = - (0..number_of_external_banks).map(|i| Some((i + base_index).saturating_sub(1)) == golden_index).collect(); + let size: Vec = map + .banks + .iter() + .map(|b| (b.size_kb * 1024) as usize) + .collect(); + let golden: Vec = (0..number_of_external_banks) + .map(|i| Some((i + base_index).saturating_sub(1)) == golden_index) + .collect(); let code = quote! { const NUMBER_OF_EXTERNAL_BANKS: usize = #number_of_external_banks; @@ -129,13 +145,24 @@ fn generate_mcu_banks( golden_index: Option, ) -> Result { let number_of_mcu_banks = map.banks.len(); - let index: Vec = - map.banks.iter().enumerate().map(|(i, _)| (i + base_index) as u8).collect(); - let bootable: Vec = - (0..number_of_mcu_banks).map(|i| Some(i) == map.bootable_index).collect(); + let index: Vec = map + .banks + .iter() + .enumerate() + .map(|(i, _)| (i + base_index) as u8) + .collect(); + let bootable: Vec = (0..number_of_mcu_banks) + .map(|i| Some(i) == map.bootable_index) + .collect(); let location: Vec = map.banks.iter().map(|b| b.start_address).collect(); - let size: Vec = map.banks.iter().map(|b| (b.size_kb * 1024) as usize).collect(); - let golden: Vec = (0..number_of_mcu_banks).map(|i| Some(i) == golden_index).collect(); + let size: Vec = map + .banks + .iter() + .map(|b| (b.size_kb * 1024) as usize) + .collect(); + let golden: Vec = (0..number_of_mcu_banks) + .map(|i| Some(i) == golden_index) + .collect(); let code = quote! { const NUMBER_OF_MCU_BANKS: usize = #number_of_mcu_banks; diff --git a/loadstone_config/src/codegen/mod.rs b/loadstone_config/src/codegen/mod.rs index 70d42b19..4ece7105 100644 --- a/loadstone_config/src/codegen/mod.rs +++ b/loadstone_config/src/codegen/mod.rs @@ -2,24 +2,28 @@ //! concrete Loadstone modules are constructed from user configuration //! gathered from the web app GUI. use p256::ecdsa::VerifyingKey; -use std::str::FromStr; use quote::{__private::Span, quote}; use std::{ fs::{self, OpenOptions}, io::{self, Write}, path::Path, process::Command, + str::FromStr, }; use syn::LitStr; -use crate::{Configuration, features::{BootMetrics, Greetings, Serial, UpdateSignal}, security::SecurityMode}; +use crate::{ + features::{BootMetrics, Greetings, Serial, UpdateSignal}, + security::SecurityMode, + Configuration, +}; use anyhow::Result; use self::linker_script::generate_linker_script; -mod memory_map; +mod devices; mod linker_script; +mod memory_map; mod pins; -mod devices; /// Transforms a `Configuration` struct into a set of source code files /// that will be compiled into `Loadstone`. The resulting source is written @@ -28,11 +32,11 @@ pub fn generate_modules>( loadstone_path: P, configuration: &Configuration, ) -> Result<()> { - let autogenerated_folder_path = loadstone_path.as_ref().join( - format!("src/ports/{}/autogenerated", configuration.port) - ); + let autogenerated_folder_path = loadstone_path + .as_ref() + .join(format!("src/ports/{}/autogenerated", configuration.port)); fs::create_dir(&autogenerated_folder_path).ok(); - generate_linker_script(&configuration)?; + generate_linker_script(configuration)?; generate_top_level_module(&autogenerated_folder_path, configuration)?; if std::env::var("CARGO_FEATURE_ECDSA_VERIFY").is_ok() { @@ -43,25 +47,29 @@ pub fn generate_modules>( &configuration.memory_configuration, &configuration.port, )?; - pins::generate(&autogenerated_folder_path, &configuration)?; - devices::generate(&autogenerated_folder_path, &configuration)?; + pins::generate(&autogenerated_folder_path, configuration)?; + devices::generate(&autogenerated_folder_path, configuration)?; Ok(()) } /// Generates a public key file under the `src/devices/assets/` folder. fn generate_key>(loadstone_path: P, configuration: &Configuration) -> Result<()> { - assert!(configuration.security_configuration.security_mode == SecurityMode::P256ECDSA, - "Configuration mismatch: Config file requires ECDSA verification, but feature is disabled"); + assert!( + configuration.security_configuration.security_mode == SecurityMode::P256ECDSA, + "Configuration mismatch: Config file requires ECDSA verification, but feature is disabled" + ); fs::create_dir(loadstone_path.as_ref().join("src/devices/assets/")).ok(); - let key_path = loadstone_path.as_ref().join( - "src/devices/assets/key.sec1" - ); + let key_path = loadstone_path.as_ref().join("src/devices/assets/key.sec1"); let key = VerifyingKey::from_str(&configuration.security_configuration.verifying_key_raw) .expect("Supplied public key is not valid"); - let mut file = OpenOptions::new().write(true).create(true).truncate(true).open(&key_path)?; + let mut file = OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(&key_path)?; file.write_all(key.to_encoded_point(false).as_bytes())?; Ok(()) } @@ -73,10 +81,15 @@ fn generate_top_level_module>( configuration: &Configuration, ) -> Result<()> { let filename = autogenerated_folder_path.as_ref().join("mod.rs"); - let mut file = OpenOptions::new().write(true).create(true).truncate(true).open(&filename)?; - - let (serial_enabled, recovery_enabled) = if let Serial::Enabled { recovery_enabled, .. } = - configuration.feature_configuration.serial + let mut file = OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(&filename)?; + + let (serial_enabled, recovery_enabled) = if let Serial::Enabled { + recovery_enabled, .. + } = configuration.feature_configuration.serial { if !Serial::supported(&configuration.port) { panic!( @@ -105,11 +118,11 @@ fn generate_top_level_module>( let loadstone_greeting = match &configuration.feature_configuration.greetings { Greetings::Default => LitStr::new("-- Loadstone --", Span::call_site()), - Greetings::Custom { loadstone,..} => LitStr::new(&loadstone, Span::call_site()), + Greetings::Custom { loadstone, .. } => LitStr::new(loadstone, Span::call_site()), }; let demo_app_greeting = match &configuration.feature_configuration.greetings { Greetings::Default => LitStr::new("-- Loadstone Demo App --", Span::call_site()), - Greetings::Custom { demo,..} => LitStr::new(&demo, Span::call_site()), + Greetings::Custom { demo, .. } => LitStr::new(demo, Span::call_site()), }; let update_signal = configuration.feature_configuration.update_signal; diff --git a/loadstone_config/src/codegen/pins/mod.rs b/loadstone_config/src/codegen/pins/mod.rs index 9c3e95fc..2bc3216a 100644 --- a/loadstone_config/src/codegen/pins/mod.rs +++ b/loadstone_config/src/codegen/pins/mod.rs @@ -16,8 +16,14 @@ pub fn generate>( autogenerated_folder_path: P, configuration: &Configuration, ) -> Result<()> { - let filename = autogenerated_folder_path.as_ref().join("pin_configuration.rs"); - let mut file = OpenOptions::new().write(true).create(true).truncate(true).open(&filename)?; + let filename = autogenerated_folder_path + .as_ref() + .join("pin_configuration.rs"); + let mut file = OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(&filename)?; match configuration.port.subfamily() { port::Subfamily::Stm32f4 => stm32::generate_stm32f4_pins(configuration, &mut file)?, diff --git a/loadstone_config/src/codegen/pins/stm32.rs b/loadstone_config/src/codegen/pins/stm32.rs index e33deff6..dbca94ae 100644 --- a/loadstone_config/src/codegen/pins/stm32.rs +++ b/loadstone_config/src/codegen/pins/stm32.rs @@ -1,10 +1,10 @@ use anyhow::Result; use itertools::Itertools; -use quote::{TokenStreamExt, format_ident, quote}; +use quote::{format_ident, quote, TokenStreamExt}; use std::{fs::File, io::Write, iter::empty}; use syn::{Ident, Index}; -use crate::{Configuration, features::Serial, pins::QspiPins}; +use crate::{features::Serial, pins::QspiPins, Configuration}; struct SerialPinTokens { bank: char, @@ -37,9 +37,12 @@ pub fn generate_stm32f4_pins(configuration: &Configuration, file: &mut File) -> fn generate_pin_constructor( configuration: &Configuration, code: &mut quote::__private::TokenStream, -) -> () { +) { let banks = 'a'..='h'; - let gpio_fields = banks.clone().map(|b| format_ident!("gpio{}", b)).collect_vec(); + let gpio_fields = banks + .clone() + .map(|b| format_ident!("gpio{}", b)) + .collect_vec(); let pac_gpio_fields = banks.map(|b| format_ident!("GPIO{}", b.to_uppercase().next().unwrap())); let serial_pin_structs: Box> = @@ -64,13 +67,11 @@ fn generate_pin_constructor( Box::new(None.into_iter()) }; - let qspi_pin_structs = qspi_flash_pin_tokens(configuration).map(|p| { - format_ident!("gpio{}", p.bank) - }); + let qspi_pin_structs = + qspi_flash_pin_tokens(configuration).map(|p| format_ident!("gpio{}", p.bank)); - let qspi_pin_fields = qspi_flash_pin_tokens(configuration).map(|p| { - format_ident!("p{}{}", p.bank, p.index) - }); + let qspi_pin_fields = + qspi_flash_pin_tokens(configuration).map(|p| format_ident!("p{}{}", p.bank, p.index)); code.append_all(quote! { #[allow(unused)] @@ -112,14 +113,11 @@ fn generate_imports_and_types( pub type Serial = blue_hal::hal::null::NullSerial; }); } - if let Some(_) = &configuration.memory_configuration.external_flash { - let qspi_pins = qspi_flash_pin_tokens(configuration).map(|p| { - format_ident!("P{}{}", p.bank, p.index) - }); + if configuration.memory_configuration.external_flash.is_some() { + let qspi_pins = + qspi_flash_pin_tokens(configuration).map(|p| format_ident!("P{}{}", p.bank, p.index)); - let qspi_modes = qspi_flash_pin_tokens(configuration).map(|p| { - p.mode - }); + let qspi_modes = qspi_flash_pin_tokens(configuration).map(|p| p.mode); code.append_all(quote! { use blue_hal::drivers::micron::n25q128a_flash::MicronN25q128a; @@ -150,9 +148,12 @@ fn generate_imports_and_types( fn generate_gpio_macros(configuration: &Configuration, code: &mut quote::__private::TokenStream) { for bank in 'a'..='h' { - let serial_tokens = serial_tokens(configuration).filter(|t| t.bank == bank).collect_vec(); - let qspi_flash_pin_tokens = - qspi_flash_pin_tokens(configuration).filter(|t| t.bank == bank).collect_vec(); + let serial_tokens = serial_tokens(configuration) + .filter(|t| t.bank == bank) + .collect_vec(); + let qspi_flash_pin_tokens = qspi_flash_pin_tokens(configuration) + .filter(|t| t.bank == bank) + .collect_vec(); let serial_index = serial_tokens.iter().map(|t| &t.index); let serial_mode = serial_tokens.iter().map(|t| &t.mode); @@ -178,14 +179,14 @@ fn serial_tokens(configuration: &Configuration) -> Box, demo: Cow<'static, str> } + Custom { + loadstone: Cow<'static, str>, + demo: Cow<'static, str>, + }, } impl Default for Greetings { - fn default() -> Self { Self::Default } + fn default() -> Self { + Self::Default + } } impl Default for BootMetrics { - fn default() -> Self { Self::Disabled } + fn default() -> Self { + Self::Disabled + } } impl BootMetrics { @@ -64,13 +71,15 @@ pub enum Serial { /// Hardware pin for serial transmission (from loadstone's perspective). tx_pin: PeripheralPin, /// Hardware pin for serial reception (from loadstone's perspective). - rx_pin: PeripheralPin + rx_pin: PeripheralPin, }, Disabled, } impl Default for Serial { - fn default() -> Self { Self::Disabled } + fn default() -> Self { + Self::Disabled + } } impl Serial { @@ -83,7 +92,9 @@ impl Serial { } } - pub fn enabled(&self) -> bool { matches!(self, Serial::Enabled { .. }) } + pub fn enabled(&self) -> bool { + matches!(self, Serial::Enabled { .. }) + } } #[derive(Copy, Clone, Debug, Serialize, Deserialize)] @@ -93,5 +104,7 @@ pub enum UpdateSignal { } impl Default for UpdateSignal { - fn default() -> Self { UpdateSignal::Disabled } + fn default() -> Self { + UpdateSignal::Disabled + } } diff --git a/loadstone_config/src/lib.rs b/loadstone_config/src/lib.rs index ac114c97..0f8ff02c 100644 --- a/loadstone_config/src/lib.rs +++ b/loadstone_config/src/lib.rs @@ -6,9 +6,6 @@ //! uses this dependency to help generate the code that Loadstone includes //! (things like feature flags, memory map configuration, etc). -#![feature(stmt_expr_attributes)] -#![feature(bool_to_option)] - use std::fmt::Display; use features::{BootMetrics, FeatureConfiguration, Serial}; @@ -17,12 +14,12 @@ use port::Port; use security::{SecurityConfiguration, SecurityMode}; use serde::{Deserialize, Serialize}; -pub mod port; -pub mod pins; -pub mod memory; +pub mod codegen; pub mod features; +pub mod memory; +pub mod pins; +pub mod port; pub mod security; -pub mod codegen; #[derive(Serialize, Deserialize, Default, Debug)] /// Defines all configuration for a "codegen" loadstone port. This struct @@ -43,7 +40,9 @@ pub struct Configuration { impl Configuration { /// True if the configuration is comprehensive enough to generate a loadstone binary. - pub fn complete(&self) -> bool { self.required_configuration_steps().count() == 0 } + pub fn complete(&self) -> bool { + self.required_configuration_steps().count() == 0 + } /// Returns an iterator over the feature flags that will be necessary to compile loadstone /// when using this configuration struct. @@ -64,15 +63,15 @@ impl Configuration { /// Missing configuration steps to have enough information to generate a loadstone binary. pub fn required_configuration_steps(&self) -> impl Iterator { - #[rustfmt::skip] IntoIterator::into_iter([ - self.memory_configuration.internal_memory_map.bootable_index.is_none() + self.memory_configuration + .internal_memory_map + .bootable_index + .is_none() .then_some(RequiredConfigurationStep::BootableBank), - (self.security_configuration.security_mode == SecurityMode::P256ECDSA && self.security_configuration.verifying_key_raw.is_empty()) - .then_some(RequiredConfigurationStep::PublicKey), - + .then_some(RequiredConfigurationStep::PublicKey), ]) .flatten() } @@ -85,18 +84,27 @@ impl Configuration { self.feature_configuration.serial = Serial::Disabled; } - self.memory_configuration.internal_memory_map.banks.truncate(u8::MAX as usize); - let max_external_banks = (u8::MAX as usize) - - self.memory_configuration.internal_memory_map.banks.len(); - self.memory_configuration.external_memory_map.banks.truncate(max_external_banks); + self.memory_configuration + .internal_memory_map + .banks + .truncate(u8::MAX as usize); + let max_external_banks = + (u8::MAX as usize) - self.memory_configuration.internal_memory_map.banks.len(); + self.memory_configuration + .external_memory_map + .banks + .truncate(max_external_banks); if !features::BootMetrics::timing_supported(&self.port) { - if let BootMetrics::Enabled{timing} = &mut self.feature_configuration.boot_metrics { + if let BootMetrics::Enabled { timing } = &mut self.feature_configuration.boot_metrics { *timing = false } } - if !matches!(self.security_configuration.security_mode, SecurityMode::P256ECDSA) { + if !matches!( + self.security_configuration.security_mode, + SecurityMode::P256ECDSA + ) { self.security_configuration.verifying_key_raw.clear(); } diff --git a/loadstone_config/src/memory.rs b/loadstone_config/src/memory.rs index 271ebcb7..3305148e 100644 --- a/loadstone_config/src/memory.rs +++ b/loadstone_config/src/memory.rs @@ -22,7 +22,9 @@ pub struct Bank { impl Bank { /// Address immediately after the end of this bank. - pub fn end_address(&self) -> u32 { self.start_address + self.size_kb * 1024 } + pub fn end_address(&self) -> u32 { + self.start_address + self.size_kb * 1024 + } } /// Memory map for an internal (MCU) flash. This must contain the loadstone bootloader itself @@ -79,7 +81,7 @@ impl MemoryConfiguration { } /// Definition of a flash chip's hardware. -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct FlashChip { /// Tag to identify the hardware. pub name: String, diff --git a/loadstone_config/src/pins.rs b/loadstone_config/src/pins.rs index 846e3b65..0ac660a9 100644 --- a/loadstone_config/src/pins.rs +++ b/loadstone_config/src/pins.rs @@ -26,7 +26,12 @@ pub struct PeripheralPin { impl PeripheralPin { const fn new(peripheral: Cow<'static, str>, bank: Bank, index: u32, af_index: u32) -> Self { - Self { peripheral, bank, index, af_index } + Self { + peripheral, + bank, + index, + af_index, + } } } @@ -88,12 +93,42 @@ impl QspiPins { pub fn create(port: Port) -> Self { assert!(matches!(port, Port::Stm32F412)); QspiPins { - clk: PeripheralPin { peripheral: "QSPI".into(), bank: "b".into(), index: 2, af_index: 9 }, - bk1_cs: PeripheralPin { peripheral: "QSPI".into(), bank: "g".into(), index: 6, af_index: 10 }, - bk1_io0: PeripheralPin { peripheral: "QSPI".into(), bank: "f".into(), index: 8, af_index: 10 }, - bk1_io1: PeripheralPin { peripheral: "QSPI".into(), bank: "f".into(), index: 9, af_index: 10 }, - bk1_io2: PeripheralPin { peripheral: "QSPI".into(), bank: "f".into(), index: 7, af_index: 9 }, - bk1_io3: PeripheralPin { peripheral: "QSPI".into(), bank: "f".into(), index: 6, af_index: 9 }, + clk: PeripheralPin { + peripheral: "QSPI".into(), + bank: "b".into(), + index: 2, + af_index: 9, + }, + bk1_cs: PeripheralPin { + peripheral: "QSPI".into(), + bank: "g".into(), + index: 6, + af_index: 10, + }, + bk1_io0: PeripheralPin { + peripheral: "QSPI".into(), + bank: "f".into(), + index: 8, + af_index: 10, + }, + bk1_io1: PeripheralPin { + peripheral: "QSPI".into(), + bank: "f".into(), + index: 9, + af_index: 10, + }, + bk1_io2: PeripheralPin { + peripheral: "QSPI".into(), + bank: "f".into(), + index: 7, + af_index: 9, + }, + bk1_io3: PeripheralPin { + peripheral: "QSPI".into(), + bank: "f".into(), + index: 6, + af_index: 9, + }, } } } diff --git a/loadstone_config/src/port.rs b/loadstone_config/src/port.rs index c058147e..ee17fff5 100644 --- a/loadstone_config/src/port.rs +++ b/loadstone_config/src/port.rs @@ -16,7 +16,9 @@ pub enum Port { impl Default for Port { // Arbitrary default port for the purposes of seeding // the defaults in the web application - fn default() -> Self { Self::Stm32F412 } + fn default() -> Self { + Self::Stm32F412 + } } /// Supported hardware families. @@ -90,16 +92,34 @@ impl Port { pub fn linker_script_constants(&self) -> Option { match self { Port::Stm32F412 => Some(LinkerScriptConstants { - flash: LinkerArea { origin: 0x08000000, size: KB!(896) }, - ram: LinkerArea { origin: 0x20000000, size: KB!(256) }, + flash: LinkerArea { + origin: 0x08000000, + size: KB!(896), + }, + ram: LinkerArea { + origin: 0x20000000, + size: KB!(256), + }, }), Port::Wgm160P => Some(LinkerScriptConstants { - flash: LinkerArea { origin: 0x00000000, size: KB!(1024) }, - ram: LinkerArea { origin: 0x20000000, size: KB!(128) }, + flash: LinkerArea { + origin: 0x00000000, + size: KB!(1024), + }, + ram: LinkerArea { + origin: 0x20000000, + size: KB!(128), + }, }), Port::Max32631 => Some(LinkerScriptConstants { - flash: LinkerArea { origin: 0x00000000, size: KB!(2048) }, - ram: LinkerArea { origin: 0x20000000, size: KB!(512) }, + flash: LinkerArea { + origin: 0x00000000, + size: KB!(2048), + }, + ram: LinkerArea { + origin: 0x20000000, + size: KB!(512), + }, }), } } diff --git a/loadstone_config/src/security.rs b/loadstone_config/src/security.rs index 93ea52ae..442f8471 100644 --- a/loadstone_config/src/security.rs +++ b/loadstone_config/src/security.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum SecurityMode { /// Enforces image integrity through a cyclical redundancy check. /// This only helps against unintentional corruption, and doesn't @@ -12,7 +12,9 @@ pub enum SecurityMode { } impl Default for SecurityMode { - fn default() -> Self { SecurityMode::P256ECDSA } + fn default() -> Self { + SecurityMode::P256ECDSA + } } /// Defines how Loadstone will aproach guaranteeing image security diff --git a/loadstone_front/Cargo.lock b/loadstone_front/Cargo.lock deleted file mode 100644 index 8aae2cea..00000000 --- a/loadstone_front/Cargo.lock +++ /dev/null @@ -1,2885 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ab_glyph" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af0ac006645f86f20f6c6fa4dcaef920bf803df819123626f9440e35835e7d80" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser 0.12.1", -] - -[[package]] -name = "ab_glyph_rasterizer" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" - -[[package]] -name = "addr2line" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "andrew" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" -dependencies = [ - "bitflags", - "rusttype", - "walkdir", - "xdg", - "xml-rs", -] - -[[package]] -name = "android_glue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" - -[[package]] -name = "anyhow" -version = "1.0.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61" - -[[package]] -name = "atomic_refcell" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681b971236e0f76b20fcafca0236b8718c9186ee778d67cd78bd5f28fd85427f" - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "backtrace" -version = "0.3.59" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4717cfcbfaa661a0fd48f8453951837ae7e8f81e481fbb136e3202d72805a744" -dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "base64ct" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d27fb6b6f1e43147af148af49d49329413ba781aa0d5e10979831c210173b5" - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "bitvec" -version = "0.20.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bumpalo" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" - -[[package]] -name = "bytes" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" - -[[package]] -name = "calloop" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" -dependencies = [ - "log", - "nix 0.18.0", -] - -[[package]] -name = "cc" -version = "1.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cgl" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" -dependencies = [ - "libc", -] - -[[package]] -name = "chunked_transfer" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" - -[[package]] -name = "clipboard-win" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fdf5e01086b6be750428ba4a40619f847eb2e95756eee84b18e06e5f0b50342" -dependencies = [ - "lazy-bytes-cast", - "winapi", -] - -[[package]] -name = "cocoa" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" -dependencies = [ - "bitflags", - "block", - "cocoa-foundation", - "core-foundation 0.9.1", - "core-graphics 0.22.2", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "cocoa-foundation" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" -dependencies = [ - "bitflags", - "block", - "core-foundation 0.9.1", - "core-graphics-types", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "const-oid" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279bc8fc53f788a75c7804af68237d1fce02cde1e275a886a4b320604dc2aeda" - -[[package]] -name = "const-oid" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c32f031ea41b4291d695026c023b95d59db2d8a2c7640800ed56bc8f510f22" - -[[package]] -name = "copypasta" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4423d79fed83ebd9ab81ec21fa97144300a961782158287dc9bf7eddac37ff0b" -dependencies = [ - "clipboard-win", - "objc", - "objc-foundation", - "objc_id", - "smithay-clipboard", - "x11-clipboard", -] - -[[package]] -name = "core-foundation" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] - -[[package]] -name = "core-foundation" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" -dependencies = [ - "core-foundation-sys 0.8.2", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - -[[package]] -name = "core-foundation-sys" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" - -[[package]] -name = "core-graphics" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" -dependencies = [ - "bitflags", - "core-foundation 0.7.0", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics" -version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" -dependencies = [ - "bitflags", - "core-foundation 0.9.1", - "core-graphics-types", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" -dependencies = [ - "bitflags", - "core-foundation 0.9.1", - "foreign-types", - "libc", -] - -[[package]] -name = "core-video-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" -dependencies = [ - "cfg-if 0.1.10", - "core-foundation-sys 0.7.0", - "core-graphics 0.19.2", - "libc", - "objc", -] - -[[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" -dependencies = [ - "cfg-if 1.0.0", - "lazy_static", -] - -[[package]] -name = "crypto-bigint" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32a398eb1ccfbe7e4f452bc749c44d38dd732e9a253f19da224c416f00ee7f4" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-mac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "darling" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "der" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eeb9d92785d1facb50567852ce75d0858630630e7eabea59cf7eb7474051087" -dependencies = [ - "const-oid 0.5.2", - "typenum", -] - -[[package]] -name = "der" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f215f706081a44cb702c71c39a52c05da637822e9c1645a50b7202689e982d" -dependencies = [ - "const-oid 0.6.0", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "directories-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dispatch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" - -[[package]] -name = "dlib" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" -dependencies = [ - "libloading 0.6.7", -] - -[[package]] -name = "dlib" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" -dependencies = [ - "libloading 0.7.0", -] - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "ecdsa" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d33b390ab82f2e1481e331dbd0530895640179d2128ef9a79cc690b78d1eba" -dependencies = [ - "der 0.3.5", - "elliptic-curve 0.9.12", - "hmac", - "signature", -] - -[[package]] -name = "ecdsa" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cb0ed2d2ce37766ac86c05f66973ace8c51f7f1533bedce8fb79e2b54b3f14" -dependencies = [ - "der 0.4.0", - "elliptic-curve 0.10.3", - "hmac", - "signature", -] - -[[package]] -name = "eframe" -version = "0.13.1" -source = "git+https://github.com/emilk/egui.git#7c5a2d60c5d000f193bc7b16c5a53c059fee8259" -dependencies = [ - "egui", - "egui_glium", - "egui_web", - "epi", -] - -[[package]] -name = "egui" -version = "0.13.1" -source = "git+https://github.com/emilk/egui.git#7c5a2d60c5d000f193bc7b16c5a53c059fee8259" -dependencies = [ - "epaint", - "ron", - "serde", -] - -[[package]] -name = "egui_glium" -version = "0.13.1" -source = "git+https://github.com/emilk/egui.git#7c5a2d60c5d000f193bc7b16c5a53c059fee8259" -dependencies = [ - "copypasta", - "directories-next", - "egui", - "epi", - "glium", - "ron", - "serde", - "ureq", - "webbrowser", -] - -[[package]] -name = "egui_web" -version = "0.13.0" -source = "git+https://github.com/emilk/egui.git#7c5a2d60c5d000f193bc7b16c5a53c059fee8259" -dependencies = [ - "egui", - "epi", - "js-sys", - "ron", - "serde", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "elliptic-curve" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13e9b0c3c4170dcc2a12783746c4205d98e18957f57854251eea3f9750fe005" -dependencies = [ - "bitvec", - "ff 0.9.0", - "generic-array", - "group 0.9.0", - "pkcs8 0.6.1", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "elliptic-curve" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd035cb119cbc25e91bb6f1abbfe341388ddb47a1fe5e77ca6bcbe231e87580b" -dependencies = [ - "crypto-bigint", - "ff 0.10.0", - "generic-array", - "group 0.10.0", - "pkcs8 0.7.0", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "emath" -version = "0.13.0" -source = "git+https://github.com/emilk/egui.git#7c5a2d60c5d000f193bc7b16c5a53c059fee8259" -dependencies = [ - "serde", -] - -[[package]] -name = "encoding_rs" -version = "0.8.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "enum-iterator" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79a6321a1197d7730510c7e3f6cb80432dfefecb32426de8cea0aa19b4bb8d7" -dependencies = [ - "enum-iterator-derive", -] - -[[package]] -name = "enum-iterator-derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e94aa31f7c0dc764f57896dc615ddd76fc13b0d5dca7eb6cc5e018a5a09ec06" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "epaint" -version = "0.13.0" -source = "git+https://github.com/emilk/egui.git#7c5a2d60c5d000f193bc7b16c5a53c059fee8259" -dependencies = [ - "ab_glyph", - "ahash", - "atomic_refcell", - "emath", - "ordered-float", - "serde", -] - -[[package]] -name = "epi" -version = "0.13.0" -source = "git+https://github.com/emilk/egui.git#7c5a2d60c5d000f193bc7b16c5a53c059fee8259" -dependencies = [ - "egui", - "ron", - "serde", -] - -[[package]] -name = "ff" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a4d941a5b7c2a75222e2d44fcdf634a67133d9db31e177ae5ff6ecda852bfe" -dependencies = [ - "bitvec", - "rand_core", - "subtle", -] - -[[package]] -name = "ff" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63eec06c61e487eecf0f7e6e6372e596a81922c28d33e645d6983ca6493a1af0" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" -dependencies = [ - "matches", - "percent-encoding", -] - -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - -[[package]] -name = "futures" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" - -[[package]] -name = "futures-executor" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" - -[[package]] -name = "futures-macro" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" -dependencies = [ - "autocfg", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" - -[[package]] -name = "futures-task" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" - -[[package]] -name = "futures-util" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" -dependencies = [ - "autocfg", - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "proc-macro-hack", - "proc-macro-nested", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "gimli" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" - -[[package]] -name = "git-version" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94918e83f1e01dedc2e361d00ce9487b14c58c7f40bab148026fa39d42cb41e2" -dependencies = [ - "git-version-macro", - "proc-macro-hack", -] - -[[package]] -name = "git-version-macro" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34a97a52fdee1870a34fa6e4b77570cba531b27d1838874fef4429a791a3d657" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "gl_generator" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" -dependencies = [ - "khronos_api", - "log", - "xml-rs", -] - -[[package]] -name = "glium" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121963a5cab2890cbf7025739c00aba703ee18cd389d838fc603a1e6d115390c" -dependencies = [ - "backtrace", - "fnv", - "gl_generator", - "glutin", - "lazy_static", - "memoffset", - "smallvec", - "takeable-option", -] - -[[package]] -name = "glutin" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762d6cd2e1b855d99668ebe591cc9058659d85ac39a9a2078000eb122ddba8f0" -dependencies = [ - "android_glue", - "cgl", - "cocoa", - "core-foundation 0.9.1", - "glutin_egl_sys", - "glutin_emscripten_sys", - "glutin_gles2_sys", - "glutin_glx_sys", - "glutin_wgl_sys", - "lazy_static", - "libloading 0.7.0", - "log", - "objc", - "osmesa-sys", - "parking_lot", - "wayland-client", - "wayland-egl", - "winapi", - "winit", -] - -[[package]] -name = "glutin_egl_sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2abb6aa55523480c4adc5a56bbaa249992e2dddb2fc63dc96e04a3355364c211" -dependencies = [ - "gl_generator", - "winapi", -] - -[[package]] -name = "glutin_emscripten_sys" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80de4146df76e8a6c32b03007bc764ff3249dcaeb4f675d68a06caf1bac363f1" - -[[package]] -name = "glutin_gles2_sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" -dependencies = [ - "gl_generator", - "objc", -] - -[[package]] -name = "glutin_glx_sys" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e393c8fc02b807459410429150e9c4faffdb312d59b8c038566173c81991351" -dependencies = [ - "gl_generator", - "x11-dl", -] - -[[package]] -name = "glutin_wgl_sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" -dependencies = [ - "gl_generator", -] - -[[package]] -name = "group" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3c1e8b4f1ca07e6605ea1be903a5f6956aec5c8a67fd44d56076631675ed8" -dependencies = [ - "ff 0.9.0", - "rand_core", - "subtle", -] - -[[package]] -name = "group" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c363a5301b8f153d80747126a04b3c82073b9fe3130571a9d170cacdeaf7912" -dependencies = [ - "ff 0.10.0", - "rand_core", - "subtle", -] - -[[package]] -name = "h2" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest", -] - -[[package]] -name = "http" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" - -[[package]] -name = "httpdate" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" - -[[package]] -name = "hyper" -version = "0.14.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7728a72c4c7d72665fde02204bcbd93b247721025b222ef78606f14513e0fd03" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "instant" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "ipnet" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" - -[[package]] -name = "itertools" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - -[[package]] -name = "js-sys" -version = "0.3.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "khronos_api" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" - -[[package]] -name = "lazy-bytes-cast" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10257499f089cd156ad82d0a9cd57d9501fa2c989068992a97eb3c27836f206b" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" - -[[package]] -name = "libloading" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - -[[package]] -name = "libloading" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - -[[package]] -name = "loadstone_config" -version = "1.1.0" -dependencies = [ - "anyhow", - "ecdsa 0.11.1", - "enum-iterator", - "itertools", - "p256 0.8.1", - "quote", - "serde", - "sha2", - "syn", - "tightness", -] - -[[package]] -name = "loadstone_front" -version = "1.0.0" -dependencies = [ - "anyhow", - "atomic_refcell", - "base64", - "ecdsa 0.12.2", - "eframe", - "enum-iterator", - "futures", - "getrandom", - "git-version", - "itertools", - "loadstone_config", - "p256 0.9.0", - "reqwest-wasm", - "ron", - "serde", - "sha2", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "lock_api" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - -[[package]] -name = "memchr" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" - -[[package]] -name = "memmap2" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" -dependencies = [ - "libc", -] - -[[package]] -name = "memmap2" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -dependencies = [ - "autocfg", -] - -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - -[[package]] -name = "miniz_oxide" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] - -[[package]] -name = "mio" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" -dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "winapi", -] - -[[package]] -name = "mio-misc" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ddf05411bb159cdb5801bb10002afb66cb4572be656044315e363460ce69dc2" -dependencies = [ - "crossbeam", - "crossbeam-queue", - "log", - "mio", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", -] - -[[package]] -name = "native-tls" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "ndk" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" -dependencies = [ - "jni-sys", - "ndk-sys", - "num_enum", - "thiserror", -] - -[[package]] -name = "ndk-glue" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" -dependencies = [ - "lazy_static", - "libc", - "log", - "ndk", - "ndk-macro", - "ndk-sys", -] - -[[package]] -name = "ndk-macro" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" -dependencies = [ - "darling", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ndk-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" - -[[package]] -name = "nix" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" -dependencies = [ - "bitflags", - "cc", - "cfg-if 0.1.10", - "libc", -] - -[[package]] -name = "nix" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", -] - -[[package]] -name = "nom" -version = "6.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c5c51b9083a3c620fa67a2a635d1ce7d95b897e957d6b28ff9a5da960a103a6" -dependencies = [ - "memchr", - "version_check", -] - -[[package]] -name = "ntapi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" -dependencies = [ - "winapi", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b45a5c2ac4dd696ed30fa6b94b057ad909c7b7fc2e0d0808192bced894066" -dependencies = [ - "derivative", - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c0fd9eba1d5db0994a239e09c1be402d35622277e35468ba891aa5e3188ce7e" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", -] - -[[package]] -name = "objc-foundation" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" -dependencies = [ - "block", - "objc", - "objc_id", -] - -[[package]] -name = "objc_id" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" -dependencies = [ - "objc", -] - -[[package]] -name = "object" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170" - -[[package]] -name = "once_cell" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "openssl" -version = "0.10.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549430950c79ae24e6d02e0b7404534ecf311d94cc9f861e9e4020187d13d885" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-sys", -] - -[[package]] -name = "openssl-probe" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" - -[[package]] -name = "openssl-sys" -version = "0.9.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "ordered-float" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dea6388d3d5498ec651701f14edbaf463c924b5d8829fb2848ccf0bcc7b3c69" -dependencies = [ - "num-traits", -] - -[[package]] -name = "osmesa-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" -dependencies = [ - "shared_library", -] - -[[package]] -name = "owned_ttf_parser" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" -dependencies = [ - "ttf-parser 0.6.2", -] - -[[package]] -name = "owned_ttf_parser" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60ac8dda2e5cc09bf6480e3b3feff9783db251710c922ae9369a429c51efdeb0" -dependencies = [ - "ttf-parser 0.12.3", -] - -[[package]] -name = "p256" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f05f5287453297c4c16af5e2b04df8fd2a3008d70f252729650bc6d7ace5844" -dependencies = [ - "ecdsa 0.11.1", - "elliptic-curve 0.9.12", - "sha2", -] - -[[package]] -name = "p256" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d053368e1bae4c8a672953397bd1bd7183dde1c72b0b7612a15719173148d186" -dependencies = [ - "ecdsa 0.12.2", - "elliptic-curve 0.10.3", - "sha2", -] - -[[package]] -name = "parking_lot" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "paste" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pin-project-lite" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9c2f795bc591cb3384cb64082a578b89207ac92bb89c9d98c1ea2ace7cd8110" -dependencies = [ - "base64ct", - "der 0.3.5", - "spki 0.3.0", - "zeroize", -] - -[[package]] -name = "pkcs8" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d156817ae0125e8aa5067710b0db24f0984830614f99875a70aa5e3b74db69" -dependencies = [ - "base64ct", - "der 0.4.0", - "spki 0.4.0", - "zeroize", -] - -[[package]] -name = "pkg-config" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" - -[[package]] -name = "ppv-lite86" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" - -[[package]] -name = "proc-macro2" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" - -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core", -] - -[[package]] -name = "raw-window-handle" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" -dependencies = [ - "libc", -] - -[[package]] -name = "redox_syscall" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" -dependencies = [ - "getrandom", - "redox_syscall", -] - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "reqwest-wasm" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95c6f51c387d62928baa7c144f1e58a318ee8297c632ae224a9ba4ff9b39e12" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures", - "futures-core", - "futures-util", - "http", - "http-body", - "hyper", - "hyper-tls", - "ipnet", - "js-sys", - "lazy_static", - "log", - "mime", - "native-tls", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_urlencoded", - "tokio", - "tokio-native-tls", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin", - "untrusted", - "web-sys", - "winapi", -] - -[[package]] -name = "ron" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064ea8613fb712a19faf920022ec8ddf134984f100090764a4e1d768f3827f1f" -dependencies = [ - "base64", - "bitflags", - "serde", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" - -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64", - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rusttype" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser 0.6.0", -] - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" -dependencies = [ - "lazy_static", - "winapi", -] - -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "security-framework" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" -dependencies = [ - "bitflags", - "core-foundation 0.9.1", - "core-foundation-sys 0.8.2", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284" -dependencies = [ - "core-foundation-sys 0.8.2", - "libc", -] - -[[package]] -name = "serde" -version = "1.0.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" -dependencies = [ - "block-buffer", - "cfg-if 1.0.0", - "cpufeatures", - "digest", - "opaque-debug", -] - -[[package]] -name = "shared_library" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" -dependencies = [ - "lazy_static", - "libc", -] - -[[package]] -name = "signature" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335" -dependencies = [ - "digest", - "rand_core", -] - -[[package]] -name = "slab" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" - -[[package]] -name = "smallvec" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" - -[[package]] -name = "smithay-client-toolkit" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" -dependencies = [ - "andrew", - "bitflags", - "calloop", - "dlib 0.4.2", - "lazy_static", - "log", - "memmap2 0.1.0", - "nix 0.18.0", - "wayland-client", - "wayland-cursor", - "wayland-protocols", -] - -[[package]] -name = "smithay-client-toolkit" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec783683499a2cfc85b6df3d04f83b1907b5cbd98a1aed44667dbdf1eac4e64c" -dependencies = [ - "bitflags", - "dlib 0.5.0", - "lazy_static", - "log", - "memmap2 0.2.3", - "nix 0.20.0", - "wayland-client", - "wayland-cursor", - "wayland-protocols", -] - -[[package]] -name = "smithay-clipboard" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "986c5b4a7bd4f50d4c51f81f844745535cb488360f9cf63293780b109b9295f3" -dependencies = [ - "smithay-client-toolkit 0.14.0", - "wayland-client", -] - -[[package]] -name = "socket2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spki" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dae7e047abc519c96350e9484a96c6bf1492348af912fd3446dd2dc323f6268" -dependencies = [ - "der 0.3.5", -] - -[[package]] -name = "spki" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "987637c5ae6b3121aba9d513f869bd2bff11c4cc086c22473befd6649c0bd521" -dependencies = [ - "der 0.4.0", -] - -[[package]] -name = "strsim" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" - -[[package]] -name = "subtle" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" - -[[package]] -name = "syn" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "takeable-option" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ae8932fcfea38b7d3883ae2ab357b0d57a02caaa18ebb4f5ece08beaec4aa0" - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", -] - -[[package]] -name = "thiserror" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tightness" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40a70c25682cb49884e83a22dcaaf7c6574b3111948f645663a3ebbe7c6f366" -dependencies = [ - "paste", - "thiserror", -] - -[[package]] -name = "tinyvec" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "tokio" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c8b05dc14c75ea83d63dd391100353789f5f24b8b3866542a5e85c8be8e985" -dependencies = [ - "autocfg", - "bytes", - "libc", - "memchr", - "mio", - "pin-project-lite", - "winapi", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" -dependencies = [ - "serde", -] - -[[package]] -name = "tower-service" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" - -[[package]] -name = "tracing" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if 1.0.0", - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "try-lock" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" - -[[package]] -name = "ttf-parser" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" - -[[package]] -name = "ttf-parser" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae2f58a822f08abdaf668897e96a5656fe72f5a9ce66422423e8849384872e6" - -[[package]] -name = "typenum" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" - -[[package]] -name = "unicode-bidi" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" -dependencies = [ - "matches", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "ureq" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2475a6781e9bc546e7b64f4013d2f4032c8c6a40fcffd7c6f4ee734a890972ab" -dependencies = [ - "base64", - "chunked_transfer", - "log", - "once_cell", - "rustls", - "url", - "webpki", - "webpki-roots", -] - -[[package]] -name = "url" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" -dependencies = [ - "form_urlencoded", - "idna", - "matches", - "percent-encoding", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -dependencies = [ - "log", - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wasm-bindgen" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" -dependencies = [ - "cfg-if 1.0.0", - "serde", - "serde_json", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" - -[[package]] -name = "wayland-client" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" -dependencies = [ - "bitflags", - "downcast-rs", - "libc", - "nix 0.20.0", - "scoped-tls", - "wayland-commons", - "wayland-scanner", - "wayland-sys", -] - -[[package]] -name = "wayland-commons" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" -dependencies = [ - "nix 0.20.0", - "once_cell", - "smallvec", - "wayland-sys", -] - -[[package]] -name = "wayland-cursor" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" -dependencies = [ - "nix 0.20.0", - "wayland-client", - "xcursor", -] - -[[package]] -name = "wayland-egl" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ba1ab1e18756b23982d36f08856d521d7df45015f404a2d7c4f0b2d2f66956" -dependencies = [ - "wayland-client", - "wayland-sys", -] - -[[package]] -name = "wayland-protocols" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" -dependencies = [ - "bitflags", - "wayland-client", - "wayland-commons", - "wayland-scanner", -] - -[[package]] -name = "wayland-scanner" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" -dependencies = [ - "proc-macro2", - "quote", - "xml-rs", -] - -[[package]] -name = "wayland-sys" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" -dependencies = [ - "dlib 0.5.0", - "lazy_static", - "pkg-config", -] - -[[package]] -name = "web-sys" -version = "0.3.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webbrowser" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecad156490d6b620308ed411cfee90d280b3cbd13e189ea0d3fada8acc89158a" -dependencies = [ - "web-sys", - "widestring", - "winapi", -] - -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" -dependencies = [ - "webpki", -] - -[[package]] -name = "widestring" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "winit" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" -dependencies = [ - "bitflags", - "cocoa", - "core-foundation 0.9.1", - "core-graphics 0.22.2", - "core-video-sys", - "dispatch", - "instant", - "lazy_static", - "libc", - "log", - "mio", - "mio-misc", - "ndk", - "ndk-glue", - "ndk-sys", - "objc", - "parking_lot", - "percent-encoding", - "raw-window-handle", - "scopeguard", - "smithay-client-toolkit 0.12.3", - "wayland-client", - "winapi", - "x11-dl", -] - -[[package]] -name = "winreg" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" -dependencies = [ - "winapi", -] - -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - -[[package]] -name = "x11-clipboard" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b397ace6e980510de59a4fe3d4c758dffab231d6d747ce9fa1aba6b6035d5f32" -dependencies = [ - "xcb", -] - -[[package]] -name = "x11-dl" -version = "2.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" -dependencies = [ - "lazy_static", - "libc", - "maybe-uninit", - "pkg-config", -] - -[[package]] -name = "xcb" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62056f63138b39116f82a540c983cc11f1c90cd70b3d492a70c25eaa50bd22a6" -dependencies = [ - "libc", - "log", -] - -[[package]] -name = "xcursor" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9a231574ae78801646617cefd13bfe94be907c0e4fa979cfd8b770aa3c5d08" -dependencies = [ - "nom", -] - -[[package]] -name = "xdg" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" - -[[package]] -name = "xml-rs" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" - -[[package]] -name = "zeroize" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" diff --git a/loadstone_front/Cargo.toml b/loadstone_front/Cargo.toml deleted file mode 100644 index 3663b0b8..00000000 --- a/loadstone_front/Cargo.toml +++ /dev/null @@ -1,52 +0,0 @@ -[package] -name = "loadstone_front" -version = "1.0.0" -edition = "2018" -license = "MIT" -description = "Portable secure bootloader for Cortex-M MCUs - Builder Web App" -repository = "https://github.com/absw/loadstone" -readme = "README.md" -keywords = ["embedded", "bootloader", "cortex", "secure", "bare_metal"] -categories = ["embedded", "no-std"] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -crate-type = ["cdylib", "rlib"] - -[dependencies] -eframe = { git = "https://github.com/emilk/egui.git", features = ["http"] } # Gives us egui, epi and web+native backends -anyhow = "*" -itertools = "*" -serde = { version = "1.0", features = ["derive"] } -wasm-bindgen = { version = "*", features = ["serde-serialize"] } -web-sys = { version = "*", features = ["Blob", "BlobPropertyBag", "Url"] } -wasm-bindgen-futures = "*" -ron = "*" -base64 = "*" -git-version = "*" -reqwest-wasm = "*" -futures = "*" -loadstone_config = { path = "../loadstone_config/" } -atomic_refcell = "*" -enum-iterator = "*" -getrandom = { version = "*", features = ["js"] } - -[dependencies.ecdsa] -version = "*" -features = ["pem"] - -[dependencies.sha2] -version = "*" - -[dependencies.p256] -version = "*" -features = ["ecdsa", "sha256", "pem"] - -[features] -default = [] -http = ["eframe/http"] # Enable if you want to do http requests -persistence = ["eframe/persistence"] # Enable if you want to persist app state on shutdown - -[profile.release] -opt-level = 2 # fast and small wasm diff --git a/tools/Cargo.toml b/tools/Cargo.toml new file mode 100644 index 00000000..9ececf37 --- /dev/null +++ b/tools/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "confedit", + "loadstone_front", + "signing_tool", +] diff --git a/tools/confedit/Cargo.toml b/tools/confedit/Cargo.toml index 2c043fa5..5cfd2917 100644 --- a/tools/confedit/Cargo.toml +++ b/tools/confedit/Cargo.toml @@ -5,6 +5,6 @@ edition = "2018" [dependencies] loadstone_config = { path = "../../loadstone_config" } -ron = "*" -serde = "*" +ron = "0.6" +serde = "1" clap = "2" diff --git a/tools/confedit/src/main.rs b/tools/confedit/src/main.rs index 13dacd5f..c44553c3 100644 --- a/tools/confedit/src/main.rs +++ b/tools/confedit/src/main.rs @@ -1,6 +1,14 @@ -use std::{borrow::Cow, io::{Read, Write}}; use clap::clap_app; -use loadstone_config::{Configuration, features::{Greetings, Serial}, memory::Bank, security::{SecurityConfiguration, SecurityMode}}; +use loadstone_config::{ + features::{Greetings, Serial}, + memory::Bank, + security::{SecurityConfiguration, SecurityMode}, + Configuration, +}; +use std::{ + borrow::Cow, + io::{Read, Write}, +}; struct Arguments { internal_banks: Option>, @@ -35,7 +43,10 @@ fn get_input_configuration(string: String) -> Result { } } -fn modify_configuration(mut configuration: Configuration, arguments: Arguments) -> Result { +fn modify_configuration( + mut configuration: Configuration, + arguments: Arguments, +) -> Result { if let Some(greeting) = arguments.greeting { let old_demo = match configuration.feature_configuration.greetings { Greetings::Default => Cow::from(""), @@ -53,23 +64,39 @@ fn modify_configuration(mut configuration: Configuration, arguments: Arguments) } if let Some(bank) = arguments.bootable_bank { - configuration.memory_configuration.internal_memory_map.bootable_index = Some(bank); + configuration + .memory_configuration + .internal_memory_map + .bootable_index = Some(bank); } if let Some(recovery) = arguments.recovery { let serial = &mut configuration.feature_configuration.serial; - if let Serial::Enabled { recovery_enabled, .. } = serial { + if let Serial::Enabled { + recovery_enabled, .. + } = serial + { *recovery_enabled = recovery; } else { - return Err(String::from("cannot enable serial recovery since serial is not enabled")); + return Err(String::from( + "cannot enable serial recovery since serial is not enabled", + )); } } if let Some(banks) = arguments.internal_banks { - let mut offset = configuration.memory_configuration.internal_memory_map.bootloader_location - + (configuration.memory_configuration.internal_memory_map.bootloader_length_kb * 1024); + let mut offset = configuration + .memory_configuration + .internal_memory_map + .bootloader_location + + (configuration + .memory_configuration + .internal_memory_map + .bootloader_length_kb + * 1024); - configuration.memory_configuration.internal_memory_map.banks = banks.into_iter() + configuration.memory_configuration.internal_memory_map.banks = banks + .into_iter() .map(|size| { let bank = Bank { size_kb: size, @@ -77,13 +104,15 @@ fn modify_configuration(mut configuration: Configuration, arguments: Arguments) }; offset += size * 1024; bank - }).collect(); + }) + .collect(); } if let Some(banks) = arguments.external_banks { let mut offset = 0; - configuration.memory_configuration.external_memory_map.banks = banks.into_iter() + configuration.memory_configuration.external_memory_map.banks = banks + .into_iter() .map(|size| { let bank = Bank { size_kb: size, @@ -91,7 +120,8 @@ fn modify_configuration(mut configuration: Configuration, arguments: Arguments) }; offset += size * 1024; bank - }).collect(); + }) + .collect(); } Ok(configuration) @@ -103,7 +133,8 @@ fn get_output_string(configuration: Configuration) -> Result { } fn write_output_string(string: String) -> Result<(), String> { - std::io::stdout().write_all(string.as_bytes()) + std::io::stdout() + .write_all(string.as_bytes()) .map_err(|e| format!("failed to write output to standard output stream: {}.", e)) } @@ -128,13 +159,13 @@ fn to_decimal_digit(c: char) -> Option { '7' => Some(7), '8' => Some(8), '9' => Some(9), - _ => None + _ => None, } } fn parse_banks(string: &str) -> Result, String> { let mut sizes = Vec::new(); - let mut size : u32 = 0; + let mut size: u32 = 0; for c in string.chars() { if let Some(d) = to_decimal_digit(c) { size = (size * 10) + d; @@ -142,9 +173,12 @@ fn parse_banks(string: &str) -> Result, String> { sizes.push(size); size = 0; } else { - return Err(format!("bank size list expects decimal digits and commas, found {}.", c)) + return Err(format!( + "bank size list expects decimal digits and commas, found {}.", + c + )); } - }; + } if size > 0 { sizes.push(size); @@ -172,7 +206,8 @@ fn run_clap() -> Result { if s == "none" { Some(None) } else { - let n = s.parse::() + let n = s + .parse::() .map_err(|_| "--golden-bank expected an unsigned integer argument".to_string())?; Some(Some(n)) } @@ -183,10 +218,11 @@ fn run_clap() -> Result { let bootable_bank = match matches.value_of("bootable") { None => None, Some(string) => { - let n = string.parse::() + let n = string + .parse::() .map_err(|_| "--golden-bank expected an unsigned integer argument".to_string())?; Some(n) - }, + } }; let recovery = match matches.value_of("recovery") { diff --git a/tools/loadstone_front/Cargo.toml b/tools/loadstone_front/Cargo.toml new file mode 100644 index 00000000..56257128 --- /dev/null +++ b/tools/loadstone_front/Cargo.toml @@ -0,0 +1,64 @@ +[package] +name = "loadstone_front" +version = "1.0.0" +edition = "2018" +license = "MIT" +description = "Portable secure bootloader for Cortex-M MCUs - Builder Web App" +repository = "https://github.com/absw/loadstone" +readme = "README.md" +keywords = ["embedded", "bootloader", "cortex", "secure", "bare_metal"] +categories = ["embedded", "no-std"] + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +anyhow = "1" +itertools = "0.10" +wasm-bindgen-futures = "0.4" +ron = "0.6" +base64 = "0.13" +git-version = "0.3" +reqwest-wasm = "0.11" +futures = "0.3" +atomic_refcell = "0.1" +enum-iterator = "0.6" +sha2 = "0.9" + +[dependencies.loadstone_config] +path = "../../loadstone_config/" + +[dependencies.eframe] +# Gives us egui, epi and web+native backends +git = "https://github.com/emilk/egui.git" +rev = "7c5a2d60c5d000f193bc7b16c5a53c059fee8259" +features = ["http"] + +[dependencies.serde] +version = "1.0" +features = ["derive"] + +[dependencies.wasm-bindgen] +version = "0.2" +features = ["serde-serialize"] + +[dependencies.web-sys] +version = "0.3" +features = ["Blob", "BlobPropertyBag", "Url"] + +[dependencies.getrandom] +version = "0.2" +features = ["js"] + +[dependencies.ecdsa] +version = "0.11" +features = ["pem"] + +[dependencies.p256] +version = "0.8" +features = ["ecdsa", "sha256", "pem"] + +[features] +default = [] +http = ["eframe/http"] # Enable if you want to do http requests +persistence = ["eframe/persistence"] # Enable if you want to persist app state on shutdown diff --git a/loadstone_front/README.md b/tools/loadstone_front/README.md similarity index 100% rename from loadstone_front/README.md rename to tools/loadstone_front/README.md diff --git a/loadstone_front/build_web.sh b/tools/loadstone_front/build_web.sh similarity index 100% rename from loadstone_front/build_web.sh rename to tools/loadstone_front/build_web.sh diff --git a/loadstone_front/check.sh b/tools/loadstone_front/check.sh similarity index 100% rename from loadstone_front/check.sh rename to tools/loadstone_front/check.sh diff --git a/loadstone_front/published_app/egui_template.js b/tools/loadstone_front/published_app/egui_template.js similarity index 100% rename from loadstone_front/published_app/egui_template.js rename to tools/loadstone_front/published_app/egui_template.js diff --git a/loadstone_front/published_app/egui_template_bg.wasm b/tools/loadstone_front/published_app/egui_template_bg.wasm similarity index 100% rename from loadstone_front/published_app/egui_template_bg.wasm rename to tools/loadstone_front/published_app/egui_template_bg.wasm diff --git a/loadstone_front/published_app/index.html b/tools/loadstone_front/published_app/index.html similarity index 100% rename from loadstone_front/published_app/index.html rename to tools/loadstone_front/published_app/index.html diff --git a/loadstone_front/published_app/loadstone_front.js b/tools/loadstone_front/published_app/loadstone_front.js similarity index 100% rename from loadstone_front/published_app/loadstone_front.js rename to tools/loadstone_front/published_app/loadstone_front.js diff --git a/loadstone_front/published_app/loadstone_front_bg.wasm b/tools/loadstone_front/published_app/loadstone_front_bg.wasm similarity index 100% rename from loadstone_front/published_app/loadstone_front_bg.wasm rename to tools/loadstone_front/published_app/loadstone_front_bg.wasm diff --git a/loadstone_front/setup_web.sh b/tools/loadstone_front/setup_web.sh similarity index 100% rename from loadstone_front/setup_web.sh rename to tools/loadstone_front/setup_web.sh diff --git a/loadstone_front/src/app/menus/generate.rs b/tools/loadstone_front/src/app/menus/generate.rs similarity index 93% rename from loadstone_front/src/app/menus/generate.rs rename to tools/loadstone_front/src/app/menus/generate.rs index 1484577a..3ed43e28 100644 --- a/loadstone_front/src/app/menus/generate.rs +++ b/tools/loadstone_front/src/app/menus/generate.rs @@ -3,11 +3,11 @@ //! in case it's complete, gets transformed into a .ron file //! to be sent to GithubActions or built locally. +use super::colours; use base64::write::EncoderWriter as Base64Encoder; use itertools::Itertools; use ron::ser::PrettyConfig; use std::{fs::OpenOptions, io::Write, sync::Arc}; -use super::colours; use anyhow::Result; use loadstone_config::Configuration; @@ -33,7 +33,7 @@ const GITHUB_TOKEN_INSTRUCTIONS: &str = "https://docs.github.com/en/github/\ const LOCAL_OUTPUT_FILENAME: &str = "loadstone_config.ron"; /// Renders the image generation menu. -pub fn generate<'a>( +pub fn generate( ui: &mut Ui, frame: &mut epi::Frame<'_>, personal_access_token_field: &mut String, @@ -106,7 +106,10 @@ fn generate_in_ci( }); ui.horizontal_wrapped(|ui| { ui.text_edit_singleline(git_fork_field); - ui.colored_label(colours::info(ui), "Github Fork (You must have write access)"); + ui.colored_label( + colours::info(ui), + "Github Fork (You must have write access)", + ); }); ui.horizontal_wrapped(|ui| { ui.text_edit_singleline(git_ref_field); @@ -116,9 +119,16 @@ fn generate_in_ci( ui.set_enabled(!personal_access_token_field.is_empty()); if ui.button("Trigger Build").clicked() { let ron = ron::ser::to_string_pretty(&configuration, PrettyConfig::default()) - .unwrap_or("Invalid Configuration Supplied".into()); - generate_web(&configuration, &personal_access_token_field, &git_ref_field, &git_fork_field, &ron, last_request_response) - .unwrap(); + .unwrap_or_else(|_| String::from("Invalid Configuration Supplied")); + generate_web( + configuration, + personal_access_token_field, + git_ref_field, + git_fork_field, + &ron, + last_request_response, + ) + .unwrap(); personal_access_token_field.clear(); } }); @@ -202,7 +212,7 @@ fn generate_web( let formatted_body =format!( "{{\"ref\":\"{}\", \"inputs\": {{\"loadstone_configuration\":\"{}\",\"loadstone_features\":\"{}\"}}}}", git_ref, - ron.replace("\"", "\\\"").replace("\n",""), + ron.replace('\"', "\\\"").replace('\n', ""), configuration.required_feature_flags().collect_vec().join(","), ); diff --git a/loadstone_front/src/app/menus/memory_map/mod.rs b/tools/loadstone_front/src/app/menus/memory_map/mod.rs similarity index 72% rename from loadstone_front/src/app/menus/memory_map/mod.rs rename to tools/loadstone_front/src/app/menus/memory_map/mod.rs index 165b91e1..93d4de39 100644 --- a/loadstone_front/src/app/menus/memory_map/mod.rs +++ b/tools/loadstone_front/src/app/menus/memory_map/mod.rs @@ -2,12 +2,17 @@ use std::cmp::{self, max}; use crate::app::menus::memory_map::normalize::normalize; -use eframe::egui::{self, Button, Label, Slider}; -use loadstone_config::{KB, memory::{self, Bank, ExternalMemoryMap, FlashChip, InternalMemoryMap}, pins::{PeripheralPin, QspiPins, qspi}, port::Port}; use super::colours; +use eframe::egui::{self, Button, Label, Slider}; +use loadstone_config::{ + memory::{self, Bank, ExternalMemoryMap, FlashChip, InternalMemoryMap}, + pins::{qspi, PeripheralPin, QspiPins}, + port::Port, + KB, +}; static BOOTLOADER_MAX_LENGTH_KB: u32 = 128; -static GOLDEN_TOOLTIP: &'static str = +static GOLDEN_TOOLTIP: &str = "Mark this bank as golden (used as a fallback in case of corruption)\n \ Only one non-bootable bank may be golden, and only golden banks can store golden images."; @@ -38,7 +43,9 @@ pub fn configure_memory_map( ui.horizontal_wrapped(|ui| { ui.add(Label::new("Internal flash chip: ").heading()); ui.add( - Label::new(internal_flash.name.clone()).heading().text_color(colours::info(ui)), + Label::new(internal_flash.name.clone()) + .heading() + .text_color(colours::info(ui)), ); }); @@ -50,7 +57,13 @@ pub fn configure_memory_map( }); ui.label("Banks"); ui.indent(0, |ui| { - configure_internal_banks(ui, internal_memory_map, external_memory_map, &internal_flash, golden_index); + configure_internal_banks( + ui, + internal_memory_map, + external_memory_map, + &internal_flash, + golden_index, + ); }); }); @@ -58,16 +71,16 @@ pub fn configure_memory_map( ui.set_enabled(memory::external_flash(port).count() > 0); ui.add(Label::new("External flash chip:").heading()); egui::ComboBox::from_id_source("external_flash_chip") - .selected_text(match external_flash { - Some(map) => &map.name, - None => "Select external flash (optional)", - }) - .show_ui(ui, |ui| { - ui.selectable_value(external_flash, None, "None"); - for chip in memory::external_flash(port) { - ui.selectable_value(external_flash, Some(chip.clone()), chip.name); - } - }); + .selected_text(match external_flash { + Some(map) => &map.name, + None => "Select external flash (optional)", + }) + .show_ui(ui, |ui| { + ui.selectable_value(external_flash, None, "None"); + for chip in memory::external_flash(port) { + ui.selectable_value(external_flash, Some(chip.clone()), chip.name); + } + }); }); if let Some(external_flash) = external_flash { @@ -91,7 +104,11 @@ fn configure_internal_banks( internal_flash: &memory::FlashChip, golden_index: &mut Option, ) { - let InternalMemoryMap { banks, bootable_index, .. } = internal_memory_map; + let InternalMemoryMap { + banks, + bootable_index, + .. + } = internal_memory_map; let mut to_delete: Option = None; for (i, bank) in banks.iter_mut().enumerate() { configure_internal_bank( @@ -111,12 +128,17 @@ fn configure_internal_banks( let max_bank_count = (u8::MAX as usize) - external_memory_map.banks.len(); - let bank_start_address = - internal_memory_map.banks.last().map(|b| b.end_address()).unwrap_or(max( - internal_memory_map.bootloader_location - + internal_memory_map.bootloader_length_kb * KB!(1), - internal_flash.start + internal_memory_map.bootloader_length_kb * KB!(1), - )); + let bank_start_address = internal_memory_map + .banks + .last() + .map(|b| b.end_address()) + .unwrap_or_else(|| { + max( + internal_memory_map.bootloader_location + + internal_memory_map.bootloader_length_kb * KB!(1), + internal_flash.start + internal_memory_map.bootloader_length_kb * KB!(1), + ) + }); let enough_space = bank_start_address + internal_flash.region_size < internal_flash.end; ui.set_enabled(enough_space); ui.horizontal_wrapped(|ui| { @@ -146,7 +168,7 @@ fn add_internal_bank( if ui.button("Add bank").clicked() { // Bump the golden index if we added a bank under the golden one match golden_index { - Some(index) if *index >= internal_memory_map.banks.len() => *index = *index + 1, + Some(index) if *index >= internal_memory_map.banks.len() => *index += 1, _ => (), }; internal_memory_map.banks.push(Bank { @@ -180,13 +202,20 @@ fn configure_internal_bank( ); ui.label(format!("Bank {}", i + 1)); ui.add( - Label::new(format!("(0x{:x} - 0x{:x})", bank.start_address, bank.end_address())) - .text_color(colours::info(ui)), + Label::new(format!( + "(0x{:x} - 0x{:x})", + bank.start_address, + bank.end_address() + )) + .text_color(colours::info(ui)), ); ui.radio_value(bootable_index, Some(i), "Bootable"); ui.scope(|ui| { ui.set_enabled(*bootable_index != Some(i)); - if ui.radio(*golden_index == Some(i), "Golden").on_hover_text(GOLDEN_TOOLTIP).clicked() + if ui + .radio(*golden_index == Some(i), "Golden") + .on_hover_text(GOLDEN_TOOLTIP) + .clicked() { *golden_index = match *golden_index { Some(index) if index == i => None, @@ -194,13 +223,16 @@ fn configure_internal_bank( } }; }); - if ui.add(Button::new("Delete").text_color(colours::error(ui)).small()).clicked() { + if ui + .add(Button::new("Delete").text_color(colours::error(ui)).small()) + .clicked() + { *to_delete = Some(i); if let Some(index) = golden_index { - if i == *index { - *golden_index = None; - } else if i < *index { - *index = *index - 1 + match i.cmp(index) { + cmp::Ordering::Less => *index -= 1, + cmp::Ordering::Equal => *golden_index = None, + cmp::Ordering::Greater => {} } } }; @@ -224,11 +256,11 @@ fn configure_external_banks( match (pins_box, &pins) { (true, None) => { *pins = Some(QspiPins::create(port)); - }, + } (false, Some(_)) => { *pins = None; - }, - _ => { }, + } + _ => {} }; }); @@ -242,8 +274,14 @@ fn configure_external_banks( ui.label("Banks"); ui.indent(0, |ui| { - let ExternalMemoryMap { banks: external_banks, .. } = external_memory_map; - let InternalMemoryMap { banks: internal_banks, .. } = internal_memory_map; + let ExternalMemoryMap { + banks: external_banks, + .. + } = external_memory_map; + let InternalMemoryMap { + banks: internal_banks, + .. + } = internal_memory_map; let mut to_delete: Option = None; for (i, bank) in external_banks.iter_mut().enumerate() { @@ -262,12 +300,21 @@ fn configure_external_banks( external_banks.remove(to_delete); } - let bank_start_address = - external_memory_map.banks.last().map(|b| b.end_address()).unwrap_or(external_flash.start); + let bank_start_address = external_memory_map + .banks + .last() + .map(|b| b.end_address()) + .unwrap_or(external_flash.start); let enough_space = bank_start_address + external_flash.region_size < external_flash.end; ui.set_enabled(enough_space); ui.horizontal_wrapped(|ui| { - add_external_bank(ui, external_memory_map, bank_start_address, external_flash, max_bank_count); + add_external_bank( + ui, + external_memory_map, + bank_start_address, + external_flash, + max_bank_count, + ); }); }); } @@ -316,8 +363,12 @@ fn configure_external_bank( ); ui.label(format!("Bank {}", global_index + 1)); ui.add( - Label::new(format!("(0x{:x} - 0x{:x})", bank.start_address, bank.end_address())) - .text_color(colours::info(ui)), + Label::new(format!( + "(0x{:x} - 0x{:x})", + bank.start_address, + bank.end_address() + )) + .text_color(colours::info(ui)), ); ui.scope(|ui| { if ui @@ -331,13 +382,16 @@ fn configure_external_bank( } }; }); - if ui.add(Button::new("Delete").text_color(colours::error(ui)).small()).clicked() { + if ui + .add(Button::new("Delete").text_color(colours::error(ui)).small()) + .clicked() + { *to_delete = Some(i); if let Some(index) = golden_index { - if global_index == *index { - *golden_index = None; - } else if global_index < *index { - *index = *index - 1 + match global_index.cmp(index) { + cmp::Ordering::Less => *index -= 1, + cmp::Ordering::Equal => *golden_index = None, + cmp::Ordering::Greater => {} } } }; @@ -382,7 +436,9 @@ fn select_bootloader_location( Slider::new( &mut internal_memory_map.bootloader_location, internal_flash.start - ..=(internal_flash.end.saturating_sub(KB!(BOOTLOADER_MAX_LENGTH_KB))), + ..=(internal_flash + .end + .saturating_sub(KB!(BOOTLOADER_MAX_LENGTH_KB))), ) .clamp_to_range(true), ); @@ -428,27 +484,27 @@ fn configure_qpsi_pins(ui: &mut egui::Ui, port: Port, pins: &mut QspiPins) { &mut pins.bk1_io3, ]; - let names = [ - "clk", - "bk1_cs", - "bk1_io0", - "bk1_io1", - "bk1_io2", - "bk1_io3", - ]; + let names = ["clk", "bk1_cs", "bk1_io0", "bk1_io1", "bk1_io2", "bk1_io3"]; for i in 0..6usize { - let alternatives: Vec = alternatives.remove(0).filter(|p| { - for o in &old_pins { - if *o == *p { return false; } - } - true - }).collect(); - - egui::ComboBox::from_label(names[i]).selected_text(new_pins[i].to_string()).show_ui(ui, |ui| { - for alternative in alternatives { - ui.selectable_value(new_pins[i], alternative.clone(), alternative); - } - }); + let alternatives: Vec = alternatives + .remove(0) + .filter(|p| { + for o in &old_pins { + if *o == *p { + return false; + } + } + true + }) + .collect(); + + egui::ComboBox::from_label(names[i]) + .selected_text(new_pins[i].to_string()) + .show_ui(ui, |ui| { + for alternative in alternatives { + ui.selectable_value(new_pins[i], alternative.clone(), alternative); + } + }); } } diff --git a/loadstone_front/src/app/menus/memory_map/normalize.rs b/tools/loadstone_front/src/app/menus/memory_map/normalize.rs similarity index 89% rename from loadstone_front/src/app/menus/memory_map/normalize.rs rename to tools/loadstone_front/src/app/menus/memory_map/normalize.rs index e8f39c02..da66a0c2 100644 --- a/loadstone_front/src/app/menus/memory_map/normalize.rs +++ b/tools/loadstone_front/src/app/menus/memory_map/normalize.rs @@ -37,7 +37,7 @@ fn enforce_external_banks_are_contiguous( external_memory_map: &mut ExternalMemoryMap, chip: &mut FlashChip, ) { - if external_memory_map.banks.len() > 0 { + if !external_memory_map.banks.is_empty() { external_memory_map.banks[0].start_address = chip.start; } if external_memory_map.banks.len() > 1 { @@ -46,14 +46,18 @@ fn enforce_external_banks_are_contiguous( pair[1].start_address = pair[0].end_address(); } } - external_memory_map.banks.retain(|b| b.end_address() < chip.end); + external_memory_map + .banks + .retain(|b| b.end_address() < chip.end); } fn enforce_internal_bank_ranges_are_maintained( internal_memory_map: &mut InternalMemoryMap, internal_flash: &FlashChip, ) { - internal_memory_map.banks.retain(|b| b.end_address() < internal_flash.end); + internal_memory_map + .banks + .retain(|b| b.end_address() < internal_flash.end); if let Some(index) = internal_memory_map.bootable_index { if index >= internal_memory_map.banks.len() { internal_memory_map.bootable_index = None; @@ -74,10 +78,11 @@ fn enforce_internal_banks_follow_bootloader( internal_memory_map: &mut InternalMemoryMap, internal_flash: &FlashChip, ) { - if internal_memory_map.banks.len() > 0 { + if !internal_memory_map.banks.is_empty() { // The start of the first bank must be aligned to the chip's erase granularity - internal_memory_map.bootloader_location = - internal_memory_map.bootloader_location.clamp(internal_flash.start, internal_flash.end); + internal_memory_map.bootloader_location = internal_memory_map + .bootloader_location + .clamp(internal_flash.start, internal_flash.end); let bootloader_end = internal_memory_map.bootloader_location + KB!(1) * internal_memory_map.bootloader_length_kb; diff --git a/loadstone_front/src/app/menus/mod.rs b/tools/loadstone_front/src/app/menus/mod.rs similarity index 95% rename from loadstone_front/src/app/menus/mod.rs rename to tools/loadstone_front/src/app/menus/mod.rs index d15b3f46..bbd1a0aa 100644 --- a/loadstone_front/src/app/menus/mod.rs +++ b/tools/loadstone_front/src/app/menus/mod.rs @@ -5,11 +5,11 @@ use loadstone_config::{ port::Port, }; +pub mod generate; pub mod memory_map; pub mod security; -pub mod generate; -pub mod update_signal; pub mod serial; +pub mod update_signal; /// Renders the dropdown menu to select one of the supported /// hardware ports. @@ -45,8 +45,11 @@ pub fn configure_boot_metrics(ui: &mut egui::Ui, boot_metrics: &mut BootMetrics, ui.indent(0, |ui| { ui.horizontal_wrapped(|ui| { let mut dummy = false; - let timing_box = - if let BootMetrics::Enabled { timing } = boot_metrics { timing } else { &mut dummy }; + let timing_box = if let BootMetrics::Enabled { timing } = boot_metrics { + timing + } else { + &mut dummy + }; ui.set_enabled(BootMetrics::timing_supported(port) && metrics_box); ui.checkbox(timing_box, "Timing Metrics"); ui.label("Include boot timing as part of the boot metrics."); @@ -109,7 +112,7 @@ mod colours { if ui.visuals().dark_mode { Color32::from_rgb(0xbd, 0x19, 0x19) } else { - Color32::from_rgb(0xf8, 0x19,0x19) + Color32::from_rgb(0xf8, 0x19, 0x19) } } diff --git a/loadstone_front/src/app/menus/security.rs b/tools/loadstone_front/src/app/menus/security.rs similarity index 71% rename from loadstone_front/src/app/menus/security.rs rename to tools/loadstone_front/src/app/menus/security.rs index 7bd0988c..288a094e 100644 --- a/loadstone_front/src/app/menus/security.rs +++ b/tools/loadstone_front/src/app/menus/security.rs @@ -1,8 +1,8 @@ +use super::colours; use eframe::egui::{self, Button}; use loadstone_config::security::SecurityMode; use p256::ecdsa::VerifyingKey; use std::str::FromStr; -use super::colours; /// Renders the menu to configure security options (at the moment, /// `CRC` and `ECDSA` image verification. @@ -13,8 +13,12 @@ pub fn configure_security( verifying_key_text_field: &mut String, ) { ui.horizontal_wrapped(|ui| { - ui.radio_value(security_mode, SecurityMode::P256ECDSA, "Enable P256 ECDSA mode.") - .on_hover_text("Enable P256 ECDSA signature verification."); + ui.radio_value( + security_mode, + SecurityMode::P256ECDSA, + "Enable P256 ECDSA mode.", + ) + .on_hover_text("Enable P256 ECDSA signature verification."); ui.radio_value(security_mode, SecurityMode::Crc, "Enable CRC32 mode.") .on_hover_text("Disable ECDSA verification in favor of IEEE CRC32"); }); @@ -33,17 +37,26 @@ pub fn configure_security( if !verifying_key_raw.is_empty() { ui.horizontal_wrapped(|ui| { ui.colored_label(colours::success(ui), "\u{1F5DD} Valid Key Supplied"); - if ui.add(Button::new("Delete").text_color(colours::error(ui)).small()).clicked() { + if ui + .add(Button::new("Delete").text_color(colours::error(ui)).small()) + .clicked() + { verifying_key_raw.clear(); }; }); } else { - if ui.text_edit_multiline(verifying_key_text_field).lost_focus() { + if ui + .text_edit_multiline(verifying_key_text_field) + .lost_focus() + { // Preprocess the key to ensure spaces are maintained *verifying_key_text_field = verifying_key_text_field - .replace("-----BEGIN PUBLIC KEY----- ", "-----BEGIN PUBLIC KEY-----\n") + .replace( + "-----BEGIN PUBLIC KEY----- ", + "-----BEGIN PUBLIC KEY-----\n", + ) .replace(" -----END PUBLIC KEY-----", "\n-----END PUBLIC KEY-----"); - if VerifyingKey::from_str(&verifying_key_text_field).is_ok() { + if VerifyingKey::from_str(verifying_key_text_field).is_ok() { *verifying_key_raw = verifying_key_text_field.clone(); } else { *verifying_key_text_field = String::new(); diff --git a/loadstone_front/src/app/menus/serial.rs b/tools/loadstone_front/src/app/menus/serial.rs similarity index 90% rename from loadstone_front/src/app/menus/serial.rs rename to tools/loadstone_front/src/app/menus/serial.rs index d57d0dd6..7dfe7d24 100644 --- a/loadstone_front/src/app/menus/serial.rs +++ b/tools/loadstone_front/src/app/menus/serial.rs @@ -10,8 +10,10 @@ use loadstone_config::{ /// whether serial communication is available at all, whether it allows for image /// recovery, and what pins and peripherals it uses in a particular port. pub fn configure_serial(ui: &mut egui::Ui, serial: &mut Serial, port: &Port) { - let mut available_peripherals = - pins::serial_tx(port).chain(pins::serial_rx(port)).map(|p| p.peripheral).collect_vec(); + let mut available_peripherals = pins::serial_tx(port) + .chain(pins::serial_rx(port)) + .map(|p| p.peripheral) + .collect_vec(); available_peripherals.sort(); available_peripherals.dedup(); @@ -44,7 +46,12 @@ pub fn configure_serial(ui: &mut egui::Ui, serial: &mut Serial, port: &Port) { ui.label("Enable serial communications to retrieve information about the boot process."); }); - if let Serial::Enabled { recovery_enabled, tx_pin, rx_pin } = serial { + if let Serial::Enabled { + recovery_enabled, + tx_pin, + rx_pin, + } = serial + { define_serial_options( ui, port, @@ -92,10 +99,14 @@ fn select_peripheral( }); let first_valid_tx = |peripheral| { - pins::serial_tx(port).find_map(|p| (&p.peripheral == peripheral).then_some(p)).unwrap() + pins::serial_tx(port) + .find_map(|p| (&p.peripheral == peripheral).then_some(p)) + .unwrap() }; let first_valid_rx = |peripheral| { - pins::serial_rx(port).find_map(|p| (&p.peripheral == peripheral).then_some(p)).unwrap() + pins::serial_rx(port) + .find_map(|p| (&p.peripheral == peripheral).then_some(p)) + .unwrap() }; if tx_pin.peripheral != inferred_peripheral { diff --git a/loadstone_front/src/app/menus/update_signal.rs b/tools/loadstone_front/src/app/menus/update_signal.rs similarity index 100% rename from loadstone_front/src/app/menus/update_signal.rs rename to tools/loadstone_front/src/app/menus/update_signal.rs diff --git a/loadstone_front/src/app/mod.rs b/tools/loadstone_front/src/app/mod.rs similarity index 50% rename from loadstone_front/src/app/mod.rs rename to tools/loadstone_front/src/app/mod.rs index 0a376870..fa04a6e5 100644 --- a/loadstone_front/src/app/mod.rs +++ b/tools/loadstone_front/src/app/mod.rs @@ -6,10 +6,13 @@ use self::menus::{ }; use crate::app::menus::{ - generate, update_signal::configure_update_signal, - serial::configure_serial, configure_custom_greetings + configure_custom_greetings, generate, serial::configure_serial, + update_signal::configure_update_signal, +}; +use eframe::{ + egui::{self, mutex::Mutex, ScrollArea, TextStyle}, + epi, }; -use eframe::{egui::{self, ScrollArea, TextStyle, mutex::Mutex}, epi}; const GIT_VERSION: &str = git_version::git_version!(); use loadstone_config::{features::Serial, pins, Configuration}; @@ -50,7 +53,9 @@ impl Default for LoadstoneApp { } impl epi::App for LoadstoneApp { - fn name(&self) -> &str { "Loadstone Builder" } + fn name(&self) -> &str { + "Loadstone Builder" + } /// Called by the framework to load old app state (if any). #[cfg(feature = "persistence")] @@ -96,61 +101,71 @@ impl epi::App for LoadstoneApp { ui.separator(); select_port(ui, &mut configuration.port); ui.separator(); - egui::CollapsingHeader::new("Features").text_style(TextStyle::Heading).show(ui, |ui| { - ui.label("Greyed out features are unsupported in the current configuration."); - ui.set_enabled( - Serial::supported(&mut configuration.port) - && pins::serial_tx(&mut configuration.port).count() > 0 - && pins::serial_rx(&mut configuration.port).count() > 0, - ); - configure_serial( - ui, - &mut &mut configuration.feature_configuration.serial, - &mut configuration.port, - ); - configure_boot_metrics( - ui, - &mut configuration.feature_configuration.boot_metrics, - &mut configuration.port, - ); - configure_custom_greetings( - ui, - &mut configuration.feature_configuration.greetings, - ); - configure_update_signal( - ui, - &mut configuration.feature_configuration.update_signal, - ); - }); - egui::CollapsingHeader::new("Memory map").text_style(TextStyle::Heading).show(ui, |ui| { - configure_memory_map( - ui, - &mut configuration.memory_configuration.internal_memory_map, - &mut configuration.memory_configuration.external_memory_map, - &mut configuration.memory_configuration.external_flash, - &mut configuration.memory_configuration.golden_index, - &configuration.port, - ); - }); - egui::CollapsingHeader::new("Security").text_style(TextStyle::Heading).show(ui, |ui| { - configure_security( - ui, - &mut configuration.security_configuration.security_mode, - &mut configuration.security_configuration.verifying_key_raw, - verifying_key_text_field, - ); - }); - egui::CollapsingHeader::new("Generate").text_style(TextStyle::Heading).show(ui, |ui| { - generate::generate( - ui, - frame, - personal_access_token_field, - git_ref_field, - git_fork_field, - last_request_response, - &configuration, - ); - }); + egui::CollapsingHeader::new("Features") + .text_style(TextStyle::Heading) + .show(ui, |ui| { + ui.label( + "Greyed out features are unsupported in the current configuration.", + ); + ui.set_enabled( + Serial::supported(&configuration.port) + && pins::serial_tx(&configuration.port).count() > 0 + && pins::serial_rx(&configuration.port).count() > 0, + ); + configure_serial( + ui, + &mut configuration.feature_configuration.serial, + &configuration.port, + ); + configure_boot_metrics( + ui, + &mut configuration.feature_configuration.boot_metrics, + &configuration.port, + ); + configure_custom_greetings( + ui, + &mut configuration.feature_configuration.greetings, + ); + configure_update_signal( + ui, + &mut configuration.feature_configuration.update_signal, + ); + }); + egui::CollapsingHeader::new("Memory map") + .text_style(TextStyle::Heading) + .show(ui, |ui| { + configure_memory_map( + ui, + &mut configuration.memory_configuration.internal_memory_map, + &mut configuration.memory_configuration.external_memory_map, + &mut configuration.memory_configuration.external_flash, + &mut configuration.memory_configuration.golden_index, + &configuration.port, + ); + }); + egui::CollapsingHeader::new("Security") + .text_style(TextStyle::Heading) + .show(ui, |ui| { + configure_security( + ui, + &mut configuration.security_configuration.security_mode, + &mut configuration.security_configuration.verifying_key_raw, + verifying_key_text_field, + ); + }); + egui::CollapsingHeader::new("Generate") + .text_style(TextStyle::Heading) + .show(ui, |ui| { + generate::generate( + ui, + frame, + personal_access_token_field, + git_ref_field, + git_fork_field, + last_request_response, + configuration, + ); + }); }); }); } diff --git a/loadstone_front/src/app/utilities.rs b/tools/loadstone_front/src/app/utilities.rs similarity index 100% rename from loadstone_front/src/app/utilities.rs rename to tools/loadstone_front/src/app/utilities.rs diff --git a/loadstone_front/src/lib.rs b/tools/loadstone_front/src/lib.rs similarity index 91% rename from loadstone_front/src/lib.rs rename to tools/loadstone_front/src/lib.rs index 9806f9a6..b8599a88 100644 --- a/loadstone_front/src/lib.rs +++ b/tools/loadstone_front/src/lib.rs @@ -1,7 +1,5 @@ #![forbid(unsafe_code)] #![allow(dead_code)] -#![feature(bool_to_option)] -#![feature(stmt_expr_attributes)] #![warn(clippy::all, rust_2018_idioms)] mod app; diff --git a/loadstone_front/src/main.rs b/tools/loadstone_front/src/main.rs similarity index 100% rename from loadstone_front/src/main.rs rename to tools/loadstone_front/src/main.rs diff --git a/loadstone_front/start_server.sh b/tools/loadstone_front/start_server.sh similarity index 100% rename from loadstone_front/start_server.sh rename to tools/loadstone_front/start_server.sh diff --git a/tools/signing_tool/Cargo.lock b/tools/signing_tool/Cargo.lock deleted file mode 100644 index 1c039872..00000000 --- a/tools/signing_tool/Cargo.lock +++ /dev/null @@ -1,806 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aligned" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19796bd8d477f1a9d4ac2465b464a8b1359474f06a96bb3cda650b4fca309bf" -dependencies = [ - "as-slice", -] - -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - -[[package]] -name = "as-slice" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45403b49e3954a4b8428a0ac21a4b7afadccf92bfd96273f1a58cd4812496ae0" -dependencies = [ - "generic-array 0.12.4", - "generic-array 0.13.3", - "generic-array 0.14.4", - "stable_deref_trait", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "bare-metal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" -dependencies = [ - "rustc_version", -] - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "base64ct" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d27fb6b6f1e43147af148af49d49329413ba781aa0d5e10979831c210173b5" - -[[package]] -name = "bitfield" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "bitvec" -version = "0.20.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array 0.14.4", -] - -[[package]] -name = "blue_hal" -version = "0.1.0" -source = "git+ssh://git@github.com/absw/blue_hal.git?branch=main#4ff4c9d5fdf126fc49420962562645a60f036146" -dependencies = [ - "cortex-m 0.6.7", - "cortex-m-rt", - "cortex-m-semihosting", - "crc", - "defmt", - "defmt-rtt", - "marker-blanket", - "nb 1.0.0", - "nom", - "paste", - "static_assertions", - "stm32f4", - "ufmt", -] - -[[package]] -name = "build_const" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "2.33.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim", - "textwrap", - "unicode-width", - "vec_map", -] - -[[package]] -name = "const-oid" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279bc8fc53f788a75c7804af68237d1fce02cde1e275a886a4b320604dc2aeda" - -[[package]] -name = "cortex-m" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9075300b07c6a56263b9b582c214d0ff037b00d45ec9fde1cc711490c56f1bb9" -dependencies = [ - "aligned", - "bare-metal", - "bitfield", - "cortex-m 0.7.2", - "volatile-register", -] - -[[package]] -name = "cortex-m" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643a210c1bdc23d0db511e2a576082f4ff4dcae9d0c37f50b431b8f8439d6d6b" -dependencies = [ - "bare-metal", - "bitfield", - "embedded-hal", - "volatile-register", -] - -[[package]] -name = "cortex-m-rt" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d8353767db816419630a76d5f1ad5b09610d22b67ceb59647df6a8abc667f8" -dependencies = [ - "cortex-m-rt-macros", - "r0", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4717562afbba06e760d34451919f5c3bf3ac15c7bb897e8b04862a7428378647" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "cortex-m-semihosting" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bffa6c1454368a6aa4811ae60964c38e6996d397ff8095a8b9211b1c1f749bc" -dependencies = [ - "cortex-m 0.7.2", -] - -[[package]] -name = "cpufeatures" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" -dependencies = [ - "build_const", -] - -[[package]] -name = "crypto-mac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array 0.14.4", - "subtle", -] - -[[package]] -name = "defmt" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aba21ce228b4769b8b5b6d2e2ee28c5dcfbe60c46f76b63d88b3a6677c8dc5b" -dependencies = [ - "defmt-macros", - "semver 0.11.0", -] - -[[package]] -name = "defmt-macros" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fec88b1676137530f3d2e89e7ba3c4b1eb9eac49f4133752a309adf8d4f5c3b" -dependencies = [ - "defmt-parser", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "defmt-parser" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc63e313e87db4666440753288012024f117065b52e9b9f4d0d869e9fada6404" - -[[package]] -name = "defmt-rtt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5dfca43cd6b33d2d9f4db9757101ce1044e9672cd7f412dfcc5c5f772243c3b" -dependencies = [ - "cortex-m 0.6.7", - "defmt", -] - -[[package]] -name = "der" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eeb9d92785d1facb50567852ce75d0858630630e7eabea59cf7eb7474051087" -dependencies = [ - "const-oid", - "typenum", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.4", -] - -[[package]] -name = "ecdsa" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d33b390ab82f2e1481e331dbd0530895640179d2128ef9a79cc690b78d1eba" -dependencies = [ - "der", - "elliptic-curve", - "hmac", - "signature", -] - -[[package]] -name = "elliptic-curve" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13e9b0c3c4170dcc2a12783746c4205d98e18957f57854251eea3f9750fe005" -dependencies = [ - "bitvec", - "ff", - "generic-array 0.14.4", - "group", - "pkcs8", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "embedded-hal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db184d3fa27bc7a2344250394c0264144dfe0bc81a4401801dcb964b8dd172ad" -dependencies = [ - "nb 0.1.3", - "void", -] - -[[package]] -name = "ff" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a4d941a5b7c2a75222e2d44fcdf634a67133d9db31e177ae5ff6ecda852bfe" -dependencies = [ - "bitvec", - "rand_core", - "subtle", -] - -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f797e67af32588215eaaab8327027ee8e71b9dd0b2b26996aedf20c030fce309" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "group" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3c1e8b4f1ca07e6605ea1be903a5f6956aec5c8a67fd44d56076631675ed8" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "hermit-abi" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" -dependencies = [ - "libc", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest", -] - -[[package]] -name = "libc" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" - -[[package]] -name = "marker-blanket" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e7bd27ee3bf591396f053e9711ddb2bf9adddec15e728eebc588a67a5bf8e37" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "memchr" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.0.0", -] - -[[package]] -name = "nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" - -[[package]] -name = "nom" -version = "6.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" -dependencies = [ - "memchr", - "version_check", -] - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "p256" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f05f5287453297c4c16af5e2b04df8fd2a3008d70f252729650bc6d7ace5844" -dependencies = [ - "ecdsa", - "elliptic-curve", - "sha2", -] - -[[package]] -name = "paste" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" - -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] - -[[package]] -name = "pkcs8" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9c2f795bc591cb3384cb64082a578b89207ac92bb89c9d98c1ea2ace7cd8110" -dependencies = [ - "base64ct", - "der", - "spki", - "zeroize", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro2" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r0" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f" - -[[package]] -name = "radium" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" - -[[package]] -name = "rand_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser 0.7.0", -] - -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser 0.10.2", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - -[[package]] -name = "sha2" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" -dependencies = [ - "block-buffer", - "cfg-if", - "cpufeatures", - "digest", - "opaque-debug", -] - -[[package]] -name = "signature" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" -dependencies = [ - "digest", - "rand_core", -] - -[[package]] -name = "signing_tool" -version = "0.2.0" -dependencies = [ - "base64", - "blue_hal", - "clap", - "crc", - "ecdsa", - "p256", - "sha2", -] - -[[package]] -name = "spki" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dae7e047abc519c96350e9484a96c6bf1492348af912fd3446dd2dc323f6268" -dependencies = [ - "der", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "stm32f4" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee53b1097a4fd61cea5ce5b4639822df4caccdfe6a6dce3e76eee5dd302b2dea" -dependencies = [ - "bare-metal", - "cortex-m 0.6.7", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "subtle" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" - -[[package]] -name = "syn" -version = "1.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "typenum" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" - -[[package]] -name = "ucd-trie" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" - -[[package]] -name = "ufmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7ecea7ef79d3f8f878eee614afdf5256475c63ad76139d4da6125617c784a0" -dependencies = [ - "proc-macro-hack", - "ufmt-macros", - "ufmt-write", -] - -[[package]] -name = "ufmt-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed813e34a2bfa9dc58ee2ed8c8314d25e6d70c911486d64b8085cb695cfac069" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ufmt-write" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" - -[[package]] -name = "unicode-width" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "vcell" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "volatile-register" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d67cb4616d99b940db1d6bd28844ff97108b498a6ca850e5b6191a532063286" -dependencies = [ - "vcell", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - -[[package]] -name = "zeroize" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" diff --git a/tools/signing_tool/Cargo.toml b/tools/signing_tool/Cargo.toml index a1fb680f..d5070b9c 100644 --- a/tools/signing_tool/Cargo.toml +++ b/tools/signing_tool/Cargo.toml @@ -1,28 +1,20 @@ [package] name = "signing_tool" version = "0.2.0" -authors = ["Arron Speake "] edition = "2018" description = "Tool to calculate and append signatures to images." -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] clap = "2" base64 = "0.13" -crc = "1.8.1" +crc = "1.8" +sha2 = "0.9" +blue_hal = "1" [dependencies.ecdsa] -version = "*" +version = "0.11" features = ["pem"] -[dependencies.sha2] -version = "*" - [dependencies.p256] -version = "*" +version = "0.8" features = ["ecdsa", "sha256", "pem"] - -[dependencies.blue_hal] -git = "ssh://git@github.com/absw/blue_hal.git" -branch = "main" diff --git a/tools/signing_tool/src/decorating.rs b/tools/signing_tool/src/decorating.rs index b728b7d2..278dde73 100644 --- a/tools/signing_tool/src/decorating.rs +++ b/tools/signing_tool/src/decorating.rs @@ -13,7 +13,9 @@ const GOLDEN_STRING: &str = "XPIcbOUrpG"; /// constant could be used as a firmware image, as it contains the magic string /// halfway through. pub const MAGIC_STRING: &str = "HSc7c2ptydZH2QkqZWPcJgG3JtnJ6VuA"; -pub fn magic_string_inverted() -> Vec { MAGIC_STRING.as_bytes().iter().map(|b| !b).collect() } +pub fn magic_string_inverted() -> Vec { + MAGIC_STRING.as_bytes().iter().map(|b| !b).collect() +} pub fn decorate_file(image_filename: &str, is_golden: bool) -> Result<(), Error> { let file = open_image(image_filename)?; diff --git a/tools/signing_tool/src/main.rs b/tools/signing_tool/src/main.rs index 4c7f0952..906e7ae5 100644 --- a/tools/signing_tool/src/main.rs +++ b/tools/signing_tool/src/main.rs @@ -1,6 +1,6 @@ +mod decorating; mod error; mod signing; -mod decorating; use crate::{ decorating::decorate_file, @@ -58,9 +58,15 @@ fn main() -> Result<(), String> { matches.occurrences_of("golden") > 0, ) { Ok(written_size) => { - println!("Successfully appended {} to image ({} bytes).", if - private_key_filename.is_some() { "signature " } else { "CRC" }, - written_size); + println!( + "Successfully appended {} to image ({} bytes).", + if private_key_filename.is_some() { + "signature " + } else { + "CRC" + }, + written_size + ); Ok(()) } Err(e) => Err(e.to_string()), diff --git a/tools/signing_tool/src/signing.rs b/tools/signing_tool/src/signing.rs index c7cacd6a..9d91c25d 100644 --- a/tools/signing_tool/src/signing.rs +++ b/tools/signing_tool/src/signing.rs @@ -1,9 +1,9 @@ +use crc::{crc32, Hasher32}; use p256::ecdsa::{ signature::{Signature, Signer}, SigningKey, }; use std::str::FromStr; -use crc::{crc32, Hasher32}; use crate::{ error::{self, Error}, @@ -24,7 +24,8 @@ fn read_file(file: &mut File) -> Result, Error> { pub fn read_key(mut file: File) -> Result { let mut string = String::new(); - file.read_to_string(&mut string).map_err(|_| Error::KeyParseFailed)?; + file.read_to_string(&mut string) + .map_err(|_| Error::KeyParseFailed)?; SigningKey::from_str(string.as_str()).map_err(|_| Error::KeyParseFailed) } @@ -33,8 +34,9 @@ pub fn sign_file(image_filename: &str, key: SigningKey) -> Result let mut file = open_image(image_filename)?; let plaintext = read_file(&mut file)?; let signature = key.sign(&plaintext); - let bytes_written = - file.write(signature.as_bytes()).map_err(|_| Error::FileWriteFailed(error::File::Image))?; + let bytes_written = file + .write(signature.as_bytes()) + .map_err(|_| Error::FileWriteFailed(error::File::Image))?; if bytes_written == signature.as_bytes().len() { Ok(bytes_written) @@ -50,8 +52,9 @@ pub fn calculate_and_append_crc(image_filename: &str) -> Result { let mut digest = crc32::Digest::new(crc32::IEEE); digest.write(&plaintext); - let bytes_written = - file.write(&digest.sum32().to_le_bytes()).map_err(|_| Error::FileWriteFailed(error::File::Image))?; + let bytes_written = file + .write(&digest.sum32().to_le_bytes()) + .map_err(|_| Error::FileWriteFailed(error::File::Image))?; if bytes_written == core::mem::size_of::() { Ok(bytes_written) diff --git a/x.py b/x.py new file mode 100755 index 00000000..00d9bb29 --- /dev/null +++ b/x.py @@ -0,0 +1,219 @@ +#!/usr/bin/env python3 +# +# Build front-end for loadstone. +# Do `./x.py help` for more information. + +import os +import subprocess +from sys import argv, stdin +from typing import Callable, List, Optional + +# Path of the release ELF file generated by Cargo. +ELF_OUTPUT_PATH = "target/thumbv7em-none-eabi/release/loadstone" + +# The location to write the final binary to. +BIN_OUTPUT_PATH = "loadstone.bin" + + +def run_cargo_command( + subcommand: str, args: List[str], config: str, features: List[str] +) -> bool: + environment = os.environ.copy() + environment["LOADSTONE_CONFIG"] = config.strip() + + features_arg = "--features=" + ",".join(features) + + result = subprocess.run( + ["cargo", "+nightly", subcommand, "--bin=loadstone", features_arg] + args, + env=environment, + ) + + return result.returncode == 0 + + +def run_cargo_clean() -> bool: + result = subprocess.run(["cargo", "clean"], cwd="./loadstone") + return result.returncode == 0 + + +def run_cargo_build(config: str, features: List[str]) -> bool: + return run_cargo_command( + "build", ["--release", "--target=thumbv7em-none-eabi"], config, features + ) + + +def run_cargo_check(config: str, features: List[str]) -> bool: + return run_cargo_command("clippy", [], config, features) + + +def run_cargo_test(config: str, features: List[str]) -> bool: + return run_cargo_command("test", [], config, features) + + +def objcopy_to_binary(source: str, destination: str) -> bool: + result = subprocess.run(["arm-none-eabi-objcopy", source, "-Obinary", destination]) + return result.returncode == 0 + + +def read_file_argument(path: str) -> Optional[str]: + """If `path` is '-' evaluate to stdin, otherwise read it as a file path.""" + if path == "-": + return stdin.read() + try: + with open(path, "r") as file: + return file.read() + except: + return None + + +def help_general() -> bool: + print("Build front-end for loadstone.") + print() + print("USAGE") + print(" ./x.py SUBCOMMAND ...") + print() + print("SUBCOMMANDS") + for name in COMMANDS: + command = COMMANDS[name] + print(" " + name.ljust(8) + command.summary) + return True + + +def help_specific(topic: str) -> bool: + command = COMMANDS.get(topic) + if command == None: + print("Error: help: unknown command `" + topic + "`") + return False + + print("./x.py " + topic) + print(command.description) + print() + print("USAGE") + print(" ./x.py " + topic + " " + command.usage) + return True + + +def command_help(args: List[str]) -> bool: + if len(args) < 3: + return help_general() + elif len(args) == 3: + return help_specific(args[2]) + else: + print("Error: help: excessive arguments") + return False + + +def command_clean(args: List[str]) -> bool: + if len(args) != 2: + print("Error: clean: expected no arguments.") + return False + + if os.path.exists(BIN_OUTPUT_PATH): + os.remove(BIN_OUTPUT_PATH) + + return run_cargo_clean() + + +def command_build(args: List[str]) -> bool: + if len(args) < 3: + print("Error: build: expected at least 1 argument.") + return False + + config = read_file_argument(args[2]) + if config == None: + print("Error: build: failed to read `" + args[2] + "`") + return False + + if not run_cargo_build(config, args[3:]): + return False + + if not objcopy_to_binary(ELF_OUTPUT_PATH, BIN_OUTPUT_PATH): + return False + + print("Loadstone binary copied to `" + BIN_OUTPUT_PATH + "`.") + return True + + +def command_check(args: List[str]) -> bool: + if len(args) == 2: + return run_cargo_check("", []) + + config = read_file_argument(args[2]) + if config == None: + print("Error: check: failed to read `" + args[2] + "`") + return False + + return run_cargo_check(config, args[3:]) + + +def command_test(args: List[str]) -> bool: + if len(args) == 2: + return run_cargo_test("", []) + + config = read_file_argument(args[2]) + if config == None: + print("Error: test: failed to read `" + args[2] + "`") + return False + + return run_cargo_test(config, args[3:]) + + +class Command: + def __init__( + self, + function: Callable[[List[str]], bool], + summary: str, + description: str, + usage: str, + ): + self.function = function + self.summary = summary + self.description = description + self.usage = usage + + +COMMANDS = { + "help": Command( + command_help, + "Print help information", + "Print general info or help about a specific command", + "SUBCOMMAND?", + ), + "clean": Command( + command_clean, + "Clean up generated files", + "Removes all files generated by Cargo and x.py.", + "", + ), + "build": Command( + command_build, + "Build loadstone", + "Build loadstone using the configuration from the provided file. If the given path is '-' " + + "use standard input for config.", + "CONFIG_FILE FEATURES...", + ), + "check": Command( + command_check, + "Check loadstone for errors", + "Check for common mistakes and errors. If a config file is provided, that is used. If the " + + "path is '-' use standard input for config.", + "CONFIG_FILE? FEATURES...", + ), + "test": Command( + command_test, + "Test loadstone", + "Build and run loadstone's tests. If a config file is provided, that is used. If the path " + + "is '-', use standard input for config.", + "CONFIG_FILE? FEATURES...", + ), +} + +if len(argv) > 1: + command = COMMANDS.get(argv[1]) + if command != None: + success = command.function(argv) + code = 0 if success else 1 + exit(code) + +command_help([]) +exit(1)