Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: gcrypt

errno = 2 after gcry_cipher_open

 

 

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded


jesus.diaz.vico at gmail

Aug 12, 2010, 5:19 PM

Post #1 of 2 (513 views)
Permalink
errno = 2 after gcry_cipher_open

Hello everybody,

I'm new to libgcrypt. I'm trying to cipher some data with ARCFOUR, but, just after calling gcry_cipher_open I get errno = 2. The weird thing is that gcry_cipher_open returns
no error (i.e., gcry_error_t == GPG_ERR_NO_ERROR). I'm getting mad trying to find where the problem is.

The way I'm calling gcry_cipher is:

gcry_cipher_open(&chd, GCRY_CIPHER_ARCFOUR, GCRY_CIPHER_MODE_STREAM, GCRY_CIPHER_SECURE);

Where chd is a local variable, declared as gcry_cipher_hd_t, within the function which calls gcry_cipher_open. I've also tried without GCRY_CIPHER_SECURE.

I've compared my code to the check_one_cipher fucntion that tests the algorithms and everything seems the same. Also, I did not had any problem during libgcrypt installation (make check did pass every test).

Could anybody please give me any hint?

Thank you.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel


wk at gnupg

Aug 13, 2010, 12:37 AM

Post #2 of 2 (479 views)
Permalink
Re: errno = 2 after gcry_cipher_open [In reply to]

On Fri, 13 Aug 2010 02:19, jesus.diaz.vico [at] gmail said:

> I'm new to libgcrypt. I'm trying to cipher some data with ARCFOUR, but, just after calling gcry_cipher_open I get errno = 2. The weird thing is that gcry_cipher_open returns

ERRNO is not part of libgcrypts API. Instead libgcrypt returns
gpg-error style errocodes directly.

In general you may only check errno after calling a function which is
specified to set errno. The value returned by ERRNO in your case may
come for some internal operation of libgcrypt.

To get a description of the error returned by the libgcrypt API you use
for example code like:

gpg_error_t err;
err = gcry_cipher_open (...);
fprintf (stderr, "error code from libgcrypt: %s\n", gpg_strerror (err));


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.