Re: [openssl-users] RSA engine is not using the functions mentioned in struct

2017-02-13 Thread khurram ashraf
Respected Mr. Levitte,

I have created the symlink to 
/usr/lib/x86_64-linux-gnu/openssl-1.0.0/engines/librsa_engine.so. During 
encryption and decryption it mentions that "engine "rsa-engine 1" set", but it 
doesnot use the function in the struct and also doesnot output the printf. 
Furthermore, I also tried the method you recomended but still no result.


Best Regards.

Khurram



From: openssl-users  on behalf of Richard 
Levitte 
Sent: Monday, February 13, 2017 11:15 AM
To: openssl-users@openssl.org
Subject: Re: [openssl-users] RSA engine is not using the functions mentioned in 
struct

In message 

 on Mon, 13 Feb 2017 10:57:27 +, khurram ashraf 
 said:

khurramashraf_786> Here the engine loads but when i try to encrypt a text file 
by using
khurramashraf_786> following command
khurramashraf_786>
khurramashraf_786> openssl pkeyutl -encrypt -in message.txt -pubin -inkey 
pubkey-B.pem -engine rsa_engine -out cipher.bin
khurramashraf_786> openssl pkeyutl -decrypt -in cipher.bin -inkey privkey-B.pem 
-engine rsa_engine -out rec.txt
khurramashraf_786>
khurramashraf_786> It seems that it is not using the functions which I defined 
in the
khurramashraf_786> struct_rsa. It is also not giving the output from the printf 
in the
khurramashraf_786> function.

You need to tell it where to find the engine as well.  libcrypto looks
in the standard system places (typically /usr/lib or so) and the path
given by the environment variable OPENSSL_ENGINES.  Try these lines
and see if that makes a difference:

OPENSSL_ENGINES=.
export OPENSSL_ENGINES
openssl pkeyutl -encrypt -in message.txt -pubin -inkey pubkey-B.pem -engine 
rsa_engine -out cipher.bin
openssl pkeyutl -decrypt -in cipher.bin -inkey privkey-B.pem -engine rsa_engine 
-out rec.txt

Cheers,
Richard

--
Richard Levitte levi...@openssl.org
OpenSSL Project http://www.openssl.org/~levitte/
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
openssl-users Info Page
mta.openssl.org
This mailing list is for discussion among those using the OpenSSL software. To 
see the collection of prior postings to the list, visit the openssl-users 
Archives


-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] RSA engine is not using the functions mentioned in struct

2017-02-13 Thread Richard Levitte
In message 

 on Mon, 13 Feb 2017 10:57:27 +, khurram ashraf 
 said:

khurramashraf_786> Here the engine loads but when i try to encrypt a text file 
by using
khurramashraf_786> following command
khurramashraf_786> 
khurramashraf_786> openssl pkeyutl -encrypt -in message.txt -pubin -inkey 
pubkey-B.pem -engine rsa_engine -out cipher.bin
khurramashraf_786> openssl pkeyutl -decrypt -in cipher.bin -inkey privkey-B.pem 
-engine rsa_engine -out rec.txt
khurramashraf_786> 
khurramashraf_786> It seems that it is not using the functions which I defined 
in the
khurramashraf_786> struct_rsa. It is also not giving the output from the printf 
in the
khurramashraf_786> function.

You need to tell it where to find the engine as well.  libcrypto looks
in the standard system places (typically /usr/lib or so) and the path
given by the environment variable OPENSSL_ENGINES.  Try these lines
and see if that makes a difference:

OPENSSL_ENGINES=.
export OPENSSL_ENGINES
openssl pkeyutl -encrypt -in message.txt -pubin -inkey pubkey-B.pem -engine 
rsa_engine -out cipher.bin
openssl pkeyutl -decrypt -in cipher.bin -inkey privkey-B.pem -engine rsa_engine 
-out rec.txt

Cheers,
Richard

-- 
Richard Levitte levi...@openssl.org
OpenSSL Project http://www.openssl.org/~levitte/
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users