看板NetSecurity
标 题Re: 请问openssl的问题
发信站无名小站 (Sat Jun 11 02:56:53 2005)
转信站ptt!ctu-reader!ctu-peer!news.nctu!netnews.csie.nctu!wretch
==My Code==
#include <sys/types.h>
/* #include <md5.h>*/
/*With this line I got such error:
In file included from test01.c:2:
/usr/include/md5.h:27: error: syntax error before "UINT4"
/usr/include/md5.h:30: error: syntax error before '}' token
/usr/include/md5.h:38: error: syntax error before "PROTO_LIST"
/usr/include/md5.h:39: error: syntax error before "PROTO_LIST"
/usr/include/md5.h:41: error: syntax error before "PROTO_LIST"
/usr/include/md5.h:43: error: syntax error before "PROTO_LIST"
*/
#include <openssl/rsa.h>
#include <openssl/engine.h>
#include <stdlib.h>
int main()
{
RSA* rsa;
rsa=RSA_generate_key(1024,65537,NULL,NULL);
system("ls");
return 0; /* Add This to prevent gcc warning */
}
==EOF
Command:
$ gcc -o test test01.c -lssl -lcrypto
Please notice that...
1. I use "gcc" instead of "g++"
2. With 2 more link lib command "-lssl -lcrypto"
==Exe Result==
$ ./tset
test01.c tset
==EOF
It's quite hard to tell if it really works or not...
--
夫兵者不祥之器物或恶之故有道者不处君子居则贵左用兵则贵右兵者不祥之器非君子
之器不得已BBS telnet://bbs.wretch.cc 开个人板 超快 不用连署不可得志於天下
矣吉事尚左凶事尚右偏将军居左上将军居右言以丧礼处之杀人之众以哀悲泣之战胜以
丧礼处之道常无名朴虽小天下莫能臣侯王若能守之万物将自宾天地相合以降甘露民莫
之令而自均始制有名名亦既有夫亦将 203-204-199-142.adsl.static.giga.net.tw海