Loading crypto/asn1/a_type.c +31 Changes for crypto/asn1/a_type.c: 31 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -152,3 +152,34 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b) return result; } ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t) { ASN1_OCTET_STRING *oct; ASN1_TYPE *rt; oct = ASN1_item_pack(s, it, NULL); if (oct == NULL) return NULL; if (t && *t) { rt = *t; } else { rt = ASN1_TYPE_new(); if (rt == NULL) { ASN1_OCTET_STRING_free(oct); return NULL; } if (t) *t = rt; } ASN1_TYPE_set(rt, V_ASN1_SEQUENCE, oct); return rt; } void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t) { if (t->type != V_ASN1_SEQUENCE || t->value.sequence == NULL) return NULL; return ASN1_item_unpack(t->value.sequence, it); } crypto/asn1/asn1.h +3 Changes for crypto/asn1/asn1.h: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -592,6 +592,9 @@ void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t); void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t); ASN1_OBJECT *ASN1_OBJECT_new(void); void ASN1_OBJECT_free(ASN1_OBJECT *a); int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp); Loading doc/crypto/ASN1_TYPE_get.pod +22 −1 Changes for doc/crypto/ASN1_TYPE_get.pod: 22 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ =head1 NAME ASN1_TYPE_get, ASN1_TYPE_set, ASN1_TYPE_set1, ASN1_TYPE_cmp - ASN1_TYPE utility ASN1_TYPE_get, ASN1_TYPE_set, ASN1_TYPE_set1, ASN1_TYPE_cmp, ASN1_TYPE_unpack_sequence, ASN1_TYPE_pack_sequence - ASN1_TYPE utility functions =head1 SYNOPSIS Loading @@ -14,6 +14,10 @@ functions int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t); ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t); =head1 DESCRIPTION These functions allow an ASN1_TYPE structure to be manipulated. The Loading @@ -31,6 +35,17 @@ ASN1_TYPE_set1() sets the value of B<a> to B<type> a copy of B<value>. ASN1_TYPE_cmp() compares ASN.1 types B<a> and B<b> and returns 0 if they are identical and non-zero otherwise. ASN1_TYPE_unpack_sequence() attempts to parse the SEQUENCE present in B<t> using the ASN.1 structure B<it>. If successful it returns a pointer to the ASN.1 structure corresponding to B<it> which must be freed by the caller. If it fails it return NULL. ASN1_TYPE_pack_sequence() attempts to encode the ASN.1 structure B<s> corresponding to B<it> into an ASN1_TYPE. If successful the encoded ASN1_TYPE is returned. If B<t> and B<*t> are not NULL the encoded type is written to B<t> overwriting any existing data. If B<t> is not NULL but B<*t> is NULL the returned ASN1_TYPE is written to B<*t>. =head1 NOTES The type and meaning of the B<value> parameter for ASN1_TYPE_set() and Loading Loading @@ -67,4 +82,10 @@ ASN1_TYPE_set1() returns 1 for sucess and 0 for failure. ASN1_TYPE_cmp() returns 0 if the types are identical and non-zero otherwise. ASN1_TYPE_unpack_sequence() returns a pointer to an ASN.1 structure or NULL on failure. ASN1_TYPE_pack_sequence() return an ASN1_TYPE structure if it succeeds or NULL on failure. =cut util/libeay.num +2 Changes for util/libeay.num: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -4553,3 +4553,5 @@ OCSP_resp_get0_signature 4911 EXIST::FUNCTION: OBJ_length 4912 EXIST::FUNCTION: OBJ_get0_data 4913 EXIST::FUNCTION: X509_NAME_ENTRY_set 4914 EXIST::FUNCTION: ASN1_TYPE_pack_sequence 4915 EXIST::FUNCTION: ASN1_TYPE_unpack_sequence 4916 EXIST::FUNCTION: Loading
crypto/asn1/a_type.c +31 Changes for crypto/asn1/a_type.c: 31 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -152,3 +152,34 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b) return result; } ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t) { ASN1_OCTET_STRING *oct; ASN1_TYPE *rt; oct = ASN1_item_pack(s, it, NULL); if (oct == NULL) return NULL; if (t && *t) { rt = *t; } else { rt = ASN1_TYPE_new(); if (rt == NULL) { ASN1_OCTET_STRING_free(oct); return NULL; } if (t) *t = rt; } ASN1_TYPE_set(rt, V_ASN1_SEQUENCE, oct); return rt; } void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t) { if (t->type != V_ASN1_SEQUENCE || t->value.sequence == NULL) return NULL; return ASN1_item_unpack(t->value.sequence, it); }
crypto/asn1/asn1.h +3 Changes for crypto/asn1/asn1.h: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -592,6 +592,9 @@ void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t); void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t); ASN1_OBJECT *ASN1_OBJECT_new(void); void ASN1_OBJECT_free(ASN1_OBJECT *a); int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp); Loading
doc/crypto/ASN1_TYPE_get.pod +22 −1 Changes for doc/crypto/ASN1_TYPE_get.pod: 22 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ =head1 NAME ASN1_TYPE_get, ASN1_TYPE_set, ASN1_TYPE_set1, ASN1_TYPE_cmp - ASN1_TYPE utility ASN1_TYPE_get, ASN1_TYPE_set, ASN1_TYPE_set1, ASN1_TYPE_cmp, ASN1_TYPE_unpack_sequence, ASN1_TYPE_pack_sequence - ASN1_TYPE utility functions =head1 SYNOPSIS Loading @@ -14,6 +14,10 @@ functions int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t); ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t); =head1 DESCRIPTION These functions allow an ASN1_TYPE structure to be manipulated. The Loading @@ -31,6 +35,17 @@ ASN1_TYPE_set1() sets the value of B<a> to B<type> a copy of B<value>. ASN1_TYPE_cmp() compares ASN.1 types B<a> and B<b> and returns 0 if they are identical and non-zero otherwise. ASN1_TYPE_unpack_sequence() attempts to parse the SEQUENCE present in B<t> using the ASN.1 structure B<it>. If successful it returns a pointer to the ASN.1 structure corresponding to B<it> which must be freed by the caller. If it fails it return NULL. ASN1_TYPE_pack_sequence() attempts to encode the ASN.1 structure B<s> corresponding to B<it> into an ASN1_TYPE. If successful the encoded ASN1_TYPE is returned. If B<t> and B<*t> are not NULL the encoded type is written to B<t> overwriting any existing data. If B<t> is not NULL but B<*t> is NULL the returned ASN1_TYPE is written to B<*t>. =head1 NOTES The type and meaning of the B<value> parameter for ASN1_TYPE_set() and Loading Loading @@ -67,4 +82,10 @@ ASN1_TYPE_set1() returns 1 for sucess and 0 for failure. ASN1_TYPE_cmp() returns 0 if the types are identical and non-zero otherwise. ASN1_TYPE_unpack_sequence() returns a pointer to an ASN.1 structure or NULL on failure. ASN1_TYPE_pack_sequence() return an ASN1_TYPE structure if it succeeds or NULL on failure. =cut
util/libeay.num +2 Changes for util/libeay.num: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -4553,3 +4553,5 @@ OCSP_resp_get0_signature 4911 EXIST::FUNCTION: OBJ_length 4912 EXIST::FUNCTION: OBJ_get0_data 4913 EXIST::FUNCTION: X509_NAME_ENTRY_set 4914 EXIST::FUNCTION: ASN1_TYPE_pack_sequence 4915 EXIST::FUNCTION: ASN1_TYPE_unpack_sequence 4916 EXIST::FUNCTION: