summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2021-12-16 12:26:40 +0000
committerschwarze <>2021-12-16 12:26:40 +0000
commit47b76397d6e0cea4b34482a213fd69be75baf6ad (patch)
tree0e6c1e378271e207057491d361d53a988064738e
parent4f80dfe9175818c95601080a13eaa12f62cbe806 (diff)
downloadopenbsd-47b76397d6e0cea4b34482a213fd69be75baf6ad.tar.gz
openbsd-47b76397d6e0cea4b34482a213fd69be75baf6ad.tar.bz2
openbsd-47b76397d6e0cea4b34482a213fd69be75baf6ad.zip
To ease maintenance, structure the lists of intentionally undocumented
symbols according to the reason (internal, obsolete, postponed) and according to the header file (asn1, objects, x509, ...). Also, add some minor tweaks needed for <openssl/objects.h>.
-rwxr-xr-xsrc/regress/lib/libcrypto/man/check_complete.pl164
1 files changed, 109 insertions, 55 deletions
diff --git a/src/regress/lib/libcrypto/man/check_complete.pl b/src/regress/lib/libcrypto/man/check_complete.pl
index ffd1159894..3e53a15443 100755
--- a/src/regress/lib/libcrypto/man/check_complete.pl
+++ b/src/regress/lib/libcrypto/man/check_complete.pl
@@ -17,55 +17,77 @@
17use strict; 17use strict;
18use warnings; 18use warnings;
19 19
20my @obsolete = qw( 20my %internal = (
21 ASN1_const_CTX ASN1_CTX 21 asn1 => [qw(
22 ASN1_dup ASN1_d2i_bio ASN1_d2i_bio_of ASN1_d2i_fp ASN1_d2i_fp_of 22 ASN1_ENCODING
23 ASN1_ENCODING 23 ASN1_OBJECT_FLAG_CRITICAL ASN1_OBJECT_FLAG_DYNAMIC
24 ASN1_i2d_bio ASN1_i2d_bio_of ASN1_i2d_bio_of_const 24 ASN1_OBJECT_FLAG_DYNAMIC_DATA ASN1_OBJECT_FLAG_DYNAMIC_STRINGS
25 ASN1_i2d_fp ASN1_i2d_fp_of ASN1_i2d_fp_of_const 25 ASN1_STRING_FLAG_BITS_LEFT ASN1_STRING_FLAG_CONT
26 ASN1_LONG_UNDEF 26 ASN1_STRING_FLAG_MSTRING ASN1_STRING_FLAG_NDEF
27 ASN1_OBJECT_FLAG_CRITICAL ASN1_OBJECT_FLAG_DYNAMIC 27 CHARTYPE_FIRST_ESC_2253 CHARTYPE_LAST_ESC_2253 CHARTYPE_PRINTABLESTRING
28 ASN1_OBJECT_FLAG_DYNAMIC_DATA ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 28 )],
29 ASN1_STRING_FLAG_BITS_LEFT ASN1_STRING_FLAG_CONT 29 objects => [qw(
30 ASN1_STRING_FLAG_MSTRING ASN1_STRING_FLAG_NDEF 30 OBJ_bsearch OBJ_bsearch_ OBJ_bsearch_ex OBJ_bsearch_ex_
31 CHARTYPE_FIRST_ESC_2253 CHARTYPE_LAST_ESC_2253 CHARTYPE_PRINTABLESTRING 31 )],
32 d2i_NETSCAPE_X509 32 x509_vfy => [qw(
33 NETSCAPE_X509 NETSCAPE_X509_free NETSCAPE_X509_new 33 X509_VERIFY_PARAM_ID
34 i2d_NETSCAPE_X509 34 )]
35 ub_title
36 V_ASN1_PRIMATIVE_TAG
37 X509_algor_st
38 X509_EX_V_INIT X509_EX_V_NETSCAPE_HACK
39 X509_EXT_PACK_STRING X509_EXT_PACK_UNKNOWN
40 X509_VERIFY_PARAM_ID
41); 35);
42 36
43# postponed 37my %obsolete = (
44push @obsolete, qw( 38 asn1 => [qw(
45 ASN1_ITEM_EXP ASN1_ITEM_ptr ASN1_ITEM_ref ASN1_ITEM_rptr 39 ASN1_const_CTX ASN1_CTX
46 ASN1_TEMPLATE ASN1_TLC 40 ASN1_dup ASN1_d2i_bio ASN1_d2i_bio_of ASN1_d2i_fp ASN1_d2i_fp_of
47 CHECKED_D2I_OF CHECKED_I2D_OF CHECKED_NEW_OF CHECKED_PPTR_OF CHECKED_PTR_OF 41 ASN1_i2d_bio ASN1_i2d_bio_of ASN1_i2d_bio_of_const
48 DECLARE_ASN1_ALLOC_FUNCTIONS DECLARE_ASN1_ALLOC_FUNCTIONS_name 42 ASN1_i2d_fp ASN1_i2d_fp_of ASN1_i2d_fp_of_const
49 DECLARE_ASN1_ENCODE_FUNCTIONS DECLARE_ASN1_ENCODE_FUNCTIONS_const 43 ASN1_LONG_UNDEF
50 DECLARE_ASN1_FUNCTIONS DECLARE_ASN1_FUNCTIONS_const 44 d2i_NETSCAPE_X509 i2d_NETSCAPE_X509
51 DECLARE_ASN1_FUNCTIONS_fname DECLARE_ASN1_FUNCTIONS_name 45 NETSCAPE_X509 NETSCAPE_X509_free NETSCAPE_X509_new
52 DECLARE_ASN1_ITEM 46 ub_title
53 DECLARE_ASN1_NDEF_FUNCTION 47 V_ASN1_PRIMATIVE_TAG
54 DECLARE_ASN1_PRINT_FUNCTION DECLARE_ASN1_PRINT_FUNCTION_fname 48 X509_algor_st
55 DECLARE_ASN1_SET_OF 49 )],
56 D2I_OF 50 objects => [qw(
57 d2i_PBEPARAM d2i_PBE2PARAM d2i_PBKDF2PARAM 51 _DECLARE_OBJ_BSEARCH_CMP_FN
58 IMPLEMENT_ASN1_SET_OF 52 DECLARE_OBJ_BSEARCH_CMP_FN DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN
59 I2D_OF I2D_OF_const 53 IMPLEMENT_OBJ_BSEARCH_CMP_FN IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN
60 i2d_PBEPARAM i2d_PBE2PARAM i2d_PBKDF2PARAM 54 )],
61 NETSCAPE_SPKAC NETSCAPE_SPKI 55 x509 => [qw(
62 PBEPARAM PBEPARAM_free PBEPARAM_new 56 X509_EX_V_INIT X509_EX_V_NETSCAPE_HACK
63 PBE2PARAM PBE2PARAM_free PBE2PARAM_new 57 X509_EXT_PACK_STRING X509_EXT_PACK_UNKNOWN
64 PBKDF2PARAM PBKDF2PARAM_free PBKDF2PARAM_new 58 )]
65 PKCS5_pbe_set PKCS5_pbe_set0_algor 59);
66 PKCS5_pbe2_set PKCS5_pbe2_set_iv 60
67 PKCS5_pbkdf2_set 61my %postponed = (
68 TYPEDEF_D2I_OF TYPEDEF_D2I2D_OF TYPEDEF_I2D_OF 62 asn1 => [qw(
63 ASN1_ITEM_EXP ASN1_ITEM_ptr ASN1_ITEM_ref ASN1_ITEM_rptr
64 ASN1_TEMPLATE ASN1_TLC
65 CHECKED_D2I_OF CHECKED_I2D_OF CHECKED_NEW_OF
66 CHECKED_PPTR_OF CHECKED_PTR_OF
67 DECLARE_ASN1_ALLOC_FUNCTIONS DECLARE_ASN1_ALLOC_FUNCTIONS_name
68 DECLARE_ASN1_ENCODE_FUNCTIONS DECLARE_ASN1_ENCODE_FUNCTIONS_const
69 DECLARE_ASN1_FUNCTIONS DECLARE_ASN1_FUNCTIONS_const
70 DECLARE_ASN1_FUNCTIONS_fname DECLARE_ASN1_FUNCTIONS_name
71 DECLARE_ASN1_ITEM
72 DECLARE_ASN1_NDEF_FUNCTION
73 DECLARE_ASN1_PRINT_FUNCTION DECLARE_ASN1_PRINT_FUNCTION_fname
74 DECLARE_ASN1_SET_OF
75 D2I_OF
76 IMPLEMENT_ASN1_SET_OF
77 I2D_OF I2D_OF_const
78 TYPEDEF_D2I_OF TYPEDEF_D2I2D_OF TYPEDEF_I2D_OF
79 )],
80 x509 => [qw(
81 d2i_PBEPARAM d2i_PBE2PARAM d2i_PBKDF2PARAM
82 i2d_PBEPARAM i2d_PBE2PARAM i2d_PBKDF2PARAM
83 NETSCAPE_SPKAC NETSCAPE_SPKI
84 PBEPARAM PBEPARAM_free PBEPARAM_new
85 PBE2PARAM PBE2PARAM_free PBE2PARAM_new
86 PBKDF2PARAM PBKDF2PARAM_free PBKDF2PARAM_new
87 PKCS5_pbe_set PKCS5_pbe_set0_algor
88 PKCS5_pbe2_set PKCS5_pbe2_set_iv
89 PKCS5_pbkdf2_set
90 )]
69); 91);
70 92
71my $MANW = 'man -M /usr/share/man -w'; 93my $MANW = 'man -M /usr/share/man -w';
@@ -78,6 +100,7 @@ my $in_define = 0;
78my $in_function = 0; 100my $in_function = 0;
79my $in_struct = 0; 101my $in_struct = 0;
80my $in_typedef_struct = 0; 102my $in_typedef_struct = 0;
103my %undoc = ();
81my $verbose = 0; 104my $verbose = 0;
82 105
83if (defined $ARGV[0] && $ARGV[0] eq '-v') { 106if (defined $ARGV[0] && $ARGV[0] eq '-v') {
@@ -88,6 +111,10 @@ $#ARGV == 0 or die "usage: $0 [-v] headername";
88$hfile .= "/$ARGV[0].h"; 111$hfile .= "/$ARGV[0].h";
89open my $in_fh, '<', $hfile or die "$hfile: $!"; 112open my $in_fh, '<', $hfile or die "$hfile: $!";
90 113
114$undoc{$_} = 1 foreach @{$internal{$ARGV[0]}};
115$undoc{$_} = 1 foreach @{$obsolete{$ARGV[0]}};
116$undoc{$_} = 1 foreach @{$postponed{$ARGV[0]}};
117
91while (<$in_fh>) { 118while (<$in_fh>) {
92try_again: 119try_again:
93 chomp; 120 chomp;
@@ -143,8 +170,9 @@ try_again:
143 print "Vt $line\n" if $verbose; 170 print "Vt $line\n" if $verbose;
144 next; 171 next;
145 } 172 }
146 if (grep { $_ eq $id } @obsolete) { 173 if ($undoc{$id}) {
147 print "V- $line\n" if $verbose; 174 print "V- $line\n" if $verbose;
175 delete $undoc{$id};
148 next; 176 next;
149 } 177 }
150 if ($verbose) { 178 if ($verbose) {
@@ -186,7 +214,9 @@ try_again:
186 /^DECLARE_STACK_OF\(\w+\)$/ || 214 /^DECLARE_STACK_OF\(\w+\)$/ ||
187 /^TYPEDEF_D2I2D_OF\(\w+\);$/ || 215 /^TYPEDEF_D2I2D_OF\(\w+\);$/ ||
188 /^#define HEADER_\w+_H$/ || 216 /^#define HEADER_\w+_H$/ ||
217 /^#define USE_OBJ_MAC$/ ||
189 /^#endif$/ || 218 /^#endif$/ ||
219 /^#else$/ ||
190 /^extern\s+const\s+ASN1_ITEM\s+\w+_it;$/ || 220 /^extern\s+const\s+ASN1_ITEM\s+\w+_it;$/ ||
191 /^#include\s/ || 221 /^#include\s/ ||
192 /^#ifn?def\s/ || 222 /^#ifn?def\s/ ||
@@ -233,10 +263,15 @@ try_again:
233 print "D- $line\n" if $verbose; 263 print "D- $line\n" if $verbose;
234 next; 264 next;
235 } 265 }
236 if (grep { $_ eq $id } @obsolete) { 266 if ($id =~ /^(?:SN|LN|NID|OBJ)_\w+$/) {
237 print "D- $line\n" if $verbose; 267 print "D- $line\n" if $verbose;
238 next; 268 next;
239 } 269 }
270 if ($undoc{$id}) {
271 print "D- $line\n" if $verbose;
272 delete $undoc{$id};
273 next;
274 }
240 if ($verbose) { 275 if ($verbose) {
241 print "XX $line\n"; 276 print "XX $line\n";
242 } else { 277 } else {
@@ -250,13 +285,14 @@ try_again:
250 print "Fn $line\n" if $verbose; 285 print "Fn $line\n" if $verbose;
251 next; 286 next;
252 } 287 }
253 unless (system qw/grep -qR/, '^\.\\\\" .*\<' . $id . '(3)', 288 unless (system qw/grep -qR/, '^\.\\\\" .*\<' . $id . '\>',
254 "$srcdir/") { 289 "$srcdir/") {
255 print "F- $line\n" if $verbose; 290 print "F- $line\n" if $verbose;
256 next; 291 next;
257 } 292 }
258 if (grep { $_ eq $id } @obsolete) { 293 if ($undoc{$id}) {
259 print "F- $line\n" if $verbose; 294 print "F- $line\n" if $verbose;
295 delete $undoc{$id};
260 next; 296 next;
261 } 297 }
262 if ($verbose) { 298 if ($verbose) {
@@ -267,6 +303,21 @@ try_again:
267 next; 303 next;
268 } 304 }
269 305
306 # Handle global variables.
307
308 if (my ($id) = /^extern\s+int\s+(\w+);$/) {
309 unless (system "$MANW -k Va=$id > /dev/null 2>&1") {
310 print "Va $line\n" if $verbose;
311 next;
312 }
313 if ($verbose) {
314 print "XX $line\n";
315 } else {
316 warn "not found: extern int $id";
317 }
318 next;
319 }
320
270 # Handle variable type declarations. 321 # Handle variable type declarations.
271 322
272 if (my ($id) = /^struct\s+(\w+);$/) { 323 if (my ($id) = /^struct\s+(\w+);$/) {
@@ -274,8 +325,9 @@ try_again:
274 print "Vt $line\n" if $verbose; 325 print "Vt $line\n" if $verbose;
275 next; 326 next;
276 } 327 }
277 if (grep { $_ eq $id } @obsolete) { 328 if ($undoc{$id}) {
278 print "V- $line\n" if $verbose; 329 print "V- $line\n" if $verbose;
330 delete $undoc{$id};
279 next; 331 next;
280 } 332 }
281 if ($verbose) { 333 if ($verbose) {
@@ -291,8 +343,9 @@ try_again:
291 print "Vt $line\n" if $verbose; 343 print "Vt $line\n" if $verbose;
292 next; 344 next;
293 } 345 }
294 if (grep { $_ eq $id } @obsolete) { 346 if ($undoc{$id}) {
295 print "V- $line\n" if $verbose; 347 print "V- $line\n" if $verbose;
348 delete $undoc{$id};
296 next; 349 next;
297 } 350 }
298 if ($verbose) { 351 if ($verbose) {
@@ -339,8 +392,9 @@ try_again:
339 print "F- $line\n" if $verbose; 392 print "F- $line\n" if $verbose;
340 next; 393 next;
341 } 394 }
342 if (grep { $_ eq $id } @obsolete) { 395 if ($undoc{$id}) {
343 print "F- $line\n" if $verbose; 396 print "F- $line\n" if $verbose;
397 delete $undoc{$id};
344 next; 398 next;
345 } 399 }
346 if ($id =~ /^ASN1_PCTX_\w+$/) { 400 if ($id =~ /^ASN1_PCTX_\w+$/) {
@@ -360,6 +414,6 @@ try_again:
360 } 414 }
361 die "parse error: $_"; 415 die "parse error: $_";
362} 416}
363
364close $in_fh; 417close $in_fh;
418warn "expected as undocumented but not found: $_" foreach keys %undoc;
365exit 0; 419exit 0;