[botan-devel] Possible bug

Sviatoslav Feshchenko sviatoslav at outlook.com
Sun Feb 16 21:29:54 EST 2014


In my real application, I did not forget to initialize botan, but in the sample code I provide, yes I did forget. In either case, the problem still persists even if I initialize the library. Here is the updated code that produces the same seg fault.


#include "botan/botan.h"
#include "botan/bzip2.h"

using namespace Botan;

int main()
{
    volatile LibraryInitializer init;

    AutoSeeded_RNG rng;
    SymmetricKey key(rng, 32);
    InitializationVector iv(rng, 16);

    Keyed_Filter * decryptor = get_cipher("AES-256/CBC", key, iv, DECRYPTION);
    Bzip_Decompression * decompressor = new Bzip_Decompression();

    //start_msg() will seg fault if pipe is set up in this way
    Pipe * decryptionPipe = new Pipe(decryptor, decompressor);

    //if the pipe is set up in any of the following ways, start_msg() executes normally
//    Pipe * decryptionPipe = new Pipe(decompressor, decryptor);
//    Pipe * decryptionPipe = new Pipe(decryptor);
//    Pipe * decryptionPipe = new Pipe(decompressor);

    //seg fault here
    decryptionPipe->start_msg();

    return 0;
}


Date: Sun, 16 Feb 2014 17:45:20 -0800
From: navin.kurupacheril at gmail.com
To: botan-devel at randombit.net
Subject: Re: [botan-devel] Possible bug

Did you forget to initialize botan? http://botan.randombit.net/manual/firststep.html#initializing-the-library


On Sun, Feb 16, 2014 at 4:52 PM, Sviatoslav Feshchenko <sviatoslav at outlook.com> wrote:




Dear Botan developers,

I suspect there may be a bug in the library or I made an error somewhere (and if so I apologize). My environment is as follows:

Botan version: 1.11.8
OS: Linux Mint 16 Cinnamon 64-bit

G++ v 4.8.1

Pipe::start_msg() causes a segmentation fault depending on how the pipe was set up, as demonstrated in the compilable code below. Many thanks for looking into this.



#include "botan/botan.h"

#include "botan/bzip2.h"

using namespace Botan;

int main()
{
    AutoSeeded_RNG rng;
    SymmetricKey key(rng, 32);
    InitializationVector iv(rng, 16);

    Keyed_Filter * decryptor = get_cipher("AES-256/CBC", key, iv, DECRYPTION);

    Bzip_Decompression * decompressor = new Bzip_Decompression();

    //start_msg() will seg fault if pipe is set up in this way
    Pipe * decryptionPipe = new Pipe(decryptor, decompressor);

    //if the pipe is set up in any of the following ways, start_msg() executes normally

//    Pipe * decryptionPipe = new Pipe(decompressor, decryptor);
//    Pipe * decryptionPipe = new Pipe(decryptor);
//    Pipe * decryptionPipe = new Pipe(decompressor);

    //seg fault here
    decryptionPipe->start_msg();


    return 0;
}
 		 	   		  

_______________________________________________

botan-devel mailing list

botan-devel at randombit.net

http://lists.randombit.net/mailman/listinfo/botan-devel





_______________________________________________
botan-devel mailing list
botan-devel at randombit.net
http://lists.randombit.net/mailman/listinfo/botan-devel 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20140216/bdb1569e/attachment-0001.html>


More information about the botan-devel mailing list