资源简介
从官网下载的GmSSL2.0版本的源代码里面有两个地方出现了问题,无法直接编译通过。这个是进行修改后可以没有问题的代码。
代码片段和文件信息
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the “License“). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#if !defined(_POSIX_C_SOURCE) && defined(OPENSSL_SYS_VMS)
/*
* On VMS you need to define this to get the declaration of fileno(). The
* value 2 is to make sure no function defined in POSIX-2 is left undefined.
*/
# define _POSIX_C_SOURCE 2
#endif
#include
#include
#include
#ifndef NO_SYS_TYPES_H
# include
#endif
#ifndef OPENSSL_NO_POSIX_IO
# include
# include
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifndef OPENSSL_NO_ENGINE
# include
#endif
#ifndef OPENSSL_NO_RSA
# include
#endif
#include
#include
#include “s_apps.h“
#include “apps.h“
#ifdef _WIN32
static int WIN32_rename(const char *from const char *to);
# define rename(fromto) WIN32_rename((from)(to))
#endif
typedef struct {
const char *name;
unsigned long flag;
unsigned long mask;
} NAME_EX_TBL;
#if !defined(OPENSSL_NO_UI) || !defined(OPENSSL_NO_ENGINE)
static UI_METHOD *ui_method = NULL;
#endif
static int set_table_opts(unsigned long *flags const char *arg
const NAME_EX_TBL * in_tbl);
static int set_multi_opts(unsigned long *flags const char *arg
const NAME_EX_TBL * in_tbl);
int app_init(long mesgwin);
int chopup_args(ARGS *arg char *buf)
{
int quoted;
char c = ‘\0‘ *p = NULL;
arg->argc = 0;
if (arg->size == 0) {
arg->size = 20;
arg->argv = app_malloc(sizeof(*arg->argv) * arg->size “argv space“);
}
for (p = buf;;) {
/* Skip whitespace. */
while (*p && isspace(_UC(*p)))
p++;
if (!*p)
break;
/* The start of something good :-) */
if (arg->argc >= arg->size) {
char **tmp;
arg->size += 20;
tmp = OPENSSL_realloc(arg->argv sizeof(*arg->argv) * arg->size);
if (tmp == NULL)
return 0;
arg->argv = tmp;
}
quoted = *p == ‘\‘‘ || *p == ‘“‘;
if (quoted)
c = *p++;
arg->argv[arg->argc++] = p;
/* now look for the end of this */
if (quoted) {
while (*p && *p != c)
p++;
*p++ = ‘\0‘;
} else {
while (*p && !isspace(_UC(*p)))
p++;
if (*p)
*p++ = ‘\0‘;
}
}
arg->argv[arg->argc] = NULL;
return (1);
}
#ifndef APP_INIT
int a
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3058 2017-12-07 19:17 GmSSL-gmssl-2.0\.gitignore
文件 796 2017-12-07 19:17 GmSSL-gmssl-2.0\.travis.yml
文件 71256 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\apps.c
文件 22662 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\apps.h
文件 3135 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\app_rand.c
文件 9440 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\asn1pars.c
文件 894 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\build.info
文件 3 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\ca-cert.srl
文件 916 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\ca-key.pem
文件 635 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\ca-req.pem
文件 84020 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\ca.c
文件 6734 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\CA.pl.in
文件 623 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\cert.pem
文件 6771 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\ciphers.c
文件 3285 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\client.pem
文件 44971 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\cms.c
文件 3041 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\cpk.c
文件 11167 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\crl.c
文件 6295 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\crl2p7.c
文件 1718 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\ct_log_list.cnf
文件 716 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\demoCA\cacert.pem
文件 2464 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\demoCA\index.txt
文件 1214 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\demoCA\private\cakey.pem
文件 5 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\demoCA\serial
文件 359 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\demoSRP\srp_verifier.txt
文件 21 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\demoSRP\srp_verifier.txt.attr
文件 15503 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\dgst.c
文件 447 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\dh1024.pem
文件 664 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\dh2048.pem
文件 1009 2017-12-07 19:17 GmSSL-gmssl-2.0\apps\dh4096.pem
............此处省略2795个文件信息
评论
共有 条评论