Coder Social home page Coder Social logo

provider-corner / vigenere Goto Github PK

View Code? Open in Web Editor NEW
12.0 7.0 8.0 81 KB

A toy provider implementing an expanded vigenere cipher, to serve as a programming example

License: Other

CMake 13.13% C 71.78% Perl 15.08%
openssl-provider toy-project

vigenere's People

Contributors

levitte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vigenere's Issues

Some questions

  1. Why do you use the malloc/free functions instead of the OPENSSL_malloc/free?
  2. Is the old way of generating the error files (using the mkerr.pl script) still relevant?

Example documentation needed

For the longest time during the development of OpenSSL 3.0, this mantra was uttered with some sort of regularity: know your provider.

The ramification of this is, of course, that with every provider, there should be some sort of documentation, so users can know the important bits and make good use of said provider.

This provider is lacking that part, there really is no documentation at all, and is thusly a poor example in that regard.

Adding an example documentation may also be another way to answer the concerns raised in #5

Key length bug

It looks to me (from code inspection) that vigenere_encrypt_init/vigenere_decrypt_init will happily accept a 0 length key. In the encrypt case it will end up calling memcpy with a final param of 0 (which I think is undefined behaviour). vigenere_update will subsequently result in an out-of-bounds or NULL pointer deref of the zero length key (because it assumes that the key is at least one byte long).

Question

I'm in the process of trying to convert a cipher that was built in OSSL 1.1.1 by using the meth_new process (it's a multithreaded aes ctr cipher used in hpnssh). I obviously need to move this over to a provider. However, the documentation (at least that provided by OpenSSL) is a bit... almost useful but not quite. Is there a resource that you know of that can help? I've just got a lot of questions that are, likely, basic. I'm sorry for the random ask but I'm hitting a lot of walls right now and I'm really hoping there is a decent resource you could point me towards.

Thanks,

Chris

Question

What is the purpose of ctx->ongoing ? It is used here

if (ctx->ongoing) {
    ERR_raise(ERR_HANDLE(ctx), VIGENERE_ONGOING_OPERATION);
    return 0;
}

Why would some one call set_ctx_params while using the algorithm? Is this to make it thread safe?

Build Fails for Alternate OpenSSL Location

I want to try vigenere on WLS 2 with Ubuntu. The latest version has OpenSSL 1.1.1 installed, so I downloaded OpenSSL 3.0.11 and build it via:

$ ./Configure --prefix=/home/pmlinux64/local --openssldir=/home/pmlinux64/local/ssl -d
make
make install

I confirmed the installation is populated in the expected location:

$ ls /home/pmlinux64/local
bin include lib64 share ssl

When I try to build vigenere with alternative OpenSSL 3 location path, per README.md, it fails as shown below. Please advise on how to do a successful build.

$ cmake -DCMAKE_PREFIX_PATH=/home/pmlinux64/local -S . -B _build
CMake Error at CMakeLists.txt:13 (add_subdirectory):
The source directory

/home/pmlinux64/vigenere-main/libprov

does not contain a CMakeLists.txt file.

CMake Error at CMakeLists.txt:14 (include):
include could not find requested file:
libprov/cmake/provider.cmake

CMake Error at CMakeLists.txt:15 (setup_provider_openssl):
Unknown CMake command "setup_provider_openssl".

-- Configuring incomplete, errors occurred!

Sudden build+test failures

CI tests are currently failing. This is due to a bug in OpenSSL that has unspecified restrictions on unquoted property values; there is a fixup PR out (openssl/openssl#19998), so all that's needed to do is to wait for it to come through.

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.