Version 3.2 testing

2010-02-02 Thread Brandt Springman
Hi All,

 

Just wondering if anyone has had a chance to try setting the version
number to 3.2 (from the current 3.1) in OpenSSL 1.0.0 and what results
they might have seen?

 

Brandt

 

 

 

 



Help needed

2010-02-02 Thread Cheng, Weidong
Hello,



I am implementing an engine for our company's hardware. I completed the engine 
body part by referencing other engine implementation. But I have a problem 
about the shared library which will be loaded by DSO_load function and bond to 
with some functions. I assume that the shared library should contain:

1: The engine itself built for the dynamic load;

2: The lower level interface functions which interface with the 
device drivers;



When I built the shared library, there is no problem to use the following 
command:

openssl engine - dynamic -pre SO_PATH:/x/librenesas.so  -pre LOAD



But if I run an aes-128-cbc encryption command by using the engine, the 
following error message comes out.



OpenSSL aes-128-cbc -in ifile -out ofile -e -K 
12345678901234567890123456789012 -iv 00 -engine renesas

openssl (lock_dbg_cb): already locked (mode=9, type=30) at e_renesas.c:276

openssl (lock_dbg_cb): not locked (mode=10, type=30) at eng_table.c:173

can't use that engine

1174:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared 
library:dso_dlfcn.c:162:filename(librenesas.sy

1174:error:25070067:DSO support routines:DSO_load:could not load the shared 
library:dso_lib.c:244:

1174:error:80067069:RainerAPI:RENESAS_ENGINE_INIT:reason(105):e_renesas.c:249:

1174:error:260B806D:engine routines:ENGINE_TABLE_REGISTER:init 
failed:eng_table.c:161:



It looks that I have two problems:

1: DSO_bind_func couldn't be successful;

2: The engine is locked already when I tried to use CRYPOT_w_lock 
function



Does anyone have any suggestion and advice?



Thanks a lot in advance,



Weidong



[openssl.org #2161] OpenSSL 1.0.0-beta5: Compile failure with no-dsa no-ecdsa

2010-02-02 Thread Doug Goldstein via RT
If you attempt to build OpenSSL 1.0.0-beta5 with no-dsa and no-ecdsa,
the compile will fail at s3_clnt.c line 2761 due to the use of the
variable j in an unconditionally used chunk of code. However j is
only declared when you have either dsa or ecdsa enabled. The patch
removes the conditional declaration of j and makes it always
visible.

--
Doug Goldstein



openssl-1.0.0-beta5-no-dsa-no-ecdsa.patch
Description: Binary data


how to generate RSA format data?

2010-02-02 Thread hunter li
Hi, All,
I have the following code to generate the RSA data. But it always gives me
error:
5049:error:0906D064:lib(9):func(109):reason(100):pem_lib.c:756.

I do appreciate any suggestion!


 #include stdio.h
#include stdlib.h
#include stdint.h
#include string.h

#include openssl/bio.h
#include openssl/rsa.h
#include openssl/pem.h
#include openssl/err.h

int main(void)
{

RSA *public_key;
BIO *pub_bio;

char *publicKey_test = -BEGIN PUBLIC
KEY-\nOTJjM2I3NTJmMmZlMzhkOTZjOTI2MjIxNzc0NjllNzM\
MWExMDk5MmZkNWY3MWE0N2JlMzRhMzcxMDZkZDNkMTk\
ZTUzNDc4OTY4OWQzM2FlYWRjMmQ2NWEzNGM5NjdjYzg\
ODQzMzNhNDI4YjEyODRjZmQ0ZGNkZjVjM2UyNDU5Njk\
NzNmMDAyZGEyMjIxZGM3NGM3NjdhYzZkYWIzYjc1YmE\
MzAwZmZlNzcxZmIzMGJhZTBhMzQ4OGUxYTBhYzU0MmI\
N2EwOTVlZWIzMzg1MWMwZWM2N2YwNDMzMzE3MTdkOTU\
ZjM2ZmFlM2NiMDI3MTdhMjQxNjc3YTRkNTI4ODNhZDM\
MzQ3ODE1N2IzZDcwODk0YjVmYzI3MTI5NmU4MjViOTU\
Y2Q1NTQ3M2ZlMWY5MzgzYmZjZTkzN2YyNmRhNjliOTY\
OGE0MjA4YzBiOTU1NDAyNDM1ZTcwYjY0NDE1OTE2MmE\
YjFmNmU4ODA5YTAwMWI2N2MwNDE4NzU3NWEwMGNkN2Q\
OTU0YTcxNzkyZTJiZjlhYjcxOTk1NzdmYjc2NWI3YjQ\
OWNmOGJmYjM3MGQxNDMxZGE3OGYwMTU4ODEwY2Y5OTI\
MWUxMzAyMzUzNTFmNjUyMjU4NjkzNjM3MTU1YmUyMzU\
NTQyYjhlYTIzMzI2NTE0ZTAzOGVlZjM4ZDVjZTBmNzc=\n-END PUBLIC KEY-;

pub_bio = BIO_new_mem_buf(publicKey_test, -1);
 if(pub_bio == NULL) {
ERR_print_errors_fp(stdout);
return 1;
 }

public_key = PEM_read_bio_RSA_PUBKEY(pub_bio, NULL, NULL, NULL);
 if(public_key == NULL) {
  ERR_print_errors_fp(stdout);

}
RSA_free(public_key);

return 0;

 }


Here I try to convert the following public key raw data into PEM format.
I encode the data into base64 and add-BEGIN PUBLIC KEY-, END
PUBLIC KEY-.
The raw data is as following 256 Bytes:
92 c3 b7 52 f2 fe 38 d9 6c 92 62 21 77 46 9e 73
1a 10 99 2f d5 f7 1a 47 be 34 a3 71 06 dd 3d 19
e5 34 78 96 89 d3 3a ea dc 2d 65 a3 4c 96 7c c8
84 33 3a 42 8b 12 84 cf d4 dc df 5c 3e 24 59 69
73 f0 02 da 22 21 dc 74 c7 67 ac 6d ab 3b 75 ba
30 0f fe 77 1f b3 0b ae 0a 34 88 e1 a0 ac 54 2b
7a 09 5e eb 33 85 1c 0e c6 7f 04 33 31 71 7d 95
f3 6f ae 3c b0 27 17 a2 41 67 7a 4d 52 88 3a d3
34 78 15 7b 3d 70 89 4b 5f c2 71 29 6e 82 5b 95
cd 55 47 3f e1 f9 38 3b fc e9 37 f2 6d a6 9b 96
8a 42 08 c0 b9 55 40 24 35 e7 0b 64 41 59 16 2a
b1 f6 e8 80 9a 00 1b 67 c0 41 87 57 5a 00 cd 7d
95 4a 71 79 2e 2b f9 ab 71 99 57 7f b7 65 b7 b4
9c f8 bf b3 70 d1 43 1d a7 8f 01 58 81 0c f9 92
1e 13 02 35 35 1f 65 22 58 69 36 37 15 5b e2 35
54 2b 8e a2 33 26 51 4e 03 8e ef 38 d5 ce 0f 77


Thank you in advance!

Hunter


Re: how to generate RSA format data?

2010-02-02 Thread Shahin Khorasani




Hello hunter,

Your raw data seems to be a RSA public key modulus.
A public key in ASN.1 must have an algorithm identifier and an exponent.
Take a look at this sample:
raw data is (hexdump):

8230 2201 0d30 0906 862a 8648 0df7 0101
0501 0300 0182 000f 8230 0a01 8202 0101
d200 808c f87b cf63 7cb3 2cff 43dd 5cf5--- You just
provided this part
7def d1f5 adaa 0944 87ea f398 a654 b36d
2303 4d68 e9fa fd46 9171 0f97 2960 cd1e
6045 21aa 6986 44e2 679f 5a07 bbf9 157e
82e2 82a8 5f42 7cee 4af6 7c1a e53d 05a3
cf9a fc6a a0d9 6850 64f1 a6af f6fe c61c
f39f ba1e cb31 c734 5c2f 4937 5383 4de5
7b29 010a 2f86 41ab 00af 2ce3 3a48 3d19
41c2 3196 455d 219b d1a0 9600 a107 65a7
f195 aacd a105 3c71 fc7f 9c58 5825 6bd7
ffe7 8d47 6c3d de2a 2779 489f 2641 ed81
9f54 62e2 c4ed 893d e0bf 3678 a8c9 6573
bda9 9b1f acb1 6634 9375 48bf ef82 887c
0e08 6b68 b6f3 8170 bda0 f8a7 2e1b 023d
5309 a755 e68e e014 cffd 9610 857a 3ffb
f569 344c 7ea7 2520 d33f 0084 a9ca eaf6
028f 0103 0100


Gutman ASN1 dumper output:

 0 290: SEQUENCE {
 4 13: SEQUENCE {
 6 9: OBJECT IDENTIFIER rsaEncryption (1 2 840 113549 1 1 1)
 17 0: NULL
 : }
 19 271: BIT STRING, encapsulates {
 24 266: SEQUENCE {
 28 257: INTEGER
 : 00 D2 8C 80 7B F8 63 CF B3 7C FF 2C DD 43 F5 5C
 : EF 7D F5 D1 AA AD 44 09 EA 87 98 F3 54 A6 6D B3
 : 03 23 68 4D FA E9 46 FD 71 91 97 0F 60 29 1E CD
 : 45 60 AA 21 86 69 E2 44 9F 67 07 5A F9 BB 7E 15
 : E2 82 A8 82 42 5F EE 7C F6 4A 1A 7C 3D E5 A3 05
 : 9A CF 6A FC D9 A0 50 68 F1 64 AF A6 FE F6 1C C6
 : 9F F3 1E BA 31 CB 34 C7 2F 5C 37 49 83 53 E5 4D
 : 29 7B 0A 01 86 2F AB 41 AF 00 E3 2C 48 3A 19 3D
 : C2 41 96 31 5D 45 9B 21 A0 D1 00 96 07 A1 A7 65
 : 95 F1 CD AA 05 A1 71 3C 7F FC 58 9C 25 58 D7 6B
 : E7 FF 47 8D 3D 6C 2A DE 79 27 9F 48 41 26 81 ED
 : 54 9F E2 62 ED C4 3D 89 BF E0 78 36 C9 A8 73 65
 : A9 BD 1F 9B B1 AC 34 66 75 93 BF 48 82 EF 7C 88
 : 08 0E 68 6B F3 B6 70 81 A0 BD A7 F8 1B 2E 3D 02
 : 09 53 55 A7 8E E6 14 E0 FD CF 10 96 7A 85 FB 3F
 : 69 F5 4C 34 A7 7E 20 25 3F D3 84 00 CA A9 F6 EA
 : 8F
289 3: INTEGER 65537
 : }
 : }
 : }

Regards,
Shahin Khorasani


hunter li wrote:
Hi, All,
I have the following code to generate the RSA data. But it always gives
me error:
5049:error:0906D064:lib(9):func(109):reason(100):pem_lib.c:756.
  
I do appreciate any suggestion! 
  
  
#include stdio.h
#include stdlib.h
#include stdint.h
#include string.h
  
#include openssl/bio.h
#include openssl/rsa.h
#include openssl/pem.h
#include openssl/err.h
  
int main(void)
{
  
RSA *public_key;
BIO *pub_bio;
  
char *publicKey_test = "-BEGIN PUBLIC
KEY-\nOTJjM2I3NTJmMmZlMzhkOTZjOTI2MjIxNzc0NjllNzM\
MWExMDk5MmZkNWY3MWE0N2JlMzRhMzcxMDZkZDNkMTk\
ZTUzNDc4OTY4OWQzM2FlYWRjMmQ2NWEzNGM5NjdjYzg\
ODQzMzNhNDI4YjEyODRjZmQ0ZGNkZjVjM2UyNDU5Njk\
NzNmMDAyZGEyMjIxZGM3NGM3NjdhYzZkYWIzYjc1YmE\
MzAwZmZlNzcxZmIzMGJhZTBhMzQ4OGUxYTBhYzU0MmI\
N2EwOTVlZWIzMzg1MWMwZWM2N2YwNDMzMzE3MTdkOTU\
ZjM2ZmFlM2NiMDI3MTdhMjQxNjc3YTRkNTI4ODNhZDM\
MzQ3ODE1N2IzZDcwODk0YjVmYzI3MTI5NmU4MjViOTU\
Y2Q1NTQ3M2ZlMWY5MzgzYmZjZTkzN2YyNmRhNjliOTY\
OGE0MjA4YzBiOTU1NDAyNDM1ZTcwYjY0NDE1OTE2MmE\
YjFmNmU4ODA5YTAwMWI2N2MwNDE4NzU3NWEwMGNkN2Q\
OTU0YTcxNzkyZTJiZjlhYjcxOTk1NzdmYjc2NWI3YjQ\
OWNmOGJmYjM3MGQxNDMxZGE3OGYwMTU4ODEwY2Y5OTI\
MWUxMzAyMzUzNTFmNjUyMjU4NjkzNjM3MTU1YmUyMzU\
NTQyYjhlYTIzMzI2NTE0ZTAzOGVlZjM4ZDVjZTBmNzc=\n-END PUBLIC KEY-";
  
pub_bio = BIO_new_mem_buf(publicKey_test, -1);
if(pub_bio == NULL) {
 ERR_print_errors_fp(stdout);
 return 1;
}
  
public_key = PEM_read_bio_RSA_PUBKEY(pub_bio, NULL, NULL, NULL);
if(public_key == NULL) {
 ERR_print_errors_fp(stdout);
  
}
 RSA_free(public_key);
  
return 0;
  
}
  
  
Here I try to convert the following public key raw data into PEM format.
I encode the data into base64 and add"-BEGIN PUBLIC KEY-",
"END PUBLIC KEY-".
The raw data is as following 256 Bytes:
92 c3 b7 52 f2 fe 38 d9 6c 92 62 21 77 46 9e 73
1a 10 99 2f d5 f7 1a 47 be 34 a3 71 06 dd 3d 19
e5 34 78 96 89 d3 3a ea dc 2d 65 a3 4c 96 7c c8
84 33 3a 42 8b 12 84 cf d4 dc df 5c 3e 24 59 69
73 f0 02 da 22 21 dc 74 c7 67 ac 6d ab 3b 75 ba
30 0f fe 77 1f b3 0b ae 0a 34 88 e1 a0 ac 54 2b
7a 09 5e eb 33 85 1c 0e c6 7f 04 33 31 71 7d 95
f3 6f ae 3c b0 27 17 a2 41 67 7a 4d 52 88 3a d3
34 78 15 7b 3d 70 89 4b 5f c2 71 29 6e 82 5b 95
cd 55 47 3f e1 f9 38 3b fc e9 37 f2 6d a6 9b 96
8a 42 08 c0 b9 55 40 24 35 e7 0b 64 41 59 16 2a
b1 f6 e8 80 9a 00 1b 67 c0 41 87 57 5a 00 cd 7d
95 4a 71 79 2e 2b f9 ab 71 99 57 7f b7 65 b7 b4
9c f8 bf b3 70 d1 43 1d a7 8f 01 58 81 0c f9 92
1e 13 02 35 35 1f 65 22 58 69 36 37 15 5b e2 35
54 2b 8e a2 33 26 51 4e 03 8e ef 38 d5 ce 0f 77
  
  
Thank you in advance!
  
Hunter



__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org