diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 16d7c4a..0c13ad1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -23,6 +23,7 @@ updates: directories: - "/rust" - "/rust/tsp-asn1" + - "/" groups: actions: patterns: diff --git a/.gitignore b/.gitignore index b8c7a34..d8c9303 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ rust/**/target +target/ # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/rust/Cargo.lock b/Cargo.lock similarity index 91% rename from rust/Cargo.lock rename to Cargo.lock index 31257e5..47dc0dd 100644 --- a/rust/Cargo.lock +++ b/Cargo.lock @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bitflags" @@ -52,9 +52,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.28" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "shlex", ] @@ -67,9 +67,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -158,15 +158,15 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "memoffset" @@ -179,9 +179,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" @@ -211,9 +211,9 @@ dependencies = [ [[package]] name = "openssl-src" -version = "300.4.0+3.4.0" +version = "300.4.1+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" dependencies = [ "cc", ] @@ -239,9 +239,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "ppv-lite86" @@ -254,9 +254,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -365,7 +365,7 @@ dependencies = [ [[package]] name = "rfc3161-client" -version = "0.1.0" +version = "0.0.1" dependencies = [ "asn1", "cryptography-x509", @@ -403,9 +403,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "syn" -version = "2.0.77" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -424,6 +424,7 @@ version = "0.0.1" dependencies = [ "asn1", "cryptography-x509", + "hex", ] [[package]] @@ -434,9 +435,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unindent" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..ee35f7a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,20 @@ +[workspace] +resolver = "2" + +members = [ + "rust/", + "rust/tsp-asn1", +] + +[workspace.dependencies] +asn1 = "0.20" +cryptography-x509 = { git = "https://github.com/pyca/cryptography.git", tag = "44.0.0" } +hex = "0.4" + +[workspace.package] +version = "0.0.1" +edition = "2021" +authors = [ + "Trail of Bits " +] +publish = false \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 34a219e..eac409c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ features = ["pyo3/abi3-py39", "pyo3/extension-module"] python-source = "src" manifest-path = "rust/Cargo.toml" module-name = "rfc3161_client._rust" +sdist-generator = "git" [tool.ruff] line-length = 100 diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 73cb563..d804617 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,11 +1,9 @@ [package] name = "rfc3161-client" -version = "0.1.0" -edition = "2021" -authors = [ - "Trail of Bits " -] -publish = false +version.workspace = true +edition.workspace = true +authors.workspace = true +publish.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] @@ -15,12 +13,12 @@ crate-type = ["cdylib"] [dependencies] tsp-asn1 = { path = "tsp-asn1" } pyo3 = { version = "0.23.2", features = ["abi3"] } -asn1 = "0.20" +asn1.workspace = true self_cell = "1" -hex = "0.4" +hex.workspace = true sha2 = "0.10.8" rand = "0.8.5" -cryptography-x509 = { git = "https://github.com/pyca/cryptography.git", tag = "44.0.0" } +cryptography-x509.workspace = true openssl = { version = "0.10.68", features = ["vendored"] } [features] diff --git a/rust/src/util.rs b/rust/src/util.rs index c0de13d..f9fbb47 100644 --- a/rust/src/util.rs +++ b/rust/src/util.rs @@ -114,6 +114,7 @@ pub fn generate_random_bytes_for_asn1_biguint() -> Vec { } } +#[cfg(test)] mod tests { use super::generate_random_bytes_for_asn1_biguint; diff --git a/rust/tsp-asn1/Cargo.lock b/rust/tsp-asn1/Cargo.lock deleted file mode 100644 index 4b26aee..0000000 --- a/rust/tsp-asn1/Cargo.lock +++ /dev/null @@ -1,88 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "asn1" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8b84b4ea1de2bf1dcd2a759737ddb328fb6695b2a95eb7e44fed67e3406f32" -dependencies = [ - "asn1_derive", - "itoa", -] - -[[package]] -name = "asn1_derive" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a200809d0138620b3dba989f1d08d0620e76248bc1e62a2ec1b2df5eb1ee08ad" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "cryptography-x509" -version = "0.1.0" -source = "git+https://github.com/pyca/cryptography.git?tag=44.0.0#f299a48153650f2dd87716343f2daa7cd39a1f59" -dependencies = [ - "asn1", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "proc-macro2" -version = "1.0.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "syn" -version = "2.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tsp-asn1" -version = "0.0.1" -dependencies = [ - "asn1", - "cryptography-x509", - "hex", -] - -[[package]] -name = "unicode-ident" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" diff --git a/rust/tsp-asn1/Cargo.toml b/rust/tsp-asn1/Cargo.toml index 9b9e39f..416d479 100644 --- a/rust/tsp-asn1/Cargo.toml +++ b/rust/tsp-asn1/Cargo.toml @@ -1,18 +1,16 @@ [package] name = "tsp-asn1" -version = "0.0.1" -edition = "2021" -authors = [ - "Trail of Bits " -] -publish = false +version.workspace = true +edition.workspace = true +authors.workspace = true +publish.workspace = true [lib] name = "tsp_asn1" [dependencies] -asn1 = "0.20" -cryptography-x509 = { git = "https://github.com/pyca/cryptography.git", tag = "44.0.0" } +asn1.workspace = true +cryptography-x509.workspace = true [dev-dependencies] -hex = "0.4" \ No newline at end of file +hex.workspace = true \ No newline at end of file