aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/minitasn1/structure.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/minitasn1/structure.c')
-rw-r--r--src/daemon/https/minitasn1/structure.c94
1 files changed, 0 insertions, 94 deletions
diff --git a/src/daemon/https/minitasn1/structure.c b/src/daemon/https/minitasn1/structure.c
index 7f72661f..e0abe594 100644
--- a/src/daemon/https/minitasn1/structure.c
+++ b/src/daemon/https/minitasn1/structure.c
@@ -267,49 +267,6 @@ MHD__asn1_delete_structure (ASN1_TYPE * structure)
267 return ASN1_SUCCESS; 267 return ASN1_SUCCESS;
268} 268}
269 269
270
271
272/**
273 * MHD__asn1_delete_element - Deletes the element of a structure.
274 * @structure: pointer to the structure that contains the element you
275 * want to delete.
276 * @element_name: element's name you want to delete.
277 *
278 * Deletes the element named *@element_name inside *@structure.
279 *
280 * Returns:
281 *
282 * ASN1_SUCCESS: Everything OK.
283 *
284 * ASN1_ELEMENT_NOT_FOUND: The name element was not found.
285 *
286 **/
287MHD__asn1_retCode
288MHD__asn1_delete_element (ASN1_TYPE structure, const char *element_name)
289{
290 node_asn *p2, *p3, *source_node;
291
292 source_node = MHD__asn1_find_node (structure, element_name);
293
294 if (source_node == ASN1_TYPE_EMPTY)
295 return ASN1_ELEMENT_NOT_FOUND;
296
297 p2 = source_node->right;
298 p3 = MHD__asn1_find_left (source_node);
299 if (!p3)
300 {
301 p3 = MHD__asn1_find_up (source_node);
302 if (p3)
303 MHD__asn1_set_down (p3, p2);
304 else if (source_node->right)
305 source_node->right->left = NULL;
306 }
307 else
308 MHD__asn1_set_right (p3, p2);
309
310 return MHD__asn1_delete_structure (&source_node);
311}
312
313node_asn * 270node_asn *
314MHD__asn1_copy_structure3 (node_asn * source_node) 271MHD__asn1_copy_structure3 (node_asn * source_node)
315{ 272{
@@ -730,54 +687,3 @@ MHD__asn1_find_structure_from_oid (ASN1_TYPE definitions,
730 return NULL; /* ASN1_ELEMENT_NOT_FOUND; */ 687 return NULL; /* ASN1_ELEMENT_NOT_FOUND; */
731} 688}
732 689
733/**
734 * MHD__asn1_copy_node:
735 * @dst: Destination ASN1_TYPE node.
736 * @dst_name: Field name in destination node.
737 * @src: Source ASN1_TYPE node.
738 * @src_name: Field name in source node.
739 *
740 * Create a deep copy of a ASN1_TYPE variable.
741 *
742 * Return value: Return ASN1_SUCCESS on success.
743 **/
744MHD__asn1_retCode
745MHD__asn1_copy_node (ASN1_TYPE dst, const char *dst_name,
746 ASN1_TYPE src, const char *src_name)
747{
748/* FIXME: rewrite using copy_structure().
749 * It seems quite hard to do.
750 */
751 int result;
752 ASN1_TYPE dst_node;
753 void *data = NULL;
754 int size = 0;
755
756 result = MHD__asn1_der_coding (src, src_name, NULL, &size, NULL);
757 if (result != ASN1_MEM_ERROR)
758 return result;
759
760 data = MHD__asn1_malloc (size);
761 if (data == NULL)
762 return ASN1_MEM_ERROR;
763
764 result = MHD__asn1_der_coding (src, src_name, data, &size, NULL);
765 if (result != ASN1_SUCCESS)
766 {
767 MHD__asn1_free (data);
768 return result;
769 }
770
771 dst_node = MHD__asn1_find_node (dst, dst_name);
772 if (dst_node == NULL)
773 {
774 MHD__asn1_free (data);
775 return ASN1_ELEMENT_NOT_FOUND;
776 }
777
778 result = MHD__asn1_der_decoding (&dst_node, data, size, NULL);
779
780 MHD__asn1_free (data);
781
782 return result;
783}