diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/Symbols.list | 9 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/x_crl.c | 32 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509.h | 29 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509_set.c | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509/x509rset.c | 14 |
5 files changed, 80 insertions, 18 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index 01b21bddc6..dc11ea497f 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list | |||
| @@ -2672,14 +2672,19 @@ X509_CRL_get0_extensions | |||
| 2672 | X509_CRL_get0_lastUpdate | 2672 | X509_CRL_get0_lastUpdate |
| 2673 | X509_CRL_get0_nextUpdate | 2673 | X509_CRL_get0_nextUpdate |
| 2674 | X509_CRL_get0_signature | 2674 | X509_CRL_get0_signature |
| 2675 | X509_CRL_get_REVOKED | ||
| 2675 | X509_CRL_get_ext | 2676 | X509_CRL_get_ext |
| 2676 | X509_CRL_get_ext_by_NID | 2677 | X509_CRL_get_ext_by_NID |
| 2677 | X509_CRL_get_ext_by_OBJ | 2678 | X509_CRL_get_ext_by_OBJ |
| 2678 | X509_CRL_get_ext_by_critical | 2679 | X509_CRL_get_ext_by_critical |
| 2679 | X509_CRL_get_ext_count | 2680 | X509_CRL_get_ext_count |
| 2680 | X509_CRL_get_ext_d2i | 2681 | X509_CRL_get_ext_d2i |
| 2682 | X509_CRL_get_issuer | ||
| 2683 | X509_CRL_get_lastUpdate | ||
| 2681 | X509_CRL_get_meth_data | 2684 | X509_CRL_get_meth_data |
| 2685 | X509_CRL_get_nextUpdate | ||
| 2682 | X509_CRL_get_signature_nid | 2686 | X509_CRL_get_signature_nid |
| 2687 | X509_CRL_get_version | ||
| 2683 | X509_CRL_it | 2688 | X509_CRL_it |
| 2684 | X509_CRL_match | 2689 | X509_CRL_match |
| 2685 | X509_CRL_new | 2690 | X509_CRL_new |
| @@ -2819,6 +2824,8 @@ X509_REQ_get_extension_nids | |||
| 2819 | X509_REQ_get_extensions | 2824 | X509_REQ_get_extensions |
| 2820 | X509_REQ_get_pubkey | 2825 | X509_REQ_get_pubkey |
| 2821 | X509_REQ_get_signature_nid | 2826 | X509_REQ_get_signature_nid |
| 2827 | X509_REQ_get_subject_name | ||
| 2828 | X509_REQ_get_version | ||
| 2822 | X509_REQ_it | 2829 | X509_REQ_it |
| 2823 | X509_REQ_new | 2830 | X509_REQ_new |
| 2824 | X509_REQ_print | 2831 | X509_REQ_print |
| @@ -3011,7 +3018,9 @@ X509_get_pubkey | |||
| 3011 | X509_get_pubkey_parameters | 3018 | X509_get_pubkey_parameters |
| 3012 | X509_get_serialNumber | 3019 | X509_get_serialNumber |
| 3013 | X509_get_signature_nid | 3020 | X509_get_signature_nid |
| 3021 | X509_get_signature_type | ||
| 3014 | X509_get_subject_name | 3022 | X509_get_subject_name |
| 3023 | X509_get_version | ||
| 3015 | X509_getm_notAfter | 3024 | X509_getm_notAfter |
| 3016 | X509_getm_notBefore | 3025 | X509_getm_notBefore |
| 3017 | X509_gmtime_adj | 3026 | X509_gmtime_adj |
diff --git a/src/lib/libcrypto/asn1/x_crl.c b/src/lib/libcrypto/asn1/x_crl.c index 890623c47c..0837ec15be 100644 --- a/src/lib/libcrypto/asn1/x_crl.c +++ b/src/lib/libcrypto/asn1/x_crl.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x_crl.c,v 1.32 2018/04/23 13:10:19 tb Exp $ */ | 1 | /* $OpenBSD: x_crl.c,v 1.33 2018/08/24 19:55:58 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -706,18 +706,48 @@ X509_CRL_get0_extensions(const X509_CRL *crl) | |||
| 706 | return crl->crl->extensions; | 706 | return crl->crl->extensions; |
| 707 | } | 707 | } |
| 708 | 708 | ||
| 709 | long | ||
| 710 | X509_CRL_get_version(const X509_CRL *crl) | ||
| 711 | { | ||
| 712 | return ASN1_INTEGER_get(crl->crl->version); | ||
| 713 | } | ||
| 714 | |||
| 709 | const ASN1_TIME * | 715 | const ASN1_TIME * |
| 710 | X509_CRL_get0_lastUpdate(const X509_CRL *crl) | 716 | X509_CRL_get0_lastUpdate(const X509_CRL *crl) |
| 711 | { | 717 | { |
| 712 | return crl->crl->lastUpdate; | 718 | return crl->crl->lastUpdate; |
| 713 | } | 719 | } |
| 714 | 720 | ||
| 721 | ASN1_TIME * | ||
| 722 | X509_CRL_get_lastUpdate(X509_CRL *crl) | ||
| 723 | { | ||
| 724 | return crl->crl->lastUpdate; | ||
| 725 | } | ||
| 726 | |||
| 715 | const ASN1_TIME * | 727 | const ASN1_TIME * |
| 716 | X509_CRL_get0_nextUpdate(const X509_CRL *crl) | 728 | X509_CRL_get0_nextUpdate(const X509_CRL *crl) |
| 717 | { | 729 | { |
| 718 | return crl->crl->nextUpdate; | 730 | return crl->crl->nextUpdate; |
| 719 | } | 731 | } |
| 720 | 732 | ||
| 733 | ASN1_TIME * | ||
| 734 | X509_CRL_get_nextUpdate(X509_CRL *crl) | ||
| 735 | { | ||
| 736 | return crl->crl->nextUpdate; | ||
| 737 | } | ||
| 738 | |||
| 739 | X509_NAME * | ||
| 740 | X509_CRL_get_issuer(const X509_CRL *crl) | ||
| 741 | { | ||
| 742 | return crl->crl->issuer; | ||
| 743 | } | ||
| 744 | |||
| 745 | STACK_OF(X509_REVOKED) * | ||
| 746 | X509_CRL_get_REVOKED(X509_CRL *crl) | ||
| 747 | { | ||
| 748 | return crl->crl->revoked; | ||
| 749 | } | ||
| 750 | |||
| 721 | void | 751 | void |
| 722 | X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, | 752 | X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, |
| 723 | const X509_ALGOR **palg) | 753 | const X509_ALGOR **palg) |
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index ed6225997a..e6b205b7fc 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509.h,v 1.69 2018/05/30 15:59:33 tb Exp $ */ | 1 | /* $OpenBSD: x509.h,v 1.70 2018/08/24 19:55:58 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -589,29 +589,21 @@ extern "C" { | |||
| 589 | #define X509_EXT_PACK_UNKNOWN 1 | 589 | #define X509_EXT_PACK_UNKNOWN 1 |
| 590 | #define X509_EXT_PACK_STRING 2 | 590 | #define X509_EXT_PACK_STRING 2 |
| 591 | 591 | ||
| 592 | #define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version) | ||
| 593 | /* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */ | ||
| 594 | #define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore) | ||
| 595 | #define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter) | ||
| 596 | #define X509_extract_key(x) X509_get_pubkey(x) /*****/ | 592 | #define X509_extract_key(x) X509_get_pubkey(x) /*****/ |
| 597 | #define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version) | ||
| 598 | #define X509_REQ_get_subject_name(x) ((x)->req_info->subject) | ||
| 599 | #define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) | 593 | #define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) |
| 600 | #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) | 594 | #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) |
| 601 | #define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) | ||
| 602 | |||
| 603 | #define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) | ||
| 604 | #define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) | ||
| 605 | #define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) | ||
| 606 | #define X509_CRL_get_issuer(x) ((x)->crl->issuer) | ||
| 607 | #define X509_CRL_get_REVOKED(x) ((x)->crl->revoked) | ||
| 608 | 595 | ||
| 609 | int X509_CRL_up_ref(X509_CRL *x); | 596 | int X509_CRL_up_ref(X509_CRL *x); |
| 610 | int X509_CRL_get_signature_nid(const X509_CRL *crl); | 597 | int X509_CRL_get_signature_nid(const X509_CRL *crl); |
| 611 | 598 | ||
| 612 | const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); | 599 | const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); |
| 600 | long X509_CRL_get_version(const X509_CRL *crl); | ||
| 613 | const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl); | 601 | const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl); |
| 614 | const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl); | 602 | const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl); |
| 603 | ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl); | ||
| 604 | ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl); | ||
| 605 | X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl); | ||
| 606 | STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); | ||
| 615 | void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, | 607 | void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, |
| 616 | const X509_ALGOR **palg); | 608 | const X509_ALGOR **palg); |
| 617 | 609 | ||
| @@ -984,6 +976,7 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, | |||
| 984 | const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); | 976 | const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); |
| 985 | const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); | 977 | const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); |
| 986 | int X509_set_version(X509 *x, long version); | 978 | int X509_set_version(X509 *x, long version); |
| 979 | long X509_get_version(const X509 *x); | ||
| 987 | int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); | 980 | int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); |
| 988 | ASN1_INTEGER * X509_get_serialNumber(X509 *x); | 981 | ASN1_INTEGER * X509_get_serialNumber(X509 *x); |
| 989 | int X509_set_issuer_name(X509 *x, X509_NAME *name); | 982 | int X509_set_issuer_name(X509 *x, X509_NAME *name); |
| @@ -1003,9 +996,15 @@ EVP_PKEY * X509_get_pubkey(X509 *x); | |||
| 1003 | EVP_PKEY * X509_get0_pubkey(const X509 *x); | 996 | EVP_PKEY * X509_get0_pubkey(const X509 *x); |
| 1004 | ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); | 997 | ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); |
| 1005 | int X509_certificate_type(const X509 *x, const EVP_PKEY *pubkey); | 998 | int X509_certificate_type(const X509 *x, const EVP_PKEY *pubkey); |
| 999 | int X509_get_signature_type(const X509 *x); | ||
| 1000 | |||
| 1001 | #define X509_get_notBefore X509_getm_notBefore | ||
| 1002 | #define X509_get_notAfter X509_getm_notAfter | ||
| 1006 | 1003 | ||
| 1007 | int X509_REQ_set_version(X509_REQ *x,long version); | 1004 | int X509_REQ_set_version(X509_REQ *x,long version); |
| 1008 | int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); | 1005 | long X509_REQ_get_version(const X509_REQ *x); |
| 1006 | int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name); | ||
| 1007 | X509_NAME *X509_REQ_get_subject_name(const X509_REQ *x); | ||
| 1009 | int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); | 1008 | int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); |
| 1010 | EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); | 1009 | EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); |
| 1011 | int X509_REQ_extension_nid(int nid); | 1010 | int X509_REQ_extension_nid(int nid); |
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c index becdaf6ce5..1a4b583ab7 100644 --- a/src/lib/libcrypto/x509/x509_set.c +++ b/src/lib/libcrypto/x509/x509_set.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_set.c,v 1.16 2018/02/22 17:09:28 jsing Exp $ */ | 1 | /* $OpenBSD: x509_set.c,v 1.17 2018/08/24 19:55:58 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -87,6 +87,12 @@ X509_set_version(X509 *x, long version) | |||
| 87 | return (ASN1_INTEGER_set(x->cert_info->version, version)); | 87 | return (ASN1_INTEGER_set(x->cert_info->version, version)); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | long | ||
| 91 | X509_get_version(const X509 *x) | ||
| 92 | { | ||
| 93 | return ASN1_INTEGER_get(x->cert_info->version); | ||
| 94 | } | ||
| 95 | |||
| 90 | int | 96 | int |
| 91 | X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) | 97 | X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) |
| 92 | { | 98 | { |
| @@ -204,3 +210,9 @@ X509_set_pubkey(X509 *x, EVP_PKEY *pkey) | |||
| 204 | return (0); | 210 | return (0); |
| 205 | return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); | 211 | return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); |
| 206 | } | 212 | } |
| 213 | |||
| 214 | int | ||
| 215 | X509_get_signature_type(const X509 *x) | ||
| 216 | { | ||
| 217 | return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg->algorithm)); | ||
| 218 | } | ||
diff --git a/src/lib/libcrypto/x509/x509rset.c b/src/lib/libcrypto/x509/x509rset.c index cfac977636..de02a40038 100644 --- a/src/lib/libcrypto/x509/x509rset.c +++ b/src/lib/libcrypto/x509/x509rset.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509rset.c,v 1.6 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: x509rset.c,v 1.7 2018/08/24 19:55:58 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -71,6 +71,12 @@ X509_REQ_set_version(X509_REQ *x, long version) | |||
| 71 | return (ASN1_INTEGER_set(x->req_info->version, version)); | 71 | return (ASN1_INTEGER_set(x->req_info->version, version)); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | long | ||
| 75 | X509_REQ_get_version(const X509_REQ *x) | ||
| 76 | { | ||
| 77 | return ASN1_INTEGER_get(x->req_info->version); | ||
| 78 | } | ||
| 79 | |||
| 74 | int | 80 | int |
| 75 | X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name) | 81 | X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name) |
| 76 | { | 82 | { |
| @@ -79,6 +85,12 @@ X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name) | |||
| 79 | return (X509_NAME_set(&x->req_info->subject, name)); | 85 | return (X509_NAME_set(&x->req_info->subject, name)); |
| 80 | } | 86 | } |
| 81 | 87 | ||
| 88 | X509_NAME * | ||
| 89 | X509_REQ_get_subject_name(const X509_REQ *x) | ||
| 90 | { | ||
| 91 | return x->req_info->subject; | ||
| 92 | } | ||
| 93 | |||
| 82 | int | 94 | int |
| 83 | X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey) | 95 | X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey) |
| 84 | { | 96 | { |
