compile with openssl1.1.0

Issue #826 resolved
merlin81 created an issue

compile under debian stretch with openssl1.1.0 fails in store.c and archive.c error: storage size of ‘ctx’ isn’t known EVP_CIPHER_CTX ctx

should now be: EVP_MD_CTX *ctx;

ctx = EVP_MD_CTX_new(); if (ctx == NULL) //check why and handle EVP_MD_CTX_free(ctx);

thank you for your software !

Comments (9)

  1. Janos SUTO repo owner

    Yes, I'm aware of that openssl 1.1 has some api changes since 1.0. Soon I'll update piler to consider the openssl version while compiling.

  2. merlin81 reporter

    below is not tested and i'm not sure if it works. compiles with 1.1.0

    diff src/archive.c ../piler-1.3.0/src/archive.c
    138,141c138
    <    EVP_CIPHER_CTX *ctx;
    <    ctx = EVP_CIPHER_CTX_new();
    <
    <    if(ctx == NULL) return 1;
    ---
    >    EVP_CIPHER_CTX ctx;
    162,163c159,160
    <       EVP_CIPHER_CTX_init(ctx);
    <       EVP_DecryptInit_ex(ctx, EVP_bf_cbc(), NULL, cfg->key, cfg->iv);
    ---
    >       EVP_CIPHER_CTX_init(&ctx);
    >       EVP_DecryptInit_ex(&ctx, EVP_bf_cbc(), NULL, cfg->key, cfg->iv);
    178c175
    <          if(!EVP_DecryptUpdate(ctx, s+tlen, &olen, inbuf, n)){
    ---
    >          if(!EVP_DecryptUpdate(&ctx, s+tlen, &olen, inbuf, n)){
    187c184
    <       if(EVP_DecryptFinal(ctx, s + tlen, &olen) != 1){
    ---
    >       if(EVP_DecryptFinal(&ctx, s + tlen, &olen) != 1){
    209c206
    <    if(cfg->encrypt_messages == 1) EVP_CIPHER_CTX_free(ctx);
    ---
    >    if(cfg->encrypt_messages == 1) EVP_CIPHER_CTX_cleanup(&ctx);
    Nur in src: Makefile.
    diff src/store.c ../piler-1.3.0/src/store.c
    49,51c49
    <
    <    EVP_CIPHER_CTX *ctx;
    <    ctx = EVP_CIPHER_CTX_new();
    ---
    >    EVP_CIPHER_CTX ctx;
    106,107c104,105
    <       EVP_CIPHER_CTX_init(ctx);
    <       EVP_EncryptInit_ex(ctx, EVP_bf_cbc(), NULL, cfg->key, cfg->iv);
    ---
    >       EVP_CIPHER_CTX_init(&ctx);
    >       EVP_EncryptInit_ex(&ctx, EVP_bf_cbc(), NULL, cfg->key, cfg->iv);
    112,113c110,111
    <       if(!EVP_EncryptUpdate(ctx, outbuf, &outlen, z, dstlen)) goto ENDE;
    <       if(!EVP_EncryptFinal_ex(ctx, outbuf + outlen, &tmplen)) goto ENDE;
    ---
    >       if(!EVP_EncryptUpdate(&ctx, outbuf, &outlen, z, dstlen)) goto ENDE;
    >       if(!EVP_EncryptFinal_ex(&ctx, outbuf + outlen, &tmplen)) goto ENDE;
    115c113
    <       EVP_CIPHER_CTX_free(ctx);
    ---
    >       EVP_CIPHER_CTX_cleanup(&ctx);
    
  3. Simon Lindsay

    Weill there be a release update or should we just build from the repo? This stops install on debian 9.1 in its tracks.

  4. Janos SUTO repo owner

    I'll release piler-1.3.1 on both master and epoll branches soon. Until then you are free to build from the repo.

  5. alexminator

    WOW merlin81 ur fix works like a charm ..thnx bro..i compile piler 1.3.0 on debian 9.2 with openssl 1.1.0f n work ok....ill try with ur fix..meantime wait for new release

  6. Log in to comment