0.阅读与引用
1.安装与源码阅读
1.1 安装
wget https://www.openssl.org/source/old/1.1.0/openssl-1.1.0l.tar.gz
tar -zxvf openssl-1.1.0l.tar.gz
cd openssl-1.1.0l
./config
make
1.2 我的代码阅读路径
D:\005-01-代码\001-开源项目源码\011-openssl\openssl-1.1.0l.tar\openssl-1.1.0l\openssl-1.1.0l
2.ssl学习点
2.1 ssl中的哈希的使用
gcc -o ssl_hash ssl_hash.c -lssl -lcrypto
2.2 BIO
2.2.1 设计
struct bio_st {
const BIO_METHOD *method;
/* bio, mode, argp, argi, argl, ret */
long (*callback) (struct bio_st *, int, const char *, int, long, long);
char *cb_arg; /* first argument for the callback */
int init;
int shutdown;
int flags; /* extra storage */
int retry_reason;
int num;
void *ptr;
struct bio_st *next_bio; /* used by filter BIOs */
struct bio_st *prev_bio; /* used by filter BIOs */
int references;
uint64_t num_read;
uint64_t num_write;
CRYPTO_EX_DATA ex_data;
CRYPTO_RWLOCK *lock;
};
typedef struct bio_method_st BIO_METHOD;
struct bio_method_st {
int type;
char *name;
int (*bwrite) (BIO *, const char *, int);
int (*bread) (BIO *, char *, int);
int (*bputs) (BIO *, const char *);
int (*bgets) (BIO *, char *, int);
long (*ctrl) (BIO *, int, long, void *);
int (*create) (BIO *);
int (*destroy) (BIO *);
long (*callback_ctrl) (BIO *, int, BIO_info_cb *);
};
2.2.2 使用场景
数据流加密.
2.2.3
unsigned后面不加数据类型的时候是unsigned int吗?需要的时候unsigned char,这两个不是一个数据类型,所以会出错.