aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/objects
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/crypto/objects')
-rw-r--r--openssl/crypto/objects/Makefile2
-rw-r--r--openssl/crypto/objects/o_names.c2
-rw-r--r--openssl/crypto/objects/obj_dat.c7
-rw-r--r--openssl/crypto/objects/objects.README8
-rw-r--r--openssl/crypto/objects/objects.pl2
5 files changed, 14 insertions, 7 deletions
diff --git a/openssl/crypto/objects/Makefile b/openssl/crypto/objects/Makefile
index a8aedbd42..f93d2f9d2 100644
--- a/openssl/crypto/objects/Makefile
+++ b/openssl/crypto/objects/Makefile
@@ -74,6 +74,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: obj_dat.h obj_mac.h obj_xref.h depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/openssl/crypto/objects/o_names.c b/openssl/crypto/objects/o_names.c
index c6774f457..24859926a 100644
--- a/openssl/crypto/objects/o_names.c
+++ b/openssl/crypto/objects/o_names.c
@@ -313,7 +313,7 @@ void OBJ_NAME_do_all_sorted(int type,
d.names =
OPENSSL_malloc(lh_OBJ_NAME_num_items(names_lh) * sizeof *d.names);
/* Really should return an error if !d.names...but its a void function! */
- if(d.names) {
+ if (d.names) {
d.n = 0;
OBJ_NAME_do_all(type, do_all_sorted_fn, &d);
diff --git a/openssl/crypto/objects/obj_dat.c b/openssl/crypto/objects/obj_dat.c
index e42a1c147..aca382a6e 100644
--- a/openssl/crypto/objects/obj_dat.c
+++ b/openssl/crypto/objects/obj_dat.c
@@ -142,7 +142,7 @@ static unsigned long added_obj_hash(const ADDED_OBJ *ca)
return 0;
}
ret &= 0x3fffffffL;
- ret |= ca->type << 30L;
+ ret |= ((unsigned long)ca->type) << 30L;
return (ret);
}
@@ -400,6 +400,8 @@ static int obj_cmp(const ASN1_OBJECT *const *ap, const unsigned int *bp)
j = (a->length - b->length);
if (j)
return (j);
+ if (a->length == 0)
+ return 0;
return (memcmp(a->data, b->data, a->length));
}
@@ -415,6 +417,9 @@ int OBJ_obj2nid(const ASN1_OBJECT *a)
if (a->nid != 0)
return (a->nid);
+ if (a->length == 0)
+ return NID_undef;
+
if (added != NULL) {
ad.type = ADDED_DATA;
ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
diff --git a/openssl/crypto/objects/objects.README b/openssl/crypto/objects/objects.README
index 4d745508d..cb1d216ce 100644
--- a/openssl/crypto/objects/objects.README
+++ b/openssl/crypto/objects/objects.README
@@ -8,9 +8,9 @@ The basic syntax for adding an object is as follows:
1 2 3 4 : shortName : Long Name
- If the long name doesn't contain spaces, or no short name
- exists, the long name is used as basis for the base name
- in C. Otherwise, the short name is used.
+ If Long Name contains only word characters and hyphen-minus
+ (0x2D) or full stop (0x2E) then Long Name is used as basis
+ for the base name in C. Otherwise, the shortName is used.
The base name (let's call it 'base') will then be used to
create the C macros SN_base, LN_base, NID_base and OBJ_base.
@@ -22,7 +22,7 @@ Then there are some extra commands:
!Alias foo 1 2 3 4
- This juts makes a name foo for an OID. The C macro
+ This just makes a name foo for an OID. The C macro
OBJ_foo will be created as a result.
!Cname foo
diff --git a/openssl/crypto/objects/objects.pl b/openssl/crypto/objects/objects.pl
index d0ed459d3..389dc3483 100644
--- a/openssl/crypto/objects/objects.pl
+++ b/openssl/crypto/objects/objects.pl
@@ -67,7 +67,7 @@ while (<IN>)
$myoid = &process_oid($myoid);
}
- if ($Cname eq "" && !($myln =~ / /))
+ if ($Cname eq "" && ($myln =~ /^[_A-Za-z][\w.-]*$/ ))
{
$Cname = $myln;
$Cname =~ s/\./_/g;