Code Monkey home page Code Monkey logo

Comments (10)

fadeevab avatar fadeevab commented on September 16, 2024 1

@ProjectInitiative I am keen towards moving hardly: mut + version bump to 0.4.0 + rustsec advisory for <0.3.x.

Why:

  1. I haven't found evidence that I deliberately planned to have an immutable API, although I found a commit, where the API became to be immutable:
    fa4d1d9.
  2. Introducing additional API calls doesn't make the old API more secure for sequential usage.

from cocoon.

ProjectInitiative avatar ProjectInitiative commented on September 16, 2024 1

Closing issue!

from cocoon.

ProjectInitiative avatar ProjectInitiative commented on September 16, 2024

Created a pull request fixing the issue, and adding some new test criteria to all 4 of the encrypt functions #23

from cocoon.

ProjectInitiative avatar ProjectInitiative commented on September 16, 2024

Also opened an issue here: rust-random/rand#1345

from cocoon.

fadeevab avatar fadeevab commented on September 16, 2024

Wow, nice finding. I left comments in the PR.

from cocoon.

fadeevab avatar fadeevab commented on September 16, 2024

@ProjectInitiative What a nasty issue :) Here's the thing: originally, I designed API to be a one-shot, e.g. you initialize Cocoon, dump something, and leave. On the other side, sequential dumping/encrypting is a nice feature. However, changing the API to be mutable would break backward compatibility.

Options:

  1. We could introduce dump_next(&mut self,...), encrypt_next(&mut self, ...).
  2. Bumping version to 0.4.0.

from cocoon.

ProjectInitiative avatar ProjectInitiative commented on September 16, 2024

Both are good, I would suggest a contingency on option 1: might be a good idea to add an crate.io advisory for < 3.x.x as I found this out by NOT using the crate in the intended way, and others might have as well while thinking their implementation was correct.

As for which to select? I am not sure, I will defer the direction of the project to project owner.

I will note from a security perspective, option 2 with a crate.io advisory would force/push dependent projects to re-evaluate and confirm the security they expect in their respective projects.

from cocoon.

fadeevab avatar fadeevab commented on September 16, 2024

@ProjectInitiative 0.4.0 is published (https://crates.io/crates/cocoon)

from cocoon.

fadeevab avatar fadeevab commented on September 16, 2024

Security Advisory PR: rustsec/advisory-db#1805

from cocoon.

fadeevab avatar fadeevab commented on September 16, 2024

@ProjectInitiative I just found that it was reproduced with MiniCocoon only and with Cocoon::from_seed (and others with custom RNGs and seeds) where StdRng is used! That's why I haven't found it easily in the first place. It means that cloning ThreadRng (which is used in Cocoon::new) and StdRng (which is used in MiniCocoon and Cocoon::from_seed) behaves differently, or maybe ThreadRng adds entropy every time no matter what.

from cocoon.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.