diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-09-02 22:01:18 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-09-06 00:17:37 +0100 |
commit | a8d8e06b0ac06c421fd11cc1772126dcb98f79ae (patch) | |
tree | 14775147addd9c7785f12bc00db95c1a4a96d566 /apps/x509.c | |
parent | f728254a840bf7fdd2252fe09e11a0e99c7df1d4 (diff) |
Avoid direct X509 structure access
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'apps/x509.c')
-rw-r--r-- | apps/x509.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/x509.c b/apps/x509.c index 6b41a7501a..acce9e9ddd 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -894,8 +894,13 @@ int x509_main(int argc, char **argv) goto end; } - if (badsig) - x->signature->data[x->signature->length - 1] ^= 0x1; + if (badsig) { + ASN1_BIT_STRING *signature; + unsigned char *s; + X509_get0_signature(&signature, NULL, x); + s = ASN1_STRING_data(signature); + s[ASN1_STRING_length(signature) - 1] ^= 0x1; + } if (outformat == FORMAT_ASN1) i = i2d_X509_bio(out, x); |