mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-09 07:23:56 +08:00
Remove depends on ctype functions
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash -x
|
#!/bin/bash -x
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
# generate self-signed CA certificate
|
# generate self-signed CA certificate
|
||||||
gmssl sm2keygen -pass 1234 -out cakey.pem -pubout pubkey.pem
|
gmssl sm2keygen -pass 1234 -out cakey.pem -pubout pubkey.pem
|
||||||
gmssl certgen -C CN -ST Beijing -L Haidian -O PKU -OU CS -CN CA -days 365 -key cakey.pem -pass 1234 -out cacert.pem
|
gmssl certgen -C CN -ST Beijing -L Haidian -O PKU -OU CS -CN CA -days 365 -key cakey.pem -pass 1234 -out cacert.pem
|
||||||
@@ -24,3 +26,17 @@ gmssl reqsign -in alicereq.pem -days 365 -key_usage digitalSignature -cacert cac
|
|||||||
gmssl certparse -in alicecert.pem
|
gmssl certparse -in alicecert.pem
|
||||||
|
|
||||||
|
|
||||||
|
rm -fr pubkey.pem
|
||||||
|
rm -fr cacert.pem
|
||||||
|
rm -fr signkey.pem
|
||||||
|
rm -fr signreq.pem
|
||||||
|
rm -fr signcert.pem
|
||||||
|
rm -fr enckey.pem
|
||||||
|
rm -fr encreq.pem
|
||||||
|
rm -fr enccert.pem
|
||||||
|
rm -fr alicekey.pem
|
||||||
|
rm -fr alicepubkey.pem
|
||||||
|
rm -fr alicereq.pem
|
||||||
|
rm -fr alicecert.pem
|
||||||
|
|
||||||
|
echo ok
|
||||||
|
|||||||
@@ -1334,9 +1334,12 @@ int asn1_utf8_string_from_der_ex(int tag, const char **a, size_t *alen, const ui
|
|||||||
|
|
||||||
static int asn1_char_is_printable(int a)
|
static int asn1_char_is_printable(int a)
|
||||||
{
|
{
|
||||||
if (isalpha(a) || isdigit(a)) {
|
if (('0' <= a && a <= '9')
|
||||||
|
|| ('a' <= a && a <= 'z')
|
||||||
|
|| ('A' <= a && a <= 'Z')) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (a) {
|
switch (a) {
|
||||||
case ' ': case '\'': case '(': case ')':
|
case ' ': case '\'': case '(': case ')':
|
||||||
case '+': case ',': case '-': case '.':
|
case '+': case ',': case '-': case '.':
|
||||||
@@ -1494,7 +1497,7 @@ int asn1_time_from_str(int utc_time, time_t *timestamp, const char *str)
|
|||||||
|
|
||||||
utc_time &= 1;
|
utc_time &= 1;
|
||||||
for (i = 0; i < time_str_len[utc_time] - 1; i++) {
|
for (i = 0; i < time_str_len[utc_time] - 1; i++) {
|
||||||
if (!isdigit(str[i])) {
|
if (!('0' <= str[i] && str[i] <= '9')) {
|
||||||
error_print();
|
error_print();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user