@@ -2694,6 +2694,82 @@ int botan_x509_cert_verify(int* validation_result,
26942694*/
26952695BOTAN_FFI_EXPORT (2 , 8 ) const char * botan_x509_cert_validation_status (int code );
26962696
2697+ /*
2698+ * X.509 Extensions
2699+ */
2700+
2701+ /**
2702+ * Get info about the IP Address Blocks extension
2703+ * @param v4_count is set to the number of v4 families contained in the extension
2704+ * @param v6_count is set to the number of v6 families
2705+ * @returns 0 on success, negative number on error
2706+ */
2707+ BOTAN_FFI_EXPORT (3 , 13 )
2708+ int botan_x509_ext_ip_addr_blocks_get_counts (botan_x509_cert_t cert , size_t * v4_count , size_t * v6_count );
2709+
2710+ /**
2711+ * Get info about a specific family in the extension
2712+ * @param v4_count must be set to the number of v4 families contained in the cert, obtained from `botan_x509_ext_ip_addr_blocks_get_counts`
2713+ * @param ipv6 must be set to 1 if the family is an IPv6 family, 0 for IPv4 families
2714+ * @param i is the (local) index for this family kind (the first v4 family is at i = 0, ipv6 = 0; the first v6 family is at i = 0, ipv6 = 1)
2715+ * @param has_safi will be set to 1 if the family has an associated SAFI
2716+ * @param safi will be set to the families' SAFI, if it has one
2717+ * @param present is set to 1 if the family contains values (ranges), 0 if it is marked as "inherit"
2718+ * @param count is set to the number of values (ranges), if they were present
2719+ * @returns 0 on success, negative number on error
2720+ */
2721+ BOTAN_FFI_EXPORT (3 , 13 )
2722+ int botan_x509_ext_ip_addr_blocks_get_family (botan_x509_cert_t cert ,
2723+ size_t v4_count ,
2724+ int ipv6 ,
2725+ size_t i ,
2726+ int * has_safi ,
2727+ uint8_t * safi ,
2728+ int * present ,
2729+ size_t * count );
2730+
2731+ /**
2732+ * Get info about a specific range in the extension
2733+ * @param v4_count must be set to the number of v4 families present
2734+ * @param ipv6 must be set to 1 if the family is an IPv6 family, 0 for IPv4 families
2735+ * @param i is the (local) index of the family, see `botan_x509_ext_ip_addr_blocks_get_family`
2736+ * @param entry is the index of the range
2737+ * @param min_out is set to the lower address of the range
2738+ * @param max_out is set to the upper address of the range
2739+ * @param out_len is set to the length of the addresses (4 for IPv4, 16 for IPv6)
2740+ * @returns 0 on success, negative number on error
2741+ */
2742+ BOTAN_FFI_EXPORT (3 , 13 )
2743+ int botan_x509_ext_ip_addr_blocks_get_address (botan_x509_cert_t cert ,
2744+ size_t v4_count ,
2745+ int ipv6 ,
2746+ size_t i ,
2747+ size_t entry ,
2748+ uint8_t min_out [],
2749+ uint8_t max_out [],
2750+ size_t * out_len );
2751+
2752+ /**
2753+ * Get basic info about the AS Blocks extension
2754+ * @param asnum must be set to 1 to get info about AS numbers, 0 for RDIs (the type)
2755+ * @param present is set to 1 if the extension contains entries for the type, 0 if it is marked as "inherit"
2756+ * @param count is set to number of entries for this type, if it was present
2757+ * @returns 0 on success, negative number on error
2758+ */
2759+ BOTAN_FFI_EXPORT (3 , 13 )
2760+ int botan_x509_ext_as_blocks_get_info (botan_x509_cert_t cert , int asnum , int * present , size_t * count );
2761+
2762+ /**
2763+ * Get a specific entry from the extension
2764+ * @param asnum Set to 1 to get info about AS numbers, 0 for RDIs (the type)
2765+ * @param i The index of the entry to get
2766+ * @param min is set to the min value of the range
2767+ * @param max is set to the max value of the range
2768+ * @returns 0 on success, negative number on error
2769+ */
2770+ BOTAN_FFI_EXPORT (3 , 13 )
2771+ int botan_x509_ext_as_blocks_get_entry_at (botan_x509_cert_t cert , int asnum , size_t i , uint32_t * min , uint32_t * max );
2772+
26972773/*
26982774* X.509 CRL
26992775**************************/
0 commit comments