Skip to content

Set bumpalo version for fuzzing#532

Merged
kaczmarczyck merged 6 commits intogoogle:developfrom
kaczmarczyck:ci-fix
Aug 22, 2022
Merged

Set bumpalo version for fuzzing#532
kaczmarczyck merged 6 commits intogoogle:developfrom
kaczmarczyck:ci-fix

Conversation

@kaczmarczyck
Copy link
Copy Markdown
Collaborator

Fixes CI problems.

@kaczmarczyck kaczmarczyck requested a review from ia0 August 22, 2022 11:08
Cargo.toml Outdated
ed25519-compact = { version = "1", default-features = false, optional = true }
# We import to explicitly lock the version.
# Remove these dependencies once CTAP is a library.
serde_json = { version = "=1.0.69", default-features = false, features = ["alloc"] }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this? We should not depend on serde unless possibly for "std". But then in that case we should make this dependency optional and add it only for "std".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's another case were I had to lock the version because of compilation issues. I can probably move it to dev-dependencies, let me try.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I don't understand where do we use serde_json?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#407 is where I added the serde version. After running cargo update as described there, desktop tests still pass.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I've seen that PR and would have mentioned that serde_json doesn't need to be added there because we shouldn't depend on it.

I just did the following without issues:

./reset.sh
# Remove serde_json from Cargo.toml
./setup.sh
./run_desktop_tests.sh

So I'm really curious why we need serde_json in the ctap2 crate.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In both stable and develop, serde is part of the initial commit for libraries/crypto. Copied from stable:

serde = { version = "1.0", optional = true, features = ["derive"] }
serde_json = { version = "1.0", optional = true }

I never checked if we actually need these dependencies, but I removed all of them and it still seems to work. Interesting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The crypto library uses them for tests (wycheproof). But ctap2 doesn't.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, we responded at the same time it seems. I had the same conclusion, so let's try to remove serde!

@kaczmarczyck kaczmarczyck requested a review from ia0 August 22, 2022 13:23
regex = { version = "1", optional = true }

[features]
std = ["hex", "ring", "rng256/std", "untrusted", "serde", "serde_json", "regex"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file was correct. We use serde_json for tests.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. In that case, I think I had random issues with the serde version before I added it to the main Cargo.toml as well. Not sure how to reproduce, so maybe we can just remove it outside of crypto and try again until that happens.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. In that case, I think I had random issues with the serde version before I added it to the main Cargo.toml as well. Not sure how to reproduce, so maybe we can just remove it outside of crypto and try again until that happens.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, now the change is making sense.

I think it was hard to reproduce because of some many states (the Cargo.lock files in multiple directories). The best way to test is ./reset.sh (committing code first otherwise it's lost) but it can be a bit slow for fast iteration.

@kaczmarczyck kaczmarczyck merged commit 6bb1225 into google:develop Aug 22, 2022
@kaczmarczyck kaczmarczyck deleted the ci-fix branch August 22, 2022 13:54
hcyang-google added a commit that referenced this pull request Aug 23, 2022
* Add basic setup for multi-PIN

- Reserve the storage keys for maximum of 8 user slots.
- Modify the storage functions to take a slot_id parameter.
- Add the slot_count() customization.
- Assume slot_id as a parameter when needed except these places:
  - Entrance functions of command processing that directly takes the
    command parameter structure. slot_id is set as 0, and will be
    parsed from the parameters when we enable the feature.
  - MakeCredential/GetAssertion/AuthenticatorConfig will take the
    slot_id from active token state when we enable the feature,
    resulting in an `Option<usize>`. Below code will act on the option
    value correctly. When the feature isn't enabled, we're always
    referring to the only PIN slot so set slot_id as Some(0).
  - GetInfo returns verdict of whether PIN is supported and enabled, and
    whether PIN needs to be forced changed. There will be new fields to
    represent those values when the feature is enabled, and the old
    fields will not be populated. So when the feature isn't enabled, we
    can treat slot_id as 0.

Not covered in this commit:
- Unittests for other slots. The existing tests all pass and I plan to
  add unittests for multi-slot case after the codebase allows enabling
  the feature.
- Persisting and checking the slot_id in credentials. This is planned to
  come in the next commit.

* Fix storage and some other style

* Add support for concatenated values

* Switch some storage entries back to multi-entry

* Set bumpalo version for fuzzing (#532)

* maximum working bumpalo version

* explicit comment to explain version locking

* removes incorrect comment

* moves serde version lock to dev dependencies

* removes serde dependencies

* reverts serde removal in crypto library

* Make PIN_PROPERTIES use concatenated storage entry

* Fix bumpalo issue

* Use concatenated storage entry for force_pin_change too

* Fix cargofmt

Co-authored-by: Julien Cretin <cretin@google.com>
Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants