mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
Fix CRL ext bug
This commit is contained in:
@@ -383,12 +383,21 @@ int x509_signature_algor_from_der(int *oid, const uint8_t **in, size_t *inlen)
|
|||||||
if (ret < 0) error_print();
|
if (ret < 0) error_print();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
if (asn1_oid_info_from_der(&info, x509_sign_algors, x509_sign_algors_count, &p, &len) != 1
|
if (asn1_oid_info_from_der(&info, x509_sign_algors, x509_sign_algors_count, &p, &len) != 1) {
|
||||||
|| (info->flags && asn1_null_from_der(&p, &len) < 0)
|
|
||||||
|| asn1_length_is_zero(len) != 1) {
|
|
||||||
error_print();
|
error_print();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (len) {
|
||||||
|
if (asn1_null_from_der(&p, &len) < 0) {
|
||||||
|
error_print();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
// FIXME: check info->flags
|
||||||
|
if (len) {
|
||||||
|
error_print();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
*oid = info->oid;
|
*oid = info->oid;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1068,8 +1068,8 @@ int x509_tbs_cert_print(FILE *fp, int fmt, int ind, const char *label, const uin
|
|||||||
if (ret) format_print(fp, fmt, ind, "version: %s (%d)\n", x509_version_name(val), val);
|
if (ret) format_print(fp, fmt, ind, "version: %s (%d)\n", x509_version_name(val), val);
|
||||||
if (asn1_integer_from_der(&p, &len, &d, &dlen) != 1) goto err;
|
if (asn1_integer_from_der(&p, &len, &d, &dlen) != 1) goto err;
|
||||||
format_bytes(fp, fmt, ind, "serialNumber", p, len);
|
format_bytes(fp, fmt, ind, "serialNumber", p, len);
|
||||||
if (x509_signature_algor_from_der(&val, &d, &dlen) != 1) goto err;
|
if (asn1_sequence_from_der(&p, &len, &d, &dlen) != 1) goto err;
|
||||||
format_print(fp, fmt, ind, "siganture: %s\n", x509_signature_algor_name(val));
|
x509_signature_algor_print(fp, fmt, ind, "signature", p, len);
|
||||||
if (asn1_sequence_from_der(&p, &len, &d, &dlen) != 1) goto err;
|
if (asn1_sequence_from_der(&p, &len, &d, &dlen) != 1) goto err;
|
||||||
x509_name_print(fp, fmt, ind, "issuer", p, len);
|
x509_name_print(fp, fmt, ind, "issuer", p, len);
|
||||||
if (asn1_sequence_from_der(&p, &len, &d, &dlen) != 1) goto err;
|
if (asn1_sequence_from_der(&p, &len, &d, &dlen) != 1) goto err;
|
||||||
|
|||||||
@@ -2623,7 +2623,7 @@ int x509_uri_as_distribution_point_name_from_der(const char **uri, size_t *urile
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
if (choice == X509_full_name) {
|
if (choice == X509_full_name) {
|
||||||
if (x509_general_names_get_first(d, dlen, NULL, choice, (const uint8_t **)uri, urilen) < 0) {
|
if (x509_general_names_get_first(d, dlen, NULL, X509_gn_uniform_resource_identifier, (const uint8_t **)uri, urilen) < 0) {
|
||||||
error_print();
|
error_print();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ bad:
|
|||||||
|
|
||||||
if (!cert) {
|
if (!cert) {
|
||||||
fprintf(stderr, "%s: `-cert` option required\n", prog);
|
fprintf(stderr, "%s: `-cert` option required\n", prog);
|
||||||
printf("usage: gmssl %s %s\n\n", prog, options);
|
printf("usage: gmssl %s %s\n\n", prog, usage);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user