diff options
author | jsing <> | 2016-12-27 09:12:19 +0000 |
---|---|---|
committer | jsing <> | 2016-12-27 09:12:19 +0000 |
commit | 5a8dbd7846287a88775fe3a5efaf24cab9778d53 (patch) | |
tree | b222062fe341f86024725ac79b65ac3b4b6efe0f /src | |
parent | 8eabf8626f7ad62a998c0324120e545baeca0df1 (diff) | |
download | openbsd-5a8dbd7846287a88775fe3a5efaf24cab9778d53.tar.gz openbsd-5a8dbd7846287a88775fe3a5efaf24cab9778d53.tar.bz2 openbsd-5a8dbd7846287a88775fe3a5efaf24cab9778d53.zip |
Expand DECLARE_ASN1_* macros. No change in preprocessor output, excluding
line numbering and new lines.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1.h | 112 |
1 files changed, 92 insertions, 20 deletions
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index 72fdc72881..d744b64665 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1.h,v 1.35 2016/11/04 18:07:23 beck Exp $ */ | 1 | /* $OpenBSD: asn1.h,v 1.36 2016/12/27 09:12:19 jsing 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 | * |
@@ -520,8 +520,12 @@ DECLARE_ASN1_SET_OF(ASN1_TYPE) | |||
520 | 520 | ||
521 | typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; | 521 | typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; |
522 | 522 | ||
523 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) | 523 | ASN1_SEQUENCE_ANY *d2i_ASN1_SEQUENCE_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len); |
524 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) | 524 | int i2d_ASN1_SEQUENCE_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out); |
525 | extern const ASN1_ITEM ASN1_SEQUENCE_ANY_it; | ||
526 | ASN1_SEQUENCE_ANY *d2i_ASN1_SET_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len); | ||
527 | int i2d_ASN1_SET_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out); | ||
528 | extern const ASN1_ITEM ASN1_SET_ANY_it; | ||
525 | 529 | ||
526 | typedef struct NETSCAPE_X509_st { | 530 | typedef struct NETSCAPE_X509_st { |
527 | ASN1_OCTET_STRING *header; | 531 | ASN1_OCTET_STRING *header; |
@@ -775,7 +779,11 @@ void ASN1_STRING_length_set(ASN1_STRING *x, int n); | |||
775 | int ASN1_STRING_type(ASN1_STRING *x); | 779 | int ASN1_STRING_type(ASN1_STRING *x); |
776 | unsigned char * ASN1_STRING_data(ASN1_STRING *x); | 780 | unsigned char * ASN1_STRING_data(ASN1_STRING *x); |
777 | 781 | ||
778 | DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) | 782 | ASN1_BIT_STRING *ASN1_BIT_STRING_new(void); |
783 | void ASN1_BIT_STRING_free(ASN1_BIT_STRING *a); | ||
784 | ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **in, long len); | ||
785 | int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **out); | ||
786 | extern const ASN1_ITEM ASN1_BIT_STRING_it; | ||
779 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); | 787 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); |
780 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, | 788 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, |
781 | const unsigned char **pp, long length); | 789 | const unsigned char **pp, long length); |
@@ -796,7 +804,11 @@ int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, | |||
796 | int i2d_ASN1_BOOLEAN(int a, unsigned char **pp); | 804 | int i2d_ASN1_BOOLEAN(int a, unsigned char **pp); |
797 | int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length); | 805 | int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length); |
798 | 806 | ||
799 | DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) | 807 | ASN1_INTEGER *ASN1_INTEGER_new(void); |
808 | void ASN1_INTEGER_free(ASN1_INTEGER *a); | ||
809 | ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **in, long len); | ||
810 | int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **out); | ||
811 | extern const ASN1_ITEM ASN1_INTEGER_it; | ||
800 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp); | 812 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp); |
801 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, | 813 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, |
802 | long length); | 814 | long length); |
@@ -805,7 +817,11 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, | |||
805 | ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); | 817 | ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); |
806 | int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); | 818 | int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); |
807 | 819 | ||
808 | DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) | 820 | ASN1_ENUMERATED *ASN1_ENUMERATED_new(void); |
821 | void ASN1_ENUMERATED_free(ASN1_ENUMERATED *a); | ||
822 | ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char **in, long len); | ||
823 | int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out); | ||
824 | extern const ASN1_ITEM ASN1_ENUMERATED_it; | ||
809 | 825 | ||
810 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); | 826 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); |
811 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); | 827 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); |
@@ -822,30 +838,82 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, | |||
822 | time_t t, int offset_day, long offset_sec); | 838 | time_t t, int offset_day, long offset_sec); |
823 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); | 839 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); |
824 | 840 | ||
825 | DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) | 841 | ASN1_OCTET_STRING *ASN1_OCTET_STRING_new(void); |
842 | void ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *a); | ||
843 | ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a, const unsigned char **in, long len); | ||
844 | int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **out); | ||
845 | extern const ASN1_ITEM ASN1_OCTET_STRING_it; | ||
826 | ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a); | 846 | ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a); |
827 | int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, | 847 | int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, |
828 | const ASN1_OCTET_STRING *b); | 848 | const ASN1_OCTET_STRING *b); |
829 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, | 849 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, |
830 | int len); | 850 | int len); |
831 | 851 | ||
832 | DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) | 852 | ASN1_VISIBLESTRING *ASN1_VISIBLESTRING_new(void); |
833 | DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) | 853 | void ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *a); |
834 | DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) | 854 | ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a, const unsigned char **in, long len); |
835 | DECLARE_ASN1_FUNCTIONS(ASN1_NULL) | 855 | int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **out); |
836 | DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) | 856 | extern const ASN1_ITEM ASN1_VISIBLESTRING_it; |
857 | ASN1_UNIVERSALSTRING *ASN1_UNIVERSALSTRING_new(void); | ||
858 | void ASN1_UNIVERSALSTRING_free(ASN1_UNIVERSALSTRING *a); | ||
859 | ASN1_UNIVERSALSTRING *d2i_ASN1_UNIVERSALSTRING(ASN1_UNIVERSALSTRING **a, const unsigned char **in, long len); | ||
860 | int i2d_ASN1_UNIVERSALSTRING(ASN1_UNIVERSALSTRING *a, unsigned char **out); | ||
861 | extern const ASN1_ITEM ASN1_UNIVERSALSTRING_it; | ||
862 | ASN1_UTF8STRING *ASN1_UTF8STRING_new(void); | ||
863 | void ASN1_UTF8STRING_free(ASN1_UTF8STRING *a); | ||
864 | ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a, const unsigned char **in, long len); | ||
865 | int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **out); | ||
866 | extern const ASN1_ITEM ASN1_UTF8STRING_it; | ||
867 | ASN1_NULL *ASN1_NULL_new(void); | ||
868 | void ASN1_NULL_free(ASN1_NULL *a); | ||
869 | ASN1_NULL *d2i_ASN1_NULL(ASN1_NULL **a, const unsigned char **in, long len); | ||
870 | int i2d_ASN1_NULL(ASN1_NULL *a, unsigned char **out); | ||
871 | extern const ASN1_ITEM ASN1_NULL_it; | ||
872 | ASN1_BMPSTRING *ASN1_BMPSTRING_new(void); | ||
873 | void ASN1_BMPSTRING_free(ASN1_BMPSTRING *a); | ||
874 | ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, const unsigned char **in, long len); | ||
875 | int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **out); | ||
876 | extern const ASN1_ITEM ASN1_BMPSTRING_it; | ||
837 | 877 | ||
838 | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) | 878 | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) |
839 | 879 | ||
840 | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) | 880 | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) |
841 | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) | 881 | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) |
842 | DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) | 882 | ASN1_PRINTABLESTRING *ASN1_PRINTABLESTRING_new(void); |
843 | DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) | 883 | void ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *a); |
844 | DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) | 884 | ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a, const unsigned char **in, long len); |
845 | DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) | 885 | int i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **out); |
846 | DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME) | 886 | extern const ASN1_ITEM ASN1_PRINTABLESTRING_it; |
847 | DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) | 887 | ASN1_T61STRING *ASN1_T61STRING_new(void); |
848 | DECLARE_ASN1_FUNCTIONS(ASN1_TIME) | 888 | void ASN1_T61STRING_free(ASN1_T61STRING *a); |
889 | ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, const unsigned char **in, long len); | ||
890 | int i2d_ASN1_T61STRING(ASN1_T61STRING *a, unsigned char **out); | ||
891 | extern const ASN1_ITEM ASN1_T61STRING_it; | ||
892 | ASN1_IA5STRING *ASN1_IA5STRING_new(void); | ||
893 | void ASN1_IA5STRING_free(ASN1_IA5STRING *a); | ||
894 | ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, const unsigned char **in, long len); | ||
895 | int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **out); | ||
896 | extern const ASN1_ITEM ASN1_IA5STRING_it; | ||
897 | ASN1_GENERALSTRING *ASN1_GENERALSTRING_new(void); | ||
898 | void ASN1_GENERALSTRING_free(ASN1_GENERALSTRING *a); | ||
899 | ASN1_GENERALSTRING *d2i_ASN1_GENERALSTRING(ASN1_GENERALSTRING **a, const unsigned char **in, long len); | ||
900 | int i2d_ASN1_GENERALSTRING(ASN1_GENERALSTRING *a, unsigned char **out); | ||
901 | extern const ASN1_ITEM ASN1_GENERALSTRING_it; | ||
902 | ASN1_UTCTIME *ASN1_UTCTIME_new(void); | ||
903 | void ASN1_UTCTIME_free(ASN1_UTCTIME *a); | ||
904 | ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, const unsigned char **in, long len); | ||
905 | int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **out); | ||
906 | extern const ASN1_ITEM ASN1_UTCTIME_it; | ||
907 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_new(void); | ||
908 | void ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *a); | ||
909 | ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a, const unsigned char **in, long len); | ||
910 | int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **out); | ||
911 | extern const ASN1_ITEM ASN1_GENERALIZEDTIME_it; | ||
912 | ASN1_TIME *ASN1_TIME_new(void); | ||
913 | void ASN1_TIME_free(ASN1_TIME *a); | ||
914 | ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len); | ||
915 | int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out); | ||
916 | extern const ASN1_ITEM ASN1_TIME_it; | ||
849 | 917 | ||
850 | DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) | 918 | DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) |
851 | 919 | ||
@@ -1002,7 +1070,11 @@ const char *ASN1_tag2str(int tag); | |||
1002 | 1070 | ||
1003 | /* Used to load and write netscape format cert */ | 1071 | /* Used to load and write netscape format cert */ |
1004 | 1072 | ||
1005 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_X509) | 1073 | NETSCAPE_X509 *NETSCAPE_X509_new(void); |
1074 | void NETSCAPE_X509_free(NETSCAPE_X509 *a); | ||
1075 | NETSCAPE_X509 *d2i_NETSCAPE_X509(NETSCAPE_X509 **a, const unsigned char **in, long len); | ||
1076 | int i2d_NETSCAPE_X509(NETSCAPE_X509 *a, unsigned char **out); | ||
1077 | extern const ASN1_ITEM NETSCAPE_X509_it; | ||
1006 | 1078 | ||
1007 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); | 1079 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); |
1008 | 1080 | ||