Rename obj_mac.h to nid.h and make it a multiply-includable header.
obj_mac.h is missing #include guards, so one cannot use NIDs without pulling in the OBJ_* functions which depend on the giant OID table. Give it #include guards, tidy up the style slightly, and also rename it to nid.h which is a much more reasonable name. obj_mac.h is kept as a forwarding header as, despite it being a little screwy, some code #includes it anyway. BUG=chromium:499653 Change-Id: Iec0b3f186c02e208ff1f7437bf27ee3a5ad004b7 Reviewed-on: https://boringssl-review.googlesource.com/7562 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
parent
66ec5c9066
commit
5d38f78e29
@ -1,17 +1,17 @@
|
|||||||
OID information is generated via a series of perl scripts. In order, the full
|
OID information is generated via a series of perl scripts. In order, the full
|
||||||
list of commands to run are:
|
list of commands to run are:
|
||||||
|
|
||||||
perl objects.pl objects.txt obj_mac.num ../../include/openssl/obj_mac.h
|
perl objects.pl objects.txt obj_mac.num ../../include/openssl/nid.h
|
||||||
perl obj_dat.pl ../../include/openssl/obj_mac.h obj_dat.h
|
perl obj_dat.pl ../../include/openssl/nid.h obj_dat.h
|
||||||
perl obj_xref.pl obj_mac.num obj_xref.txt > obj_xref.h
|
perl obj_xref.pl obj_mac.num obj_xref.txt > obj_xref.h
|
||||||
|
|
||||||
objects.txt contains the list of all built-in OIDs. It is processed by
|
objects.txt contains the list of all built-in OIDs. It is processed by
|
||||||
objects.pl to output obj_mac.num and obj_mac.h. obj_mac.num is the list of NID
|
objects.pl to output obj_mac.num and nid.h. obj_mac.num is the list of NID
|
||||||
values for each OID. This is an input/output parameter so NID values are stable
|
values for each OID. This is an input/output parameter so NID values are stable
|
||||||
across regenerations. obj_mac.h is the header which defines macros for all the
|
across regenerations. nid.h is the header which defines macros for all the
|
||||||
built-in OIDs in C.
|
built-in OIDs in C.
|
||||||
|
|
||||||
obj_mac.h is read by obj_dat.pl to generate obj_dat.h. obj_dat.h contains the
|
nid.h is read by obj_dat.pl to generate obj_dat.h. obj_dat.h contains the
|
||||||
ASN1_OBJECTs corresponding to built-in OIDs themselves along with lookup tables
|
ASN1_OBJECTs corresponding to built-in OIDs themselves along with lookup tables
|
||||||
for search by short name, OID, etc.
|
for search by short name, OID, etc.
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ Dependency graph:
|
|||||||
[objects.pl] <--+
|
[objects.pl] <--+
|
||||||
/ \ |
|
/ \ |
|
||||||
V V |
|
V V |
|
||||||
obj_mac.h obj_mac.num obj_xref.txt
|
nid.h obj_mac.num obj_xref.txt
|
||||||
| \ /
|
| \ /
|
||||||
V V V
|
V V V
|
||||||
[obj_dat.pl] [obj_xref.pl]
|
[obj_dat.pl] [obj_xref.pl]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
|
/* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
|
||||||
* following command:
|
* following command:
|
||||||
* perl obj_dat.pl ../../include/openssl/obj_mac.h obj_dat.h */
|
* perl obj_dat.pl ../../include/openssl/nid.h obj_dat.h */
|
||||||
|
|
||||||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
|
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
@ -6,7 +6,7 @@ use integer;
|
|||||||
|
|
||||||
if (scalar @ARGV != 2)
|
if (scalar @ARGV != 2)
|
||||||
{
|
{
|
||||||
print "Usage: perl obj_dat.pl ../../include/openssl/obj_mac.h obj_dat.h\n";
|
print "Usage: perl obj_dat.pl ../../include/openssl/nid.h obj_dat.h\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ foreach (sort obj_cmp @a)
|
|||||||
print OUT <<'EOF';
|
print OUT <<'EOF';
|
||||||
/* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
|
/* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
|
||||||
* following command:
|
* following command:
|
||||||
* perl obj_dat.pl ../../include/openssl/obj_mac.h obj_dat.h */
|
* perl obj_dat.pl ../../include/openssl/nid.h obj_dat.h */
|
||||||
|
|
||||||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
|
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
if (scalar @ARGV != 3)
|
if (scalar @ARGV != 3)
|
||||||
{
|
{
|
||||||
print "Usage: perl objects.pl objects.txt obj_mac.num ../../include/openssl/obj_mac.h\n";
|
print "Usage: perl objects.pl objects.txt obj_mac.num ../../include/openssl/nid.h\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ open (OUT,">$ARGV[2]") || die "Can't open output file $ARGV[2]";
|
|||||||
print OUT <<'EOF';
|
print OUT <<'EOF';
|
||||||
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
|
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
|
||||||
* following command:
|
* following command:
|
||||||
* perl objects.pl objects.txt obj_mac.num ../../include/openssl/obj_mac.h */
|
* perl objects.pl objects.txt obj_mac.num ../../include/openssl/nid.h */
|
||||||
|
|
||||||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
|
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@ -186,6 +186,24 @@ print OUT <<'EOF';
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef OPENSSL_HEADER_NID_H
|
||||||
|
#define OPENSSL_HEADER_NID_H
|
||||||
|
|
||||||
|
|
||||||
|
/* The nid library provides numbered values for ASN.1 object identifiers and
|
||||||
|
* other symbols. These values are used by other libraries to identify
|
||||||
|
* cryptographic primitives.
|
||||||
|
*
|
||||||
|
* A separate objects library, obj.h, provides functions for converting between
|
||||||
|
* nids and object identifiers. However it depends on large internal tables with
|
||||||
|
* the encodings of every nid defind. Consumers concerned with binary size
|
||||||
|
* should instead embed the encodings of the few consumed OIDs and compare
|
||||||
|
* against those.
|
||||||
|
*
|
||||||
|
* These values should not be used outside of a single process; they are not
|
||||||
|
* stable identifiers. */
|
||||||
|
|
||||||
|
|
||||||
#define SN_undef "UNDEF"
|
#define SN_undef "UNDEF"
|
||||||
#define LN_undef "undefined"
|
#define LN_undef "undefined"
|
||||||
#define NID_undef 0
|
#define NID_undef 0
|
||||||
@ -196,13 +214,15 @@ EOF
|
|||||||
foreach (sort { $a <=> $b } keys %ordern)
|
foreach (sort { $a <=> $b } keys %ordern)
|
||||||
{
|
{
|
||||||
$Cname=$ordern{$_};
|
$Cname=$ordern{$_};
|
||||||
print OUT "#define SN_",$Cname,"\t\t\"",$sn{$Cname},"\"\n" if $sn{$Cname} ne "";
|
print OUT "#define SN_",$Cname," \"",$sn{$Cname},"\"\n" if $sn{$Cname} ne "";
|
||||||
print OUT "#define LN_",$Cname,"\t\t\"",$ln{$Cname},"\"\n" if $ln{$Cname} ne "";
|
print OUT "#define LN_",$Cname," \"",$ln{$Cname},"\"\n" if $ln{$Cname} ne "";
|
||||||
print OUT "#define NID_",$Cname,"\t\t",$nid{$Cname},"\n" if $nid{$Cname} ne "";
|
print OUT "#define NID_",$Cname," ",$nid{$Cname},"\n" if $nid{$Cname} ne "";
|
||||||
print OUT "#define OBJ_",$Cname,"\t\t",$obj{$Cname},"\n" if $obj{$Cname} ne "";
|
print OUT "#define OBJ_",$Cname," ",$obj{$Cname},"\n" if $obj{$Cname} ne "";
|
||||||
print OUT "\n";
|
print OUT "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print OUT "\n#endif /* OPENSSL_HEADER_NID_H */\n";
|
||||||
|
|
||||||
close OUT;
|
close OUT;
|
||||||
|
|
||||||
sub process_oid
|
sub process_oid
|
||||||
|
4163
include/openssl/nid.h
Normal file
4163
include/openssl/nid.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -60,7 +60,7 @@
|
|||||||
#include <openssl/base.h>
|
#include <openssl/base.h>
|
||||||
|
|
||||||
#include <openssl/bytestring.h>
|
#include <openssl/bytestring.h>
|
||||||
#include <openssl/obj_mac.h>
|
#include <openssl/nid.h>
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user