Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update yara-rust to 0.19 #31

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ jobs:
sudo apt install libssl-dev:i386 gcc-multilib
echo "OPENSSL_INCLUDE_DIR=/usr/include" >> $GITHUB_ENV
echo "OPENSSL_LIB_DIR=/usr/lib/i386-linux-gnu" >> $GITHUB_ENV
echo "YARA_OPENSSL_INCLUDE_DIR=/usr/include" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{matrix.target}}
- run: cargo test --target=${{matrix.target}}
env:
YARA_CRYPTO_LIB: openssl
- run: cargo test --features authenticode --target=${{matrix.target}}
env:
YARA_CRYPTO_LIB: openssl

strategy:
fail-fast: false
Expand Down Expand Up @@ -66,6 +71,8 @@ jobs:
run: |
echo "VCPKGRS_TRIPLET=${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV
echo "OPENSSL_DIR=${{ runner.workspace }}\\vcpkg\\installed\\${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV
echo "YARA_OPENSSL_DIR=${{ runner.workspace }}\\vcpkg\\installed\\${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV
echo "YARA_CRYPTO_LIB=openssl" >> $GITHUB_ENV

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down
10 changes: 6 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ members = [
# - Handle VirtualSize=0 when searching through sections
# - 89de6a730a4f60c005862b294de2f9fe444d1235
object = { git = 'https://github.com/vthib/boreal-object', branch = "version-0.30" }

# Fork of yara-rust crate, for some changes not yet released:
#
# - Update to yara 4.3
yara = { git = "https://github.com/vthib/yara-rust", branch = "update-yara-4.3" }
2 changes: 1 addition & 1 deletion boreal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ base64 = "0.21"
glob = "0.3.0"
tempfile = "3.4"
walkdir = "2.3"
yara = { version = "0.17", features = ["vendored"] }
yara = { version = "0.19", features = ["vendored"] }

# Only needed in tests because Mutex::new is not const
# in 1.62 MSRV. Can be remove once MSRV is bumped above it.
Expand Down
2 changes: 1 addition & 1 deletion boreal/src/module/pe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ fn add_exports(
// -1 is set by libyara to indicate an invalid offset.
None => match va_to_file_offset(mem, sections, address) {
Some(v) => v.into(),
None => Value::Integer(-1),
None => Value::Undefined,
},
},
),
Expand Down
9 changes: 1 addition & 8 deletions boreal/tests/it/macho.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,7 @@ fn test_coverage_macho_tiny_universal() {

#[test]
fn test_coverage_macho_entry_points() {
compare_module_values_on_file(
MachO,
"tests/assets/macho/entry_points",
&[
// TODO: Bug in LIBYARA
"macho.file[7].entry_point",
],
);
compare_module_values_on_file(MachO, "tests/assets/macho/entry_points", &[]);
}

#[test]
Expand Down