Initial Commit
This commit is contained in:
132
openssl-1.0.2f/crypto/objects/Makefile
Normal file
132
openssl-1.0.2f/crypto/objects/Makefile
Normal file
@@ -0,0 +1,132 @@
|
||||
#
|
||||
# OpenSSL/crypto/objects/Makefile
|
||||
#
|
||||
|
||||
DIR= objects
|
||||
TOP= ../..
|
||||
CC= cc
|
||||
INCLUDES= -I.. -I$(TOP) -I../../include
|
||||
CFLAG=-g
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
PERL= perl
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
|
||||
GENERAL=Makefile README
|
||||
TEST=
|
||||
APPS=
|
||||
|
||||
LIB=$(TOP)/libcrypto.a
|
||||
LIBSRC= o_names.c obj_dat.c obj_lib.c obj_err.c obj_xref.c
|
||||
LIBOBJ= o_names.o obj_dat.o obj_lib.o obj_err.o obj_xref.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
EXHEADER= objects.h obj_mac.h
|
||||
HEADER= $(EXHEADER) obj_dat.h obj_xref.h
|
||||
|
||||
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||
|
||||
top:
|
||||
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
|
||||
|
||||
all: obj_dat.h obj_xref.h lib
|
||||
|
||||
lib: $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
@touch lib
|
||||
|
||||
obj_dat.h: obj_dat.pl obj_mac.h
|
||||
$(PERL) obj_dat.pl obj_mac.h obj_dat.h
|
||||
|
||||
# objects.pl both reads and writes obj_mac.num
|
||||
obj_mac.h: objects.pl objects.txt obj_mac.num
|
||||
$(PERL) objects.pl objects.txt obj_mac.num obj_mac.h
|
||||
@sleep 1; touch obj_mac.h; sleep 1
|
||||
|
||||
obj_xref.h: objxref.pl obj_xref.txt obj_mac.num
|
||||
$(PERL) objxref.pl obj_mac.num obj_xref.txt > obj_xref.h
|
||||
@sleep 1; touch obj_xref.h; sleep 1
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
|
||||
install:
|
||||
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
|
||||
@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
|
||||
do \
|
||||
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
||||
done;
|
||||
|
||||
tags:
|
||||
ctags $(SRC)
|
||||
|
||||
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)
|
||||
|
||||
dclean:
|
||||
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
o_names.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
o_names.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
o_names.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
o_names.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
o_names.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
o_names.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
|
||||
o_names.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
o_names.o: o_names.c
|
||||
obj_dat.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
obj_dat.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
|
||||
obj_dat.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
obj_dat.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
obj_dat.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
obj_dat.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
obj_dat.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
obj_dat.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
obj_dat.o: ../../include/openssl/symhacks.h ../cryptlib.h obj_dat.c obj_dat.h
|
||||
obj_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
obj_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
obj_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
obj_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
obj_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
obj_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
|
||||
obj_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
obj_err.o: obj_err.c
|
||||
obj_lib.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
obj_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
obj_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
obj_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
obj_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
obj_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
obj_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
|
||||
obj_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
obj_lib.o: ../cryptlib.h obj_lib.c
|
||||
obj_xref.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
obj_xref.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
obj_xref.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
obj_xref.o: ../../include/openssl/opensslconf.h
|
||||
obj_xref.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
obj_xref.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
obj_xref.o: ../../include/openssl/symhacks.h obj_xref.c obj_xref.h
|
||||
0
openssl-1.0.2f/crypto/objects/lib
Normal file
0
openssl-1.0.2f/crypto/objects/lib
Normal file
366
openssl-1.0.2f/crypto/objects/o_names.c
Normal file
366
openssl-1.0.2f/crypto/objects/o_names.c
Normal file
@@ -0,0 +1,366 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/safestack.h>
|
||||
#include <openssl/e_os2.h>
|
||||
|
||||
/*
|
||||
* Later versions of DEC C has started to add lnkage information to certain
|
||||
* functions, which makes it tricky to use them as values to regular function
|
||||
* pointers. One way is to define a macro that takes care of casting them
|
||||
* correctly.
|
||||
*/
|
||||
#ifdef OPENSSL_SYS_VMS_DECC
|
||||
# define OPENSSL_strcmp (int (*)(const char *,const char *))strcmp
|
||||
#else
|
||||
# define OPENSSL_strcmp strcmp
|
||||
#endif
|
||||
|
||||
/*
|
||||
* I use the ex_data stuff to manage the identifiers for the obj_name_types
|
||||
* that applications may define. I only really use the free function field.
|
||||
*/
|
||||
DECLARE_LHASH_OF(OBJ_NAME);
|
||||
static LHASH_OF(OBJ_NAME) *names_lh = NULL;
|
||||
static int names_type_num = OBJ_NAME_TYPE_NUM;
|
||||
|
||||
typedef struct name_funcs_st {
|
||||
unsigned long (*hash_func) (const char *name);
|
||||
int (*cmp_func) (const char *a, const char *b);
|
||||
void (*free_func) (const char *, int, const char *);
|
||||
} NAME_FUNCS;
|
||||
|
||||
DECLARE_STACK_OF(NAME_FUNCS)
|
||||
IMPLEMENT_STACK_OF(NAME_FUNCS)
|
||||
|
||||
static STACK_OF(NAME_FUNCS) *name_funcs_stack;
|
||||
|
||||
/*
|
||||
* The LHASH callbacks now use the raw "void *" prototypes and do
|
||||
* per-variable casting in the functions. This prevents function pointer
|
||||
* casting without the need for macro-generated wrapper functions.
|
||||
*/
|
||||
|
||||
/* static unsigned long obj_name_hash(OBJ_NAME *a); */
|
||||
static unsigned long obj_name_hash(const void *a_void);
|
||||
/* static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b); */
|
||||
static int obj_name_cmp(const void *a_void, const void *b_void);
|
||||
|
||||
static IMPLEMENT_LHASH_HASH_FN(obj_name, OBJ_NAME)
|
||||
static IMPLEMENT_LHASH_COMP_FN(obj_name, OBJ_NAME)
|
||||
|
||||
int OBJ_NAME_init(void)
|
||||
{
|
||||
if (names_lh != NULL)
|
||||
return (1);
|
||||
MemCheck_off();
|
||||
names_lh = lh_OBJ_NAME_new();
|
||||
MemCheck_on();
|
||||
return (names_lh != NULL);
|
||||
}
|
||||
|
||||
int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
|
||||
int (*cmp_func) (const char *, const char *),
|
||||
void (*free_func) (const char *, int, const char *))
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
NAME_FUNCS *name_funcs;
|
||||
|
||||
if (name_funcs_stack == NULL) {
|
||||
MemCheck_off();
|
||||
name_funcs_stack = sk_NAME_FUNCS_new_null();
|
||||
MemCheck_on();
|
||||
}
|
||||
if (name_funcs_stack == NULL) {
|
||||
/* ERROR */
|
||||
return (0);
|
||||
}
|
||||
ret = names_type_num;
|
||||
names_type_num++;
|
||||
for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
|
||||
MemCheck_off();
|
||||
name_funcs = OPENSSL_malloc(sizeof(NAME_FUNCS));
|
||||
MemCheck_on();
|
||||
if (!name_funcs) {
|
||||
OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
|
||||
return (0);
|
||||
}
|
||||
name_funcs->hash_func = lh_strhash;
|
||||
name_funcs->cmp_func = OPENSSL_strcmp;
|
||||
name_funcs->free_func = 0; /* NULL is often declared to * ((void
|
||||
* *)0), which according * to Compaq C is
|
||||
* not really * compatible with a function
|
||||
* * pointer. -- Richard Levitte */
|
||||
MemCheck_off();
|
||||
sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
|
||||
MemCheck_on();
|
||||
}
|
||||
name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
|
||||
if (hash_func != NULL)
|
||||
name_funcs->hash_func = hash_func;
|
||||
if (cmp_func != NULL)
|
||||
name_funcs->cmp_func = cmp_func;
|
||||
if (free_func != NULL)
|
||||
name_funcs->free_func = free_func;
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/* static int obj_name_cmp(OBJ_NAME *a, OBJ_NAME *b) */
|
||||
static int obj_name_cmp(const void *a_void, const void *b_void)
|
||||
{
|
||||
int ret;
|
||||
const OBJ_NAME *a = (const OBJ_NAME *)a_void;
|
||||
const OBJ_NAME *b = (const OBJ_NAME *)b_void;
|
||||
|
||||
ret = a->type - b->type;
|
||||
if (ret == 0) {
|
||||
if ((name_funcs_stack != NULL)
|
||||
&& (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
|
||||
ret = sk_NAME_FUNCS_value(name_funcs_stack,
|
||||
a->type)->cmp_func(a->name, b->name);
|
||||
} else
|
||||
ret = strcmp(a->name, b->name);
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/* static unsigned long obj_name_hash(OBJ_NAME *a) */
|
||||
static unsigned long obj_name_hash(const void *a_void)
|
||||
{
|
||||
unsigned long ret;
|
||||
const OBJ_NAME *a = (const OBJ_NAME *)a_void;
|
||||
|
||||
if ((name_funcs_stack != NULL)
|
||||
&& (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
|
||||
ret =
|
||||
sk_NAME_FUNCS_value(name_funcs_stack,
|
||||
a->type)->hash_func(a->name);
|
||||
} else {
|
||||
ret = lh_strhash(a->name);
|
||||
}
|
||||
ret ^= a->type;
|
||||
return (ret);
|
||||
}
|
||||
|
||||
const char *OBJ_NAME_get(const char *name, int type)
|
||||
{
|
||||
OBJ_NAME on, *ret;
|
||||
int num = 0, alias;
|
||||
|
||||
if (name == NULL)
|
||||
return (NULL);
|
||||
if ((names_lh == NULL) && !OBJ_NAME_init())
|
||||
return (NULL);
|
||||
|
||||
alias = type & OBJ_NAME_ALIAS;
|
||||
type &= ~OBJ_NAME_ALIAS;
|
||||
|
||||
on.name = name;
|
||||
on.type = type;
|
||||
|
||||
for (;;) {
|
||||
ret = lh_OBJ_NAME_retrieve(names_lh, &on);
|
||||
if (ret == NULL)
|
||||
return (NULL);
|
||||
if ((ret->alias) && !alias) {
|
||||
if (++num > 10)
|
||||
return (NULL);
|
||||
on.name = ret->data;
|
||||
} else {
|
||||
return (ret->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int OBJ_NAME_add(const char *name, int type, const char *data)
|
||||
{
|
||||
OBJ_NAME *onp, *ret;
|
||||
int alias;
|
||||
|
||||
if ((names_lh == NULL) && !OBJ_NAME_init())
|
||||
return (0);
|
||||
|
||||
alias = type & OBJ_NAME_ALIAS;
|
||||
type &= ~OBJ_NAME_ALIAS;
|
||||
|
||||
onp = (OBJ_NAME *)OPENSSL_malloc(sizeof(OBJ_NAME));
|
||||
if (onp == NULL) {
|
||||
/* ERROR */
|
||||
return (0);
|
||||
}
|
||||
|
||||
onp->name = name;
|
||||
onp->alias = alias;
|
||||
onp->type = type;
|
||||
onp->data = data;
|
||||
|
||||
ret = lh_OBJ_NAME_insert(names_lh, onp);
|
||||
if (ret != NULL) {
|
||||
/* free things */
|
||||
if ((name_funcs_stack != NULL)
|
||||
&& (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
|
||||
/*
|
||||
* XXX: I'm not sure I understand why the free function should
|
||||
* get three arguments... -- Richard Levitte
|
||||
*/
|
||||
sk_NAME_FUNCS_value(name_funcs_stack,
|
||||
ret->type)->free_func(ret->name, ret->type,
|
||||
ret->data);
|
||||
}
|
||||
OPENSSL_free(ret);
|
||||
} else {
|
||||
if (lh_OBJ_NAME_error(names_lh)) {
|
||||
/* ERROR */
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
int OBJ_NAME_remove(const char *name, int type)
|
||||
{
|
||||
OBJ_NAME on, *ret;
|
||||
|
||||
if (names_lh == NULL)
|
||||
return (0);
|
||||
|
||||
type &= ~OBJ_NAME_ALIAS;
|
||||
on.name = name;
|
||||
on.type = type;
|
||||
ret = lh_OBJ_NAME_delete(names_lh, &on);
|
||||
if (ret != NULL) {
|
||||
/* free things */
|
||||
if ((name_funcs_stack != NULL)
|
||||
&& (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
|
||||
/*
|
||||
* XXX: I'm not sure I understand why the free function should
|
||||
* get three arguments... -- Richard Levitte
|
||||
*/
|
||||
sk_NAME_FUNCS_value(name_funcs_stack,
|
||||
ret->type)->free_func(ret->name, ret->type,
|
||||
ret->data);
|
||||
}
|
||||
OPENSSL_free(ret);
|
||||
return (1);
|
||||
} else
|
||||
return (0);
|
||||
}
|
||||
|
||||
struct doall {
|
||||
int type;
|
||||
void (*fn) (const OBJ_NAME *, void *arg);
|
||||
void *arg;
|
||||
};
|
||||
|
||||
static void do_all_fn_doall_arg(const OBJ_NAME *name, struct doall *d)
|
||||
{
|
||||
if (name->type == d->type)
|
||||
d->fn(name, d->arg);
|
||||
}
|
||||
|
||||
static IMPLEMENT_LHASH_DOALL_ARG_FN(do_all_fn, const OBJ_NAME, struct doall)
|
||||
|
||||
void OBJ_NAME_do_all(int type, void (*fn) (const OBJ_NAME *, void *arg),
|
||||
void *arg)
|
||||
{
|
||||
struct doall d;
|
||||
|
||||
d.type = type;
|
||||
d.fn = fn;
|
||||
d.arg = arg;
|
||||
|
||||
lh_OBJ_NAME_doall_arg(names_lh, LHASH_DOALL_ARG_FN(do_all_fn),
|
||||
struct doall, &d);
|
||||
}
|
||||
|
||||
struct doall_sorted {
|
||||
int type;
|
||||
int n;
|
||||
const OBJ_NAME **names;
|
||||
};
|
||||
|
||||
static void do_all_sorted_fn(const OBJ_NAME *name, void *d_)
|
||||
{
|
||||
struct doall_sorted *d = d_;
|
||||
|
||||
if (name->type != d->type)
|
||||
return;
|
||||
|
||||
d->names[d->n++] = name;
|
||||
}
|
||||
|
||||
static int do_all_sorted_cmp(const void *n1_, const void *n2_)
|
||||
{
|
||||
const OBJ_NAME *const *n1 = n1_;
|
||||
const OBJ_NAME *const *n2 = n2_;
|
||||
|
||||
return strcmp((*n1)->name, (*n2)->name);
|
||||
}
|
||||
|
||||
void OBJ_NAME_do_all_sorted(int type,
|
||||
void (*fn) (const OBJ_NAME *, void *arg),
|
||||
void *arg)
|
||||
{
|
||||
struct doall_sorted d;
|
||||
int n;
|
||||
|
||||
d.type = 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) {
|
||||
d.n = 0;
|
||||
OBJ_NAME_do_all(type, do_all_sorted_fn, &d);
|
||||
|
||||
qsort((void *)d.names, d.n, sizeof *d.names, do_all_sorted_cmp);
|
||||
|
||||
for (n = 0; n < d.n; ++n)
|
||||
fn(d.names[n], arg);
|
||||
|
||||
OPENSSL_free((void *)d.names);
|
||||
}
|
||||
}
|
||||
|
||||
static int free_type;
|
||||
|
||||
static void names_lh_free_doall(OBJ_NAME *onp)
|
||||
{
|
||||
if (onp == NULL)
|
||||
return;
|
||||
|
||||
if (free_type < 0 || free_type == onp->type)
|
||||
OBJ_NAME_remove(onp->name, onp->type);
|
||||
}
|
||||
|
||||
static IMPLEMENT_LHASH_DOALL_FN(names_lh_free, OBJ_NAME)
|
||||
|
||||
static void name_funcs_free(NAME_FUNCS *ptr)
|
||||
{
|
||||
OPENSSL_free(ptr);
|
||||
}
|
||||
|
||||
void OBJ_NAME_cleanup(int type)
|
||||
{
|
||||
unsigned long down_load;
|
||||
|
||||
if (names_lh == NULL)
|
||||
return;
|
||||
|
||||
free_type = type;
|
||||
down_load = lh_OBJ_NAME_down_load(names_lh);
|
||||
lh_OBJ_NAME_down_load(names_lh) = 0;
|
||||
|
||||
lh_OBJ_NAME_doall(names_lh, LHASH_DOALL_FN(names_lh_free));
|
||||
if (type < 0) {
|
||||
lh_OBJ_NAME_free(names_lh);
|
||||
sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
|
||||
names_lh = NULL;
|
||||
name_funcs_stack = NULL;
|
||||
} else
|
||||
lh_OBJ_NAME_down_load(names_lh) = down_load;
|
||||
}
|
||||
BIN
openssl-1.0.2f/crypto/objects/o_names.o
Normal file
BIN
openssl-1.0.2f/crypto/objects/o_names.o
Normal file
Binary file not shown.
801
openssl-1.0.2f/crypto/objects/obj_dat.c
Normal file
801
openssl-1.0.2f/crypto/objects/obj_dat.c
Normal file
@@ -0,0 +1,801 @@
|
||||
/* crypto/objects/obj_dat.c */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
/* obj_dat.h is generated from objects.h by obj_dat.pl */
|
||||
#ifndef OPENSSL_NO_OBJECT
|
||||
# include "obj_dat.h"
|
||||
#else
|
||||
/* You will have to load all the objects needed manually in the application */
|
||||
# define NUM_NID 0
|
||||
# define NUM_SN 0
|
||||
# define NUM_LN 0
|
||||
# define NUM_OBJ 0
|
||||
static const unsigned char lvalues[1];
|
||||
static const ASN1_OBJECT nid_objs[1];
|
||||
static const unsigned int sn_objs[1];
|
||||
static const unsigned int ln_objs[1];
|
||||
static const unsigned int obj_objs[1];
|
||||
#endif
|
||||
|
||||
DECLARE_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, sn);
|
||||
DECLARE_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, ln);
|
||||
DECLARE_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, obj);
|
||||
|
||||
#define ADDED_DATA 0
|
||||
#define ADDED_SNAME 1
|
||||
#define ADDED_LNAME 2
|
||||
#define ADDED_NID 3
|
||||
|
||||
typedef struct added_obj_st {
|
||||
int type;
|
||||
ASN1_OBJECT *obj;
|
||||
} ADDED_OBJ;
|
||||
DECLARE_LHASH_OF(ADDED_OBJ);
|
||||
|
||||
static int new_nid = NUM_NID;
|
||||
static LHASH_OF(ADDED_OBJ) *added = NULL;
|
||||
|
||||
static int sn_cmp(const ASN1_OBJECT *const *a, const unsigned int *b)
|
||||
{
|
||||
return (strcmp((*a)->sn, nid_objs[*b].sn));
|
||||
}
|
||||
|
||||
IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, sn);
|
||||
|
||||
static int ln_cmp(const ASN1_OBJECT *const *a, const unsigned int *b)
|
||||
{
|
||||
return (strcmp((*a)->ln, nid_objs[*b].ln));
|
||||
}
|
||||
|
||||
IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, ln);
|
||||
|
||||
static unsigned long added_obj_hash(const ADDED_OBJ *ca)
|
||||
{
|
||||
const ASN1_OBJECT *a;
|
||||
int i;
|
||||
unsigned long ret = 0;
|
||||
unsigned char *p;
|
||||
|
||||
a = ca->obj;
|
||||
switch (ca->type) {
|
||||
case ADDED_DATA:
|
||||
ret = a->length << 20L;
|
||||
p = (unsigned char *)a->data;
|
||||
for (i = 0; i < a->length; i++)
|
||||
ret ^= p[i] << ((i * 3) % 24);
|
||||
break;
|
||||
case ADDED_SNAME:
|
||||
ret = lh_strhash(a->sn);
|
||||
break;
|
||||
case ADDED_LNAME:
|
||||
ret = lh_strhash(a->ln);
|
||||
break;
|
||||
case ADDED_NID:
|
||||
ret = a->nid;
|
||||
break;
|
||||
default:
|
||||
/* abort(); */
|
||||
return 0;
|
||||
}
|
||||
ret &= 0x3fffffffL;
|
||||
ret |= ((unsigned long)ca->type) << 30L;
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static IMPLEMENT_LHASH_HASH_FN(added_obj, ADDED_OBJ)
|
||||
|
||||
static int added_obj_cmp(const ADDED_OBJ *ca, const ADDED_OBJ *cb)
|
||||
{
|
||||
ASN1_OBJECT *a, *b;
|
||||
int i;
|
||||
|
||||
i = ca->type - cb->type;
|
||||
if (i)
|
||||
return (i);
|
||||
a = ca->obj;
|
||||
b = cb->obj;
|
||||
switch (ca->type) {
|
||||
case ADDED_DATA:
|
||||
i = (a->length - b->length);
|
||||
if (i)
|
||||
return (i);
|
||||
return (memcmp(a->data, b->data, (size_t)a->length));
|
||||
case ADDED_SNAME:
|
||||
if (a->sn == NULL)
|
||||
return (-1);
|
||||
else if (b->sn == NULL)
|
||||
return (1);
|
||||
else
|
||||
return (strcmp(a->sn, b->sn));
|
||||
case ADDED_LNAME:
|
||||
if (a->ln == NULL)
|
||||
return (-1);
|
||||
else if (b->ln == NULL)
|
||||
return (1);
|
||||
else
|
||||
return (strcmp(a->ln, b->ln));
|
||||
case ADDED_NID:
|
||||
return (a->nid - b->nid);
|
||||
default:
|
||||
/* abort(); */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static IMPLEMENT_LHASH_COMP_FN(added_obj, ADDED_OBJ)
|
||||
|
||||
static int init_added(void)
|
||||
{
|
||||
if (added != NULL)
|
||||
return (1);
|
||||
added = lh_ADDED_OBJ_new();
|
||||
return (added != NULL);
|
||||
}
|
||||
|
||||
static void cleanup1_doall(ADDED_OBJ *a)
|
||||
{
|
||||
a->obj->nid = 0;
|
||||
a->obj->flags |= ASN1_OBJECT_FLAG_DYNAMIC |
|
||||
ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | ASN1_OBJECT_FLAG_DYNAMIC_DATA;
|
||||
}
|
||||
|
||||
static void cleanup2_doall(ADDED_OBJ *a)
|
||||
{
|
||||
a->obj->nid++;
|
||||
}
|
||||
|
||||
static void cleanup3_doall(ADDED_OBJ *a)
|
||||
{
|
||||
if (--a->obj->nid == 0)
|
||||
ASN1_OBJECT_free(a->obj);
|
||||
OPENSSL_free(a);
|
||||
}
|
||||
|
||||
static IMPLEMENT_LHASH_DOALL_FN(cleanup1, ADDED_OBJ)
|
||||
static IMPLEMENT_LHASH_DOALL_FN(cleanup2, ADDED_OBJ)
|
||||
static IMPLEMENT_LHASH_DOALL_FN(cleanup3, ADDED_OBJ)
|
||||
|
||||
/*
|
||||
* The purpose of obj_cleanup_defer is to avoid EVP_cleanup() attempting to
|
||||
* use freed up OIDs. If neccessary the actual freeing up of OIDs is delayed.
|
||||
*/
|
||||
int obj_cleanup_defer = 0;
|
||||
|
||||
void check_defer(int nid)
|
||||
{
|
||||
if (!obj_cleanup_defer && nid >= NUM_NID)
|
||||
obj_cleanup_defer = 1;
|
||||
}
|
||||
|
||||
void OBJ_cleanup(void)
|
||||
{
|
||||
if (obj_cleanup_defer) {
|
||||
obj_cleanup_defer = 2;
|
||||
return;
|
||||
}
|
||||
if (added == NULL)
|
||||
return;
|
||||
lh_ADDED_OBJ_down_load(added) = 0;
|
||||
lh_ADDED_OBJ_doall(added, LHASH_DOALL_FN(cleanup1)); /* zero counters */
|
||||
lh_ADDED_OBJ_doall(added, LHASH_DOALL_FN(cleanup2)); /* set counters */
|
||||
lh_ADDED_OBJ_doall(added, LHASH_DOALL_FN(cleanup3)); /* free objects */
|
||||
lh_ADDED_OBJ_free(added);
|
||||
added = NULL;
|
||||
}
|
||||
|
||||
int OBJ_new_nid(int num)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = new_nid;
|
||||
new_nid += num;
|
||||
return (i);
|
||||
}
|
||||
|
||||
int OBJ_add_object(const ASN1_OBJECT *obj)
|
||||
{
|
||||
ASN1_OBJECT *o;
|
||||
ADDED_OBJ *ao[4] = { NULL, NULL, NULL, NULL }, *aop;
|
||||
int i;
|
||||
|
||||
if (added == NULL)
|
||||
if (!init_added())
|
||||
return (0);
|
||||
if ((o = OBJ_dup(obj)) == NULL)
|
||||
goto err;
|
||||
if (!(ao[ADDED_NID] = (ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ))))
|
||||
goto err2;
|
||||
if ((o->length != 0) && (obj->data != NULL))
|
||||
if (!
|
||||
(ao[ADDED_DATA] = (ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ))))
|
||||
goto err2;
|
||||
if (o->sn != NULL)
|
||||
if (!
|
||||
(ao[ADDED_SNAME] =
|
||||
(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ))))
|
||||
goto err2;
|
||||
if (o->ln != NULL)
|
||||
if (!
|
||||
(ao[ADDED_LNAME] =
|
||||
(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ))))
|
||||
goto err2;
|
||||
|
||||
for (i = ADDED_DATA; i <= ADDED_NID; i++) {
|
||||
if (ao[i] != NULL) {
|
||||
ao[i]->type = i;
|
||||
ao[i]->obj = o;
|
||||
aop = lh_ADDED_OBJ_insert(added, ao[i]);
|
||||
/* memory leak, buit should not normally matter */
|
||||
if (aop != NULL)
|
||||
OPENSSL_free(aop);
|
||||
}
|
||||
}
|
||||
o->flags &=
|
||||
~(ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
|
||||
ASN1_OBJECT_FLAG_DYNAMIC_DATA);
|
||||
|
||||
return (o->nid);
|
||||
err2:
|
||||
OBJerr(OBJ_F_OBJ_ADD_OBJECT, ERR_R_MALLOC_FAILURE);
|
||||
err:
|
||||
for (i = ADDED_DATA; i <= ADDED_NID; i++)
|
||||
if (ao[i] != NULL)
|
||||
OPENSSL_free(ao[i]);
|
||||
if (o != NULL)
|
||||
OPENSSL_free(o);
|
||||
return (NID_undef);
|
||||
}
|
||||
|
||||
ASN1_OBJECT *OBJ_nid2obj(int n)
|
||||
{
|
||||
ADDED_OBJ ad, *adp;
|
||||
ASN1_OBJECT ob;
|
||||
|
||||
if ((n >= 0) && (n < NUM_NID)) {
|
||||
if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
|
||||
OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);
|
||||
return (NULL);
|
||||
}
|
||||
return ((ASN1_OBJECT *)&(nid_objs[n]));
|
||||
} else if (added == NULL)
|
||||
return (NULL);
|
||||
else {
|
||||
ad.type = ADDED_NID;
|
||||
ad.obj = &ob;
|
||||
ob.nid = n;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return (adp->obj);
|
||||
else {
|
||||
OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const char *OBJ_nid2sn(int n)
|
||||
{
|
||||
ADDED_OBJ ad, *adp;
|
||||
ASN1_OBJECT ob;
|
||||
|
||||
if ((n >= 0) && (n < NUM_NID)) {
|
||||
if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
|
||||
OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
|
||||
return (NULL);
|
||||
}
|
||||
return (nid_objs[n].sn);
|
||||
} else if (added == NULL)
|
||||
return (NULL);
|
||||
else {
|
||||
ad.type = ADDED_NID;
|
||||
ad.obj = &ob;
|
||||
ob.nid = n;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return (adp->obj->sn);
|
||||
else {
|
||||
OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const char *OBJ_nid2ln(int n)
|
||||
{
|
||||
ADDED_OBJ ad, *adp;
|
||||
ASN1_OBJECT ob;
|
||||
|
||||
if ((n >= 0) && (n < NUM_NID)) {
|
||||
if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
|
||||
OBJerr(OBJ_F_OBJ_NID2LN, OBJ_R_UNKNOWN_NID);
|
||||
return (NULL);
|
||||
}
|
||||
return (nid_objs[n].ln);
|
||||
} else if (added == NULL)
|
||||
return (NULL);
|
||||
else {
|
||||
ad.type = ADDED_NID;
|
||||
ad.obj = &ob;
|
||||
ob.nid = n;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return (adp->obj->ln);
|
||||
else {
|
||||
OBJerr(OBJ_F_OBJ_NID2LN, OBJ_R_UNKNOWN_NID);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int obj_cmp(const ASN1_OBJECT *const *ap, const unsigned int *bp)
|
||||
{
|
||||
int j;
|
||||
const ASN1_OBJECT *a = *ap;
|
||||
const ASN1_OBJECT *b = &nid_objs[*bp];
|
||||
|
||||
j = (a->length - b->length);
|
||||
if (j)
|
||||
return (j);
|
||||
if (a->length == 0)
|
||||
return 0;
|
||||
return (memcmp(a->data, b->data, a->length));
|
||||
}
|
||||
|
||||
IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, obj);
|
||||
|
||||
int OBJ_obj2nid(const ASN1_OBJECT *a)
|
||||
{
|
||||
const unsigned int *op;
|
||||
ADDED_OBJ ad, *adp;
|
||||
|
||||
if (a == NULL)
|
||||
return (NID_undef);
|
||||
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 */
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return (adp->obj->nid);
|
||||
}
|
||||
op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
|
||||
if (op == NULL)
|
||||
return (NID_undef);
|
||||
return (nid_objs[*op].nid);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an object name into an ASN1_OBJECT if "noname" is not set then
|
||||
* search for short and long names first. This will convert the "dotted" form
|
||||
* into an object: unlike OBJ_txt2nid it can be used with any objects, not
|
||||
* just registered ones.
|
||||
*/
|
||||
|
||||
ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
|
||||
{
|
||||
int nid = NID_undef;
|
||||
ASN1_OBJECT *op = NULL;
|
||||
unsigned char *buf;
|
||||
unsigned char *p;
|
||||
const unsigned char *cp;
|
||||
int i, j;
|
||||
|
||||
if (!no_name) {
|
||||
if (((nid = OBJ_sn2nid(s)) != NID_undef) ||
|
||||
((nid = OBJ_ln2nid(s)) != NID_undef))
|
||||
return OBJ_nid2obj(nid);
|
||||
}
|
||||
|
||||
/* Work out size of content octets */
|
||||
i = a2d_ASN1_OBJECT(NULL, 0, s, -1);
|
||||
if (i <= 0) {
|
||||
/* Don't clear the error */
|
||||
/*
|
||||
* ERR_clear_error();
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
/* Work out total size */
|
||||
j = ASN1_object_size(0, i, V_ASN1_OBJECT);
|
||||
|
||||
if ((buf = (unsigned char *)OPENSSL_malloc(j)) == NULL)
|
||||
return NULL;
|
||||
|
||||
p = buf;
|
||||
/* Write out tag+length */
|
||||
ASN1_put_object(&p, 0, i, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
|
||||
/* Write out contents */
|
||||
a2d_ASN1_OBJECT(p, i, s, -1);
|
||||
|
||||
cp = buf;
|
||||
op = d2i_ASN1_OBJECT(NULL, &cp, j);
|
||||
OPENSSL_free(buf);
|
||||
return op;
|
||||
}
|
||||
|
||||
int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
|
||||
{
|
||||
int i, n = 0, len, nid, first, use_bn;
|
||||
BIGNUM *bl;
|
||||
unsigned long l;
|
||||
const unsigned char *p;
|
||||
char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
|
||||
|
||||
/* Ensure that, at every state, |buf| is NUL-terminated. */
|
||||
if (buf && buf_len > 0)
|
||||
buf[0] = '\0';
|
||||
|
||||
if ((a == NULL) || (a->data == NULL))
|
||||
return (0);
|
||||
|
||||
if (!no_name && (nid = OBJ_obj2nid(a)) != NID_undef) {
|
||||
const char *s;
|
||||
s = OBJ_nid2ln(nid);
|
||||
if (s == NULL)
|
||||
s = OBJ_nid2sn(nid);
|
||||
if (s) {
|
||||
if (buf)
|
||||
BUF_strlcpy(buf, s, buf_len);
|
||||
n = strlen(s);
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
len = a->length;
|
||||
p = a->data;
|
||||
|
||||
first = 1;
|
||||
bl = NULL;
|
||||
|
||||
while (len > 0) {
|
||||
l = 0;
|
||||
use_bn = 0;
|
||||
for (;;) {
|
||||
unsigned char c = *p++;
|
||||
len--;
|
||||
if ((len == 0) && (c & 0x80))
|
||||
goto err;
|
||||
if (use_bn) {
|
||||
if (!BN_add_word(bl, c & 0x7f))
|
||||
goto err;
|
||||
} else
|
||||
l |= c & 0x7f;
|
||||
if (!(c & 0x80))
|
||||
break;
|
||||
if (!use_bn && (l > (ULONG_MAX >> 7L))) {
|
||||
if (!bl && !(bl = BN_new()))
|
||||
goto err;
|
||||
if (!BN_set_word(bl, l))
|
||||
goto err;
|
||||
use_bn = 1;
|
||||
}
|
||||
if (use_bn) {
|
||||
if (!BN_lshift(bl, bl, 7))
|
||||
goto err;
|
||||
} else
|
||||
l <<= 7L;
|
||||
}
|
||||
|
||||
if (first) {
|
||||
first = 0;
|
||||
if (l >= 80) {
|
||||
i = 2;
|
||||
if (use_bn) {
|
||||
if (!BN_sub_word(bl, 80))
|
||||
goto err;
|
||||
} else
|
||||
l -= 80;
|
||||
} else {
|
||||
i = (int)(l / 40);
|
||||
l -= (long)(i * 40);
|
||||
}
|
||||
if (buf && (buf_len > 1)) {
|
||||
*buf++ = i + '0';
|
||||
*buf = '\0';
|
||||
buf_len--;
|
||||
}
|
||||
n++;
|
||||
}
|
||||
|
||||
if (use_bn) {
|
||||
char *bndec;
|
||||
bndec = BN_bn2dec(bl);
|
||||
if (!bndec)
|
||||
goto err;
|
||||
i = strlen(bndec);
|
||||
if (buf) {
|
||||
if (buf_len > 1) {
|
||||
*buf++ = '.';
|
||||
*buf = '\0';
|
||||
buf_len--;
|
||||
}
|
||||
BUF_strlcpy(buf, bndec, buf_len);
|
||||
if (i > buf_len) {
|
||||
buf += buf_len;
|
||||
buf_len = 0;
|
||||
} else {
|
||||
buf += i;
|
||||
buf_len -= i;
|
||||
}
|
||||
}
|
||||
n++;
|
||||
n += i;
|
||||
OPENSSL_free(bndec);
|
||||
} else {
|
||||
BIO_snprintf(tbuf, sizeof tbuf, ".%lu", l);
|
||||
i = strlen(tbuf);
|
||||
if (buf && (buf_len > 0)) {
|
||||
BUF_strlcpy(buf, tbuf, buf_len);
|
||||
if (i > buf_len) {
|
||||
buf += buf_len;
|
||||
buf_len = 0;
|
||||
} else {
|
||||
buf += i;
|
||||
buf_len -= i;
|
||||
}
|
||||
}
|
||||
n += i;
|
||||
l = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (bl)
|
||||
BN_free(bl);
|
||||
return n;
|
||||
|
||||
err:
|
||||
if (bl)
|
||||
BN_free(bl);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int OBJ_txt2nid(const char *s)
|
||||
{
|
||||
ASN1_OBJECT *obj;
|
||||
int nid;
|
||||
obj = OBJ_txt2obj(s, 0);
|
||||
nid = OBJ_obj2nid(obj);
|
||||
ASN1_OBJECT_free(obj);
|
||||
return nid;
|
||||
}
|
||||
|
||||
int OBJ_ln2nid(const char *s)
|
||||
{
|
||||
ASN1_OBJECT o;
|
||||
const ASN1_OBJECT *oo = &o;
|
||||
ADDED_OBJ ad, *adp;
|
||||
const unsigned int *op;
|
||||
|
||||
o.ln = s;
|
||||
if (added != NULL) {
|
||||
ad.type = ADDED_LNAME;
|
||||
ad.obj = &o;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return (adp->obj->nid);
|
||||
}
|
||||
op = OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
|
||||
if (op == NULL)
|
||||
return (NID_undef);
|
||||
return (nid_objs[*op].nid);
|
||||
}
|
||||
|
||||
int OBJ_sn2nid(const char *s)
|
||||
{
|
||||
ASN1_OBJECT o;
|
||||
const ASN1_OBJECT *oo = &o;
|
||||
ADDED_OBJ ad, *adp;
|
||||
const unsigned int *op;
|
||||
|
||||
o.sn = s;
|
||||
if (added != NULL) {
|
||||
ad.type = ADDED_SNAME;
|
||||
ad.obj = &o;
|
||||
adp = lh_ADDED_OBJ_retrieve(added, &ad);
|
||||
if (adp != NULL)
|
||||
return (adp->obj->nid);
|
||||
}
|
||||
op = OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
|
||||
if (op == NULL)
|
||||
return (NID_undef);
|
||||
return (nid_objs[*op].nid);
|
||||
}
|
||||
|
||||
const void *OBJ_bsearch_(const void *key, const void *base, int num, int size,
|
||||
int (*cmp) (const void *, const void *))
|
||||
{
|
||||
return OBJ_bsearch_ex_(key, base, num, size, cmp, 0);
|
||||
}
|
||||
|
||||
const void *OBJ_bsearch_ex_(const void *key, const void *base_, int num,
|
||||
int size,
|
||||
int (*cmp) (const void *, const void *),
|
||||
int flags)
|
||||
{
|
||||
const char *base = base_;
|
||||
int l, h, i = 0, c = 0;
|
||||
const char *p = NULL;
|
||||
|
||||
if (num == 0)
|
||||
return (NULL);
|
||||
l = 0;
|
||||
h = num;
|
||||
while (l < h) {
|
||||
i = (l + h) / 2;
|
||||
p = &(base[i * size]);
|
||||
c = (*cmp) (key, p);
|
||||
if (c < 0)
|
||||
h = i;
|
||||
else if (c > 0)
|
||||
l = i + 1;
|
||||
else
|
||||
break;
|
||||
}
|
||||
#ifdef CHARSET_EBCDIC
|
||||
/*
|
||||
* THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and I
|
||||
* don't have perl (yet), we revert to a *LINEAR* search when the object
|
||||
* wasn't found in the binary search.
|
||||
*/
|
||||
if (c != 0) {
|
||||
for (i = 0; i < num; ++i) {
|
||||
p = &(base[i * size]);
|
||||
c = (*cmp) (key, p);
|
||||
if (c == 0 || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH)))
|
||||
return p;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (c != 0 && !(flags & OBJ_BSEARCH_VALUE_ON_NOMATCH))
|
||||
p = NULL;
|
||||
else if (c == 0 && (flags & OBJ_BSEARCH_FIRST_VALUE_ON_MATCH)) {
|
||||
while (i > 0 && (*cmp) (key, &(base[(i - 1) * size])) == 0)
|
||||
i--;
|
||||
p = &(base[i * size]);
|
||||
}
|
||||
return (p);
|
||||
}
|
||||
|
||||
int OBJ_create_objects(BIO *in)
|
||||
{
|
||||
MS_STATIC char buf[512];
|
||||
int i, num = 0;
|
||||
char *o, *s, *l = NULL;
|
||||
|
||||
for (;;) {
|
||||
s = o = NULL;
|
||||
i = BIO_gets(in, buf, 512);
|
||||
if (i <= 0)
|
||||
return (num);
|
||||
buf[i - 1] = '\0';
|
||||
if (!isalnum((unsigned char)buf[0]))
|
||||
return (num);
|
||||
o = s = buf;
|
||||
while (isdigit((unsigned char)*s) || (*s == '.'))
|
||||
s++;
|
||||
if (*s != '\0') {
|
||||
*(s++) = '\0';
|
||||
while (isspace((unsigned char)*s))
|
||||
s++;
|
||||
if (*s == '\0')
|
||||
s = NULL;
|
||||
else {
|
||||
l = s;
|
||||
while ((*l != '\0') && !isspace((unsigned char)*l))
|
||||
l++;
|
||||
if (*l != '\0') {
|
||||
*(l++) = '\0';
|
||||
while (isspace((unsigned char)*l))
|
||||
l++;
|
||||
if (*l == '\0')
|
||||
l = NULL;
|
||||
} else
|
||||
l = NULL;
|
||||
}
|
||||
} else
|
||||
s = NULL;
|
||||
if ((o == NULL) || (*o == '\0'))
|
||||
return (num);
|
||||
if (!OBJ_create(o, s, l))
|
||||
return (num);
|
||||
num++;
|
||||
}
|
||||
/* return(num); */
|
||||
}
|
||||
|
||||
int OBJ_create(const char *oid, const char *sn, const char *ln)
|
||||
{
|
||||
int ok = 0;
|
||||
ASN1_OBJECT *op = NULL;
|
||||
unsigned char *buf;
|
||||
int i;
|
||||
|
||||
i = a2d_ASN1_OBJECT(NULL, 0, oid, -1);
|
||||
if (i <= 0)
|
||||
return (0);
|
||||
|
||||
if ((buf = (unsigned char *)OPENSSL_malloc(i)) == NULL) {
|
||||
OBJerr(OBJ_F_OBJ_CREATE, ERR_R_MALLOC_FAILURE);
|
||||
return (0);
|
||||
}
|
||||
i = a2d_ASN1_OBJECT(buf, i, oid, -1);
|
||||
if (i == 0)
|
||||
goto err;
|
||||
op = (ASN1_OBJECT *)ASN1_OBJECT_create(OBJ_new_nid(1), buf, i, sn, ln);
|
||||
if (op == NULL)
|
||||
goto err;
|
||||
ok = OBJ_add_object(op);
|
||||
err:
|
||||
ASN1_OBJECT_free(op);
|
||||
OPENSSL_free(buf);
|
||||
return (ok);
|
||||
}
|
||||
5319
openssl-1.0.2f/crypto/objects/obj_dat.h
Normal file
5319
openssl-1.0.2f/crypto/objects/obj_dat.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
openssl-1.0.2f/crypto/objects/obj_dat.o
Normal file
BIN
openssl-1.0.2f/crypto/objects/obj_dat.o
Normal file
Binary file not shown.
307
openssl-1.0.2f/crypto/objects/obj_dat.pl
Normal file
307
openssl-1.0.2f/crypto/objects/obj_dat.pl
Normal file
@@ -0,0 +1,307 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
# fixes bug in floating point emulation on sparc64 when
|
||||
# this script produces off-by-one output on sparc64
|
||||
use integer;
|
||||
|
||||
sub obj_cmp
|
||||
{
|
||||
local(@a,@b,$_,$r);
|
||||
|
||||
$A=$obj_len{$obj{$nid{$a}}};
|
||||
$B=$obj_len{$obj{$nid{$b}}};
|
||||
|
||||
$r=($A-$B);
|
||||
return($r) if $r != 0;
|
||||
|
||||
$A=$obj_der{$obj{$nid{$a}}};
|
||||
$B=$obj_der{$obj{$nid{$b}}};
|
||||
|
||||
return($A cmp $B);
|
||||
}
|
||||
|
||||
sub expand_obj
|
||||
{
|
||||
local(*v)=@_;
|
||||
local($k,$d);
|
||||
local($i);
|
||||
|
||||
do {
|
||||
$i=0;
|
||||
foreach $k (keys %v)
|
||||
{
|
||||
if (($v{$k} =~ s/(OBJ_[^,]+),/$v{$1},/))
|
||||
{ $i++; }
|
||||
}
|
||||
} while($i);
|
||||
foreach $k (keys %v)
|
||||
{
|
||||
@a=split(/,/,$v{$k});
|
||||
$objn{$k}=$#a+1;
|
||||
}
|
||||
return(%objn);
|
||||
}
|
||||
|
||||
open (IN,"$ARGV[0]") || die "Can't open input file $ARGV[0]";
|
||||
open (OUT,">$ARGV[1]") || die "Can't open output file $ARGV[1]";
|
||||
|
||||
while (<IN>)
|
||||
{
|
||||
next unless /^\#define\s+(\S+)\s+(.*)$/;
|
||||
$v=$1;
|
||||
$d=$2;
|
||||
$d =~ s/^\"//;
|
||||
$d =~ s/\"$//;
|
||||
if ($v =~ /^SN_(.*)$/)
|
||||
{
|
||||
if(defined $snames{$d})
|
||||
{
|
||||
print "WARNING: Duplicate short name \"$d\"\n";
|
||||
}
|
||||
else
|
||||
{ $snames{$d} = "X"; }
|
||||
$sn{$1}=$d;
|
||||
}
|
||||
elsif ($v =~ /^LN_(.*)$/)
|
||||
{
|
||||
if(defined $lnames{$d})
|
||||
{
|
||||
print "WARNING: Duplicate long name \"$d\"\n";
|
||||
}
|
||||
else
|
||||
{ $lnames{$d} = "X"; }
|
||||
$ln{$1}=$d;
|
||||
}
|
||||
elsif ($v =~ /^NID_(.*)$/)
|
||||
{ $nid{$d}=$1; }
|
||||
elsif ($v =~ /^OBJ_(.*)$/)
|
||||
{
|
||||
$obj{$1}=$v;
|
||||
$objd{$v}=$d;
|
||||
}
|
||||
}
|
||||
close IN;
|
||||
|
||||
%ob=&expand_obj(*objd);
|
||||
|
||||
@a=sort { $a <=> $b } keys %nid;
|
||||
$n=$a[$#a]+1;
|
||||
|
||||
@lvalues=();
|
||||
$lvalues=0;
|
||||
|
||||
for ($i=0; $i<$n; $i++)
|
||||
{
|
||||
if (!defined($nid{$i}))
|
||||
{
|
||||
push(@out,"{NULL,NULL,NID_undef,0,NULL,0},\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$sn=defined($sn{$nid{$i}})?"$sn{$nid{$i}}":"NULL";
|
||||
$ln=defined($ln{$nid{$i}})?"$ln{$nid{$i}}":"NULL";
|
||||
|
||||
if ($sn eq "NULL") {
|
||||
$sn=$ln;
|
||||
$sn{$nid{$i}} = $ln;
|
||||
}
|
||||
|
||||
if ($ln eq "NULL") {
|
||||
$ln=$sn;
|
||||
$ln{$nid{$i}} = $sn;
|
||||
}
|
||||
|
||||
$out ="{";
|
||||
$out.="\"$sn\"";
|
||||
$out.=","."\"$ln\"";
|
||||
$out.=",NID_$nid{$i},";
|
||||
if (defined($obj{$nid{$i}}) && $objd{$obj{$nid{$i}}} =~ /,/)
|
||||
{
|
||||
$v=$objd{$obj{$nid{$i}}};
|
||||
$v =~ s/L//g;
|
||||
$v =~ s/,/ /g;
|
||||
$r=&der_it($v);
|
||||
$z="";
|
||||
$length=0;
|
||||
foreach (unpack("C*",$r))
|
||||
{
|
||||
$z.=sprintf("0x%02X,",$_);
|
||||
$length++;
|
||||
}
|
||||
$obj_der{$obj{$nid{$i}}}=$z;
|
||||
$obj_len{$obj{$nid{$i}}}=$length;
|
||||
|
||||
push(@lvalues,sprintf("%-45s/* [%3d] %s */\n",
|
||||
$z,$lvalues,$obj{$nid{$i}}));
|
||||
$out.="$length,&(lvalues[$lvalues]),0";
|
||||
$lvalues+=$length;
|
||||
}
|
||||
else
|
||||
{
|
||||
$out.="0,NULL,0";
|
||||
}
|
||||
$out.="},\n";
|
||||
push(@out,$out);
|
||||
}
|
||||
}
|
||||
|
||||
@a=grep(defined($sn{$nid{$_}}),0 .. $n);
|
||||
foreach (sort { $sn{$nid{$a}} cmp $sn{$nid{$b}} } @a)
|
||||
{
|
||||
push(@sn,sprintf("%2d,\t/* \"$sn{$nid{$_}}\" */\n",$_));
|
||||
}
|
||||
|
||||
@a=grep(defined($ln{$nid{$_}}),0 .. $n);
|
||||
foreach (sort { $ln{$nid{$a}} cmp $ln{$nid{$b}} } @a)
|
||||
{
|
||||
push(@ln,sprintf("%2d,\t/* \"$ln{$nid{$_}}\" */\n",$_));
|
||||
}
|
||||
|
||||
@a=grep(defined($obj{$nid{$_}}),0 .. $n);
|
||||
foreach (sort obj_cmp @a)
|
||||
{
|
||||
$m=$obj{$nid{$_}};
|
||||
$v=$objd{$m};
|
||||
$v =~ s/L//g;
|
||||
$v =~ s/,/ /g;
|
||||
push(@ob,sprintf("%2d,\t/* %-32s %s */\n",$_,$m,$v));
|
||||
}
|
||||
|
||||
print OUT <<'EOF';
|
||||
/* crypto/objects/obj_dat.h */
|
||||
|
||||
/* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
|
||||
* following command:
|
||||
* perl obj_dat.pl obj_mac.h obj_dat.h
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
EOF
|
||||
|
||||
printf OUT "#define NUM_NID %d\n",$n;
|
||||
printf OUT "#define NUM_SN %d\n",$#sn+1;
|
||||
printf OUT "#define NUM_LN %d\n",$#ln+1;
|
||||
printf OUT "#define NUM_OBJ %d\n\n",$#ob+1;
|
||||
|
||||
printf OUT "static const unsigned char lvalues[%d]={\n",$lvalues+1;
|
||||
print OUT @lvalues;
|
||||
print OUT "};\n\n";
|
||||
|
||||
printf OUT "static const ASN1_OBJECT nid_objs[NUM_NID]={\n";
|
||||
foreach (@out)
|
||||
{
|
||||
if (length($_) > 75)
|
||||
{
|
||||
$out="";
|
||||
foreach (split(/,/))
|
||||
{
|
||||
$t=$out.$_.",";
|
||||
if (length($t) > 70)
|
||||
{
|
||||
print OUT "$out\n";
|
||||
$t="\t$_,";
|
||||
}
|
||||
$out=$t;
|
||||
}
|
||||
chop $out;
|
||||
print OUT "$out";
|
||||
}
|
||||
else
|
||||
{ print OUT $_; }
|
||||
}
|
||||
print OUT "};\n\n";
|
||||
|
||||
printf OUT "static const unsigned int sn_objs[NUM_SN]={\n";
|
||||
print OUT @sn;
|
||||
print OUT "};\n\n";
|
||||
|
||||
printf OUT "static const unsigned int ln_objs[NUM_LN]={\n";
|
||||
print OUT @ln;
|
||||
print OUT "};\n\n";
|
||||
|
||||
printf OUT "static const unsigned int obj_objs[NUM_OBJ]={\n";
|
||||
print OUT @ob;
|
||||
print OUT "};\n\n";
|
||||
|
||||
close OUT;
|
||||
|
||||
sub der_it
|
||||
{
|
||||
local($v)=@_;
|
||||
local(@a,$i,$ret,@r);
|
||||
|
||||
@a=split(/\s+/,$v);
|
||||
$ret.=pack("C*",$a[0]*40+$a[1]);
|
||||
shift @a;
|
||||
shift @a;
|
||||
foreach (@a)
|
||||
{
|
||||
@r=();
|
||||
$t=0;
|
||||
while ($_ >= 128)
|
||||
{
|
||||
$x=$_%128;
|
||||
$_/=128;
|
||||
push(@r,((($t++)?0x80:0)|$x));
|
||||
}
|
||||
push(@r,((($t++)?0x80:0)|$_));
|
||||
$ret.=pack("C*",reverse(@r));
|
||||
}
|
||||
return($ret);
|
||||
}
|
||||
100
openssl-1.0.2f/crypto/objects/obj_err.c
Normal file
100
openssl-1.0.2f/crypto/objects/obj_err.c
Normal file
@@ -0,0 +1,100 @@
|
||||
/* crypto/objects/obj_err.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* NOTE: this file was auto generated by the mkerr.pl script: any changes
|
||||
* made to it will be overwritten when the script next updates this file,
|
||||
* only reason strings will be preserved.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/objects.h>
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
# define ERR_FUNC(func) ERR_PACK(ERR_LIB_OBJ,func,0)
|
||||
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_OBJ,0,reason)
|
||||
|
||||
static ERR_STRING_DATA OBJ_str_functs[] = {
|
||||
{ERR_FUNC(OBJ_F_OBJ_ADD_OBJECT), "OBJ_add_object"},
|
||||
{ERR_FUNC(OBJ_F_OBJ_CREATE), "OBJ_create"},
|
||||
{ERR_FUNC(OBJ_F_OBJ_DUP), "OBJ_dup"},
|
||||
{ERR_FUNC(OBJ_F_OBJ_NAME_NEW_INDEX), "OBJ_NAME_new_index"},
|
||||
{ERR_FUNC(OBJ_F_OBJ_NID2LN), "OBJ_nid2ln"},
|
||||
{ERR_FUNC(OBJ_F_OBJ_NID2OBJ), "OBJ_nid2obj"},
|
||||
{ERR_FUNC(OBJ_F_OBJ_NID2SN), "OBJ_nid2sn"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA OBJ_str_reasons[] = {
|
||||
{ERR_REASON(OBJ_R_MALLOC_FAILURE), "malloc failure"},
|
||||
{ERR_REASON(OBJ_R_UNKNOWN_NID), "unknown nid"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
void ERR_load_OBJ_strings(void)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
if (ERR_func_error_string(OBJ_str_functs[0].error) == NULL) {
|
||||
ERR_load_strings(0, OBJ_str_functs);
|
||||
ERR_load_strings(0, OBJ_str_reasons);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
BIN
openssl-1.0.2f/crypto/objects/obj_err.o
Normal file
BIN
openssl-1.0.2f/crypto/objects/obj_err.o
Normal file
Binary file not shown.
135
openssl-1.0.2f/crypto/objects/obj_lib.c
Normal file
135
openssl-1.0.2f/crypto/objects/obj_lib.c
Normal file
@@ -0,0 +1,135 @@
|
||||
/* crypto/objects/obj_lib.c */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/buffer.h>
|
||||
|
||||
ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o)
|
||||
{
|
||||
ASN1_OBJECT *r;
|
||||
int i;
|
||||
char *ln = NULL, *sn = NULL;
|
||||
unsigned char *data = NULL;
|
||||
|
||||
if (o == NULL)
|
||||
return (NULL);
|
||||
if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
|
||||
return ((ASN1_OBJECT *)o); /* XXX: ugh! Why? What kind of duplication
|
||||
* is this??? */
|
||||
|
||||
r = ASN1_OBJECT_new();
|
||||
if (r == NULL) {
|
||||
OBJerr(OBJ_F_OBJ_DUP, ERR_R_ASN1_LIB);
|
||||
return (NULL);
|
||||
}
|
||||
data = OPENSSL_malloc(o->length);
|
||||
if (data == NULL)
|
||||
goto err;
|
||||
if (o->data != NULL)
|
||||
memcpy(data, o->data, o->length);
|
||||
/* once data attached to object it remains const */
|
||||
r->data = data;
|
||||
r->length = o->length;
|
||||
r->nid = o->nid;
|
||||
r->ln = r->sn = NULL;
|
||||
if (o->ln != NULL) {
|
||||
i = strlen(o->ln) + 1;
|
||||
ln = OPENSSL_malloc(i);
|
||||
if (ln == NULL)
|
||||
goto err;
|
||||
memcpy(ln, o->ln, i);
|
||||
r->ln = ln;
|
||||
}
|
||||
|
||||
if (o->sn != NULL) {
|
||||
i = strlen(o->sn) + 1;
|
||||
sn = OPENSSL_malloc(i);
|
||||
if (sn == NULL)
|
||||
goto err;
|
||||
memcpy(sn, o->sn, i);
|
||||
r->sn = sn;
|
||||
}
|
||||
r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC |
|
||||
ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
|
||||
ASN1_OBJECT_FLAG_DYNAMIC_DATA);
|
||||
return (r);
|
||||
err:
|
||||
OBJerr(OBJ_F_OBJ_DUP, ERR_R_MALLOC_FAILURE);
|
||||
if (ln != NULL)
|
||||
OPENSSL_free(ln);
|
||||
if (sn != NULL)
|
||||
OPENSSL_free(sn);
|
||||
if (data != NULL)
|
||||
OPENSSL_free(data);
|
||||
if (r != NULL)
|
||||
OPENSSL_free(r);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = (a->length - b->length);
|
||||
if (ret)
|
||||
return (ret);
|
||||
return (memcmp(a->data, b->data, a->length));
|
||||
}
|
||||
BIN
openssl-1.0.2f/crypto/objects/obj_lib.o
Normal file
BIN
openssl-1.0.2f/crypto/objects/obj_lib.o
Normal file
Binary file not shown.
4194
openssl-1.0.2f/crypto/objects/obj_mac.h
Normal file
4194
openssl-1.0.2f/crypto/objects/obj_mac.h
Normal file
File diff suppressed because it is too large
Load Diff
957
openssl-1.0.2f/crypto/objects/obj_mac.num
Normal file
957
openssl-1.0.2f/crypto/objects/obj_mac.num
Normal file
@@ -0,0 +1,957 @@
|
||||
undef 0
|
||||
rsadsi 1
|
||||
pkcs 2
|
||||
md2 3
|
||||
md5 4
|
||||
rc4 5
|
||||
rsaEncryption 6
|
||||
md2WithRSAEncryption 7
|
||||
md5WithRSAEncryption 8
|
||||
pbeWithMD2AndDES_CBC 9
|
||||
pbeWithMD5AndDES_CBC 10
|
||||
X500 11
|
||||
X509 12
|
||||
commonName 13
|
||||
countryName 14
|
||||
localityName 15
|
||||
stateOrProvinceName 16
|
||||
organizationName 17
|
||||
organizationalUnitName 18
|
||||
rsa 19
|
||||
pkcs7 20
|
||||
pkcs7_data 21
|
||||
pkcs7_signed 22
|
||||
pkcs7_enveloped 23
|
||||
pkcs7_signedAndEnveloped 24
|
||||
pkcs7_digest 25
|
||||
pkcs7_encrypted 26
|
||||
pkcs3 27
|
||||
dhKeyAgreement 28
|
||||
des_ecb 29
|
||||
des_cfb64 30
|
||||
des_cbc 31
|
||||
des_ede_ecb 32
|
||||
des_ede3_ecb 33
|
||||
idea_cbc 34
|
||||
idea_cfb64 35
|
||||
idea_ecb 36
|
||||
rc2_cbc 37
|
||||
rc2_ecb 38
|
||||
rc2_cfb64 39
|
||||
rc2_ofb64 40
|
||||
sha 41
|
||||
shaWithRSAEncryption 42
|
||||
des_ede_cbc 43
|
||||
des_ede3_cbc 44
|
||||
des_ofb64 45
|
||||
idea_ofb64 46
|
||||
pkcs9 47
|
||||
pkcs9_emailAddress 48
|
||||
pkcs9_unstructuredName 49
|
||||
pkcs9_contentType 50
|
||||
pkcs9_messageDigest 51
|
||||
pkcs9_signingTime 52
|
||||
pkcs9_countersignature 53
|
||||
pkcs9_challengePassword 54
|
||||
pkcs9_unstructuredAddress 55
|
||||
pkcs9_extCertAttributes 56
|
||||
netscape 57
|
||||
netscape_cert_extension 58
|
||||
netscape_data_type 59
|
||||
des_ede_cfb64 60
|
||||
des_ede3_cfb64 61
|
||||
des_ede_ofb64 62
|
||||
des_ede3_ofb64 63
|
||||
sha1 64
|
||||
sha1WithRSAEncryption 65
|
||||
dsaWithSHA 66
|
||||
dsa_2 67
|
||||
pbeWithSHA1AndRC2_CBC 68
|
||||
id_pbkdf2 69
|
||||
dsaWithSHA1_2 70
|
||||
netscape_cert_type 71
|
||||
netscape_base_url 72
|
||||
netscape_revocation_url 73
|
||||
netscape_ca_revocation_url 74
|
||||
netscape_renewal_url 75
|
||||
netscape_ca_policy_url 76
|
||||
netscape_ssl_server_name 77
|
||||
netscape_comment 78
|
||||
netscape_cert_sequence 79
|
||||
desx_cbc 80
|
||||
id_ce 81
|
||||
subject_key_identifier 82
|
||||
key_usage 83
|
||||
private_key_usage_period 84
|
||||
subject_alt_name 85
|
||||
issuer_alt_name 86
|
||||
basic_constraints 87
|
||||
crl_number 88
|
||||
certificate_policies 89
|
||||
authority_key_identifier 90
|
||||
bf_cbc 91
|
||||
bf_ecb 92
|
||||
bf_cfb64 93
|
||||
bf_ofb64 94
|
||||
mdc2 95
|
||||
mdc2WithRSA 96
|
||||
rc4_40 97
|
||||
rc2_40_cbc 98
|
||||
givenName 99
|
||||
surname 100
|
||||
initials 101
|
||||
uniqueIdentifier 102
|
||||
crl_distribution_points 103
|
||||
md5WithRSA 104
|
||||
serialNumber 105
|
||||
title 106
|
||||
description 107
|
||||
cast5_cbc 108
|
||||
cast5_ecb 109
|
||||
cast5_cfb64 110
|
||||
cast5_ofb64 111
|
||||
pbeWithMD5AndCast5_CBC 112
|
||||
dsaWithSHA1 113
|
||||
md5_sha1 114
|
||||
sha1WithRSA 115
|
||||
dsa 116
|
||||
ripemd160 117
|
||||
ripemd160WithRSA 119
|
||||
rc5_cbc 120
|
||||
rc5_ecb 121
|
||||
rc5_cfb64 122
|
||||
rc5_ofb64 123
|
||||
rle_compression 124
|
||||
zlib_compression 125
|
||||
ext_key_usage 126
|
||||
id_pkix 127
|
||||
id_kp 128
|
||||
server_auth 129
|
||||
client_auth 130
|
||||
code_sign 131
|
||||
email_protect 132
|
||||
time_stamp 133
|
||||
ms_code_ind 134
|
||||
ms_code_com 135
|
||||
ms_ctl_sign 136
|
||||
ms_sgc 137
|
||||
ms_efs 138
|
||||
ns_sgc 139
|
||||
delta_crl 140
|
||||
crl_reason 141
|
||||
invalidity_date 142
|
||||
sxnet 143
|
||||
pbe_WithSHA1And128BitRC4 144
|
||||
pbe_WithSHA1And40BitRC4 145
|
||||
pbe_WithSHA1And3_Key_TripleDES_CBC 146
|
||||
pbe_WithSHA1And2_Key_TripleDES_CBC 147
|
||||
pbe_WithSHA1And128BitRC2_CBC 148
|
||||
pbe_WithSHA1And40BitRC2_CBC 149
|
||||
keyBag 150
|
||||
pkcs8ShroudedKeyBag 151
|
||||
certBag 152
|
||||
crlBag 153
|
||||
secretBag 154
|
||||
safeContentsBag 155
|
||||
friendlyName 156
|
||||
localKeyID 157
|
||||
x509Certificate 158
|
||||
sdsiCertificate 159
|
||||
x509Crl 160
|
||||
pbes2 161
|
||||
pbmac1 162
|
||||
hmacWithSHA1 163
|
||||
id_qt_cps 164
|
||||
id_qt_unotice 165
|
||||
rc2_64_cbc 166
|
||||
SMIMECapabilities 167
|
||||
pbeWithMD2AndRC2_CBC 168
|
||||
pbeWithMD5AndRC2_CBC 169
|
||||
pbeWithSHA1AndDES_CBC 170
|
||||
ms_ext_req 171
|
||||
ext_req 172
|
||||
name 173
|
||||
dnQualifier 174
|
||||
id_pe 175
|
||||
id_ad 176
|
||||
info_access 177
|
||||
ad_OCSP 178
|
||||
ad_ca_issuers 179
|
||||
OCSP_sign 180
|
||||
iso 181
|
||||
member_body 182
|
||||
ISO_US 183
|
||||
X9_57 184
|
||||
X9cm 185
|
||||
pkcs1 186
|
||||
pkcs5 187
|
||||
SMIME 188
|
||||
id_smime_mod 189
|
||||
id_smime_ct 190
|
||||
id_smime_aa 191
|
||||
id_smime_alg 192
|
||||
id_smime_cd 193
|
||||
id_smime_spq 194
|
||||
id_smime_cti 195
|
||||
id_smime_mod_cms 196
|
||||
id_smime_mod_ess 197
|
||||
id_smime_mod_oid 198
|
||||
id_smime_mod_msg_v3 199
|
||||
id_smime_mod_ets_eSignature_88 200
|
||||
id_smime_mod_ets_eSignature_97 201
|
||||
id_smime_mod_ets_eSigPolicy_88 202
|
||||
id_smime_mod_ets_eSigPolicy_97 203
|
||||
id_smime_ct_receipt 204
|
||||
id_smime_ct_authData 205
|
||||
id_smime_ct_publishCert 206
|
||||
id_smime_ct_TSTInfo 207
|
||||
id_smime_ct_TDTInfo 208
|
||||
id_smime_ct_contentInfo 209
|
||||
id_smime_ct_DVCSRequestData 210
|
||||
id_smime_ct_DVCSResponseData 211
|
||||
id_smime_aa_receiptRequest 212
|
||||
id_smime_aa_securityLabel 213
|
||||
id_smime_aa_mlExpandHistory 214
|
||||
id_smime_aa_contentHint 215
|
||||
id_smime_aa_msgSigDigest 216
|
||||
id_smime_aa_encapContentType 217
|
||||
id_smime_aa_contentIdentifier 218
|
||||
id_smime_aa_macValue 219
|
||||
id_smime_aa_equivalentLabels 220
|
||||
id_smime_aa_contentReference 221
|
||||
id_smime_aa_encrypKeyPref 222
|
||||
id_smime_aa_signingCertificate 223
|
||||
id_smime_aa_smimeEncryptCerts 224
|
||||
id_smime_aa_timeStampToken 225
|
||||
id_smime_aa_ets_sigPolicyId 226
|
||||
id_smime_aa_ets_commitmentType 227
|
||||
id_smime_aa_ets_signerLocation 228
|
||||
id_smime_aa_ets_signerAttr 229
|
||||
id_smime_aa_ets_otherSigCert 230
|
||||
id_smime_aa_ets_contentTimestamp 231
|
||||
id_smime_aa_ets_CertificateRefs 232
|
||||
id_smime_aa_ets_RevocationRefs 233
|
||||
id_smime_aa_ets_certValues 234
|
||||
id_smime_aa_ets_revocationValues 235
|
||||
id_smime_aa_ets_escTimeStamp 236
|
||||
id_smime_aa_ets_certCRLTimestamp 237
|
||||
id_smime_aa_ets_archiveTimeStamp 238
|
||||
id_smime_aa_signatureType 239
|
||||
id_smime_aa_dvcs_dvc 240
|
||||
id_smime_alg_ESDHwith3DES 241
|
||||
id_smime_alg_ESDHwithRC2 242
|
||||
id_smime_alg_3DESwrap 243
|
||||
id_smime_alg_RC2wrap 244
|
||||
id_smime_alg_ESDH 245
|
||||
id_smime_alg_CMS3DESwrap 246
|
||||
id_smime_alg_CMSRC2wrap 247
|
||||
id_smime_cd_ldap 248
|
||||
id_smime_spq_ets_sqt_uri 249
|
||||
id_smime_spq_ets_sqt_unotice 250
|
||||
id_smime_cti_ets_proofOfOrigin 251
|
||||
id_smime_cti_ets_proofOfReceipt 252
|
||||
id_smime_cti_ets_proofOfDelivery 253
|
||||
id_smime_cti_ets_proofOfSender 254
|
||||
id_smime_cti_ets_proofOfApproval 255
|
||||
id_smime_cti_ets_proofOfCreation 256
|
||||
md4 257
|
||||
id_pkix_mod 258
|
||||
id_qt 259
|
||||
id_it 260
|
||||
id_pkip 261
|
||||
id_alg 262
|
||||
id_cmc 263
|
||||
id_on 264
|
||||
id_pda 265
|
||||
id_aca 266
|
||||
id_qcs 267
|
||||
id_cct 268
|
||||
id_pkix1_explicit_88 269
|
||||
id_pkix1_implicit_88 270
|
||||
id_pkix1_explicit_93 271
|
||||
id_pkix1_implicit_93 272
|
||||
id_mod_crmf 273
|
||||
id_mod_cmc 274
|
||||
id_mod_kea_profile_88 275
|
||||
id_mod_kea_profile_93 276
|
||||
id_mod_cmp 277
|
||||
id_mod_qualified_cert_88 278
|
||||
id_mod_qualified_cert_93 279
|
||||
id_mod_attribute_cert 280
|
||||
id_mod_timestamp_protocol 281
|
||||
id_mod_ocsp 282
|
||||
id_mod_dvcs 283
|
||||
id_mod_cmp2000 284
|
||||
biometricInfo 285
|
||||
qcStatements 286
|
||||
ac_auditEntity 287
|
||||
ac_targeting 288
|
||||
aaControls 289
|
||||
sbgp_ipAddrBlock 290
|
||||
sbgp_autonomousSysNum 291
|
||||
sbgp_routerIdentifier 292
|
||||
textNotice 293
|
||||
ipsecEndSystem 294
|
||||
ipsecTunnel 295
|
||||
ipsecUser 296
|
||||
dvcs 297
|
||||
id_it_caProtEncCert 298
|
||||
id_it_signKeyPairTypes 299
|
||||
id_it_encKeyPairTypes 300
|
||||
id_it_preferredSymmAlg 301
|
||||
id_it_caKeyUpdateInfo 302
|
||||
id_it_currentCRL 303
|
||||
id_it_unsupportedOIDs 304
|
||||
id_it_subscriptionRequest 305
|
||||
id_it_subscriptionResponse 306
|
||||
id_it_keyPairParamReq 307
|
||||
id_it_keyPairParamRep 308
|
||||
id_it_revPassphrase 309
|
||||
id_it_implicitConfirm 310
|
||||
id_it_confirmWaitTime 311
|
||||
id_it_origPKIMessage 312
|
||||
id_regCtrl 313
|
||||
id_regInfo 314
|
||||
id_regCtrl_regToken 315
|
||||
id_regCtrl_authenticator 316
|
||||
id_regCtrl_pkiPublicationInfo 317
|
||||
id_regCtrl_pkiArchiveOptions 318
|
||||
id_regCtrl_oldCertID 319
|
||||
id_regCtrl_protocolEncrKey 320
|
||||
id_regInfo_utf8Pairs 321
|
||||
id_regInfo_certReq 322
|
||||
id_alg_des40 323
|
||||
id_alg_noSignature 324
|
||||
id_alg_dh_sig_hmac_sha1 325
|
||||
id_alg_dh_pop 326
|
||||
id_cmc_statusInfo 327
|
||||
id_cmc_identification 328
|
||||
id_cmc_identityProof 329
|
||||
id_cmc_dataReturn 330
|
||||
id_cmc_transactionId 331
|
||||
id_cmc_senderNonce 332
|
||||
id_cmc_recipientNonce 333
|
||||
id_cmc_addExtensions 334
|
||||
id_cmc_encryptedPOP 335
|
||||
id_cmc_decryptedPOP 336
|
||||
id_cmc_lraPOPWitness 337
|
||||
id_cmc_getCert 338
|
||||
id_cmc_getCRL 339
|
||||
id_cmc_revokeRequest 340
|
||||
id_cmc_regInfo 341
|
||||
id_cmc_responseInfo 342
|
||||
id_cmc_queryPending 343
|
||||
id_cmc_popLinkRandom 344
|
||||
id_cmc_popLinkWitness 345
|
||||
id_cmc_confirmCertAcceptance 346
|
||||
id_on_personalData 347
|
||||
id_pda_dateOfBirth 348
|
||||
id_pda_placeOfBirth 349
|
||||
id_pda_pseudonym 350
|
||||
id_pda_gender 351
|
||||
id_pda_countryOfCitizenship 352
|
||||
id_pda_countryOfResidence 353
|
||||
id_aca_authenticationInfo 354
|
||||
id_aca_accessIdentity 355
|
||||
id_aca_chargingIdentity 356
|
||||
id_aca_group 357
|
||||
id_aca_role 358
|
||||
id_qcs_pkixQCSyntax_v1 359
|
||||
id_cct_crs 360
|
||||
id_cct_PKIData 361
|
||||
id_cct_PKIResponse 362
|
||||
ad_timeStamping 363
|
||||
ad_dvcs 364
|
||||
id_pkix_OCSP_basic 365
|
||||
id_pkix_OCSP_Nonce 366
|
||||
id_pkix_OCSP_CrlID 367
|
||||
id_pkix_OCSP_acceptableResponses 368
|
||||
id_pkix_OCSP_noCheck 369
|
||||
id_pkix_OCSP_archiveCutoff 370
|
||||
id_pkix_OCSP_serviceLocator 371
|
||||
id_pkix_OCSP_extendedStatus 372
|
||||
id_pkix_OCSP_valid 373
|
||||
id_pkix_OCSP_path 374
|
||||
id_pkix_OCSP_trustRoot 375
|
||||
algorithm 376
|
||||
rsaSignature 377
|
||||
X500algorithms 378
|
||||
org 379
|
||||
dod 380
|
||||
iana 381
|
||||
Directory 382
|
||||
Management 383
|
||||
Experimental 384
|
||||
Private 385
|
||||
Security 386
|
||||
SNMPv2 387
|
||||
Mail 388
|
||||
Enterprises 389
|
||||
dcObject 390
|
||||
domainComponent 391
|
||||
Domain 392
|
||||
joint_iso_ccitt 393
|
||||
selected_attribute_types 394
|
||||
clearance 395
|
||||
md4WithRSAEncryption 396
|
||||
ac_proxying 397
|
||||
sinfo_access 398
|
||||
id_aca_encAttrs 399
|
||||
role 400
|
||||
policy_constraints 401
|
||||
target_information 402
|
||||
no_rev_avail 403
|
||||
ccitt 404
|
||||
ansi_X9_62 405
|
||||
X9_62_prime_field 406
|
||||
X9_62_characteristic_two_field 407
|
||||
X9_62_id_ecPublicKey 408
|
||||
X9_62_prime192v1 409
|
||||
X9_62_prime192v2 410
|
||||
X9_62_prime192v3 411
|
||||
X9_62_prime239v1 412
|
||||
X9_62_prime239v2 413
|
||||
X9_62_prime239v3 414
|
||||
X9_62_prime256v1 415
|
||||
ecdsa_with_SHA1 416
|
||||
ms_csp_name 417
|
||||
aes_128_ecb 418
|
||||
aes_128_cbc 419
|
||||
aes_128_ofb128 420
|
||||
aes_128_cfb128 421
|
||||
aes_192_ecb 422
|
||||
aes_192_cbc 423
|
||||
aes_192_ofb128 424
|
||||
aes_192_cfb128 425
|
||||
aes_256_ecb 426
|
||||
aes_256_cbc 427
|
||||
aes_256_ofb128 428
|
||||
aes_256_cfb128 429
|
||||
hold_instruction_code 430
|
||||
hold_instruction_none 431
|
||||
hold_instruction_call_issuer 432
|
||||
hold_instruction_reject 433
|
||||
data 434
|
||||
pss 435
|
||||
ucl 436
|
||||
pilot 437
|
||||
pilotAttributeType 438
|
||||
pilotAttributeSyntax 439
|
||||
pilotObjectClass 440
|
||||
pilotGroups 441
|
||||
iA5StringSyntax 442
|
||||
caseIgnoreIA5StringSyntax 443
|
||||
pilotObject 444
|
||||
pilotPerson 445
|
||||
account 446
|
||||
document 447
|
||||
room 448
|
||||
documentSeries 449
|
||||
rFC822localPart 450
|
||||
dNSDomain 451
|
||||
domainRelatedObject 452
|
||||
friendlyCountry 453
|
||||
simpleSecurityObject 454
|
||||
pilotOrganization 455
|
||||
pilotDSA 456
|
||||
qualityLabelledData 457
|
||||
userId 458
|
||||
textEncodedORAddress 459
|
||||
rfc822Mailbox 460
|
||||
info 461
|
||||
favouriteDrink 462
|
||||
roomNumber 463
|
||||
photo 464
|
||||
userClass 465
|
||||
host 466
|
||||
manager 467
|
||||
documentIdentifier 468
|
||||
documentTitle 469
|
||||
documentVersion 470
|
||||
documentAuthor 471
|
||||
documentLocation 472
|
||||
homeTelephoneNumber 473
|
||||
secretary 474
|
||||
otherMailbox 475
|
||||
lastModifiedTime 476
|
||||
lastModifiedBy 477
|
||||
aRecord 478
|
||||
pilotAttributeType27 479
|
||||
mXRecord 480
|
||||
nSRecord 481
|
||||
sOARecord 482
|
||||
cNAMERecord 483
|
||||
associatedDomain 484
|
||||
associatedName 485
|
||||
homePostalAddress 486
|
||||
personalTitle 487
|
||||
mobileTelephoneNumber 488
|
||||
pagerTelephoneNumber 489
|
||||
friendlyCountryName 490
|
||||
organizationalStatus 491
|
||||
janetMailbox 492
|
||||
mailPreferenceOption 493
|
||||
buildingName 494
|
||||
dSAQuality 495
|
||||
singleLevelQuality 496
|
||||
subtreeMinimumQuality 497
|
||||
subtreeMaximumQuality 498
|
||||
personalSignature 499
|
||||
dITRedirect 500
|
||||
audio 501
|
||||
documentPublisher 502
|
||||
x500UniqueIdentifier 503
|
||||
mime_mhs 504
|
||||
mime_mhs_headings 505
|
||||
mime_mhs_bodies 506
|
||||
id_hex_partial_message 507
|
||||
id_hex_multipart_message 508
|
||||
generationQualifier 509
|
||||
pseudonym 510
|
||||
InternationalRA 511
|
||||
id_set 512
|
||||
set_ctype 513
|
||||
set_msgExt 514
|
||||
set_attr 515
|
||||
set_policy 516
|
||||
set_certExt 517
|
||||
set_brand 518
|
||||
setct_PANData 519
|
||||
setct_PANToken 520
|
||||
setct_PANOnly 521
|
||||
setct_OIData 522
|
||||
setct_PI 523
|
||||
setct_PIData 524
|
||||
setct_PIDataUnsigned 525
|
||||
setct_HODInput 526
|
||||
setct_AuthResBaggage 527
|
||||
setct_AuthRevReqBaggage 528
|
||||
setct_AuthRevResBaggage 529
|
||||
setct_CapTokenSeq 530
|
||||
setct_PInitResData 531
|
||||
setct_PI_TBS 532
|
||||
setct_PResData 533
|
||||
setct_AuthReqTBS 534
|
||||
setct_AuthResTBS 535
|
||||
setct_AuthResTBSX 536
|
||||
setct_AuthTokenTBS 537
|
||||
setct_CapTokenData 538
|
||||
setct_CapTokenTBS 539
|
||||
setct_AcqCardCodeMsg 540
|
||||
setct_AuthRevReqTBS 541
|
||||
setct_AuthRevResData 542
|
||||
setct_AuthRevResTBS 543
|
||||
setct_CapReqTBS 544
|
||||
setct_CapReqTBSX 545
|
||||
setct_CapResData 546
|
||||
setct_CapRevReqTBS 547
|
||||
setct_CapRevReqTBSX 548
|
||||
setct_CapRevResData 549
|
||||
setct_CredReqTBS 550
|
||||
setct_CredReqTBSX 551
|
||||
setct_CredResData 552
|
||||
setct_CredRevReqTBS 553
|
||||
setct_CredRevReqTBSX 554
|
||||
setct_CredRevResData 555
|
||||
setct_PCertReqData 556
|
||||
setct_PCertResTBS 557
|
||||
setct_BatchAdminReqData 558
|
||||
setct_BatchAdminResData 559
|
||||
setct_CardCInitResTBS 560
|
||||
setct_MeAqCInitResTBS 561
|
||||
setct_RegFormResTBS 562
|
||||
setct_CertReqData 563
|
||||
setct_CertReqTBS 564
|
||||
setct_CertResData 565
|
||||
setct_CertInqReqTBS 566
|
||||
setct_ErrorTBS 567
|
||||
setct_PIDualSignedTBE 568
|
||||
setct_PIUnsignedTBE 569
|
||||
setct_AuthReqTBE 570
|
||||
setct_AuthResTBE 571
|
||||
setct_AuthResTBEX 572
|
||||
setct_AuthTokenTBE 573
|
||||
setct_CapTokenTBE 574
|
||||
setct_CapTokenTBEX 575
|
||||
setct_AcqCardCodeMsgTBE 576
|
||||
setct_AuthRevReqTBE 577
|
||||
setct_AuthRevResTBE 578
|
||||
setct_AuthRevResTBEB 579
|
||||
setct_CapReqTBE 580
|
||||
setct_CapReqTBEX 581
|
||||
setct_CapResTBE 582
|
||||
setct_CapRevReqTBE 583
|
||||
setct_CapRevReqTBEX 584
|
||||
setct_CapRevResTBE 585
|
||||
setct_CredReqTBE 586
|
||||
setct_CredReqTBEX 587
|
||||
setct_CredResTBE 588
|
||||
setct_CredRevReqTBE 589
|
||||
setct_CredRevReqTBEX 590
|
||||
setct_CredRevResTBE 591
|
||||
setct_BatchAdminReqTBE 592
|
||||
setct_BatchAdminResTBE 593
|
||||
setct_RegFormReqTBE 594
|
||||
setct_CertReqTBE 595
|
||||
setct_CertReqTBEX 596
|
||||
setct_CertResTBE 597
|
||||
setct_CRLNotificationTBS 598
|
||||
setct_CRLNotificationResTBS 599
|
||||
setct_BCIDistributionTBS 600
|
||||
setext_genCrypt 601
|
||||
setext_miAuth 602
|
||||
setext_pinSecure 603
|
||||
setext_pinAny 604
|
||||
setext_track2 605
|
||||
setext_cv 606
|
||||
set_policy_root 607
|
||||
setCext_hashedRoot 608
|
||||
setCext_certType 609
|
||||
setCext_merchData 610
|
||||
setCext_cCertRequired 611
|
||||
setCext_tunneling 612
|
||||
setCext_setExt 613
|
||||
setCext_setQualf 614
|
||||
setCext_PGWYcapabilities 615
|
||||
setCext_TokenIdentifier 616
|
||||
setCext_Track2Data 617
|
||||
setCext_TokenType 618
|
||||
setCext_IssuerCapabilities 619
|
||||
setAttr_Cert 620
|
||||
setAttr_PGWYcap 621
|
||||
setAttr_TokenType 622
|
||||
setAttr_IssCap 623
|
||||
set_rootKeyThumb 624
|
||||
set_addPolicy 625
|
||||
setAttr_Token_EMV 626
|
||||
setAttr_Token_B0Prime 627
|
||||
setAttr_IssCap_CVM 628
|
||||
setAttr_IssCap_T2 629
|
||||
setAttr_IssCap_Sig 630
|
||||
setAttr_GenCryptgrm 631
|
||||
setAttr_T2Enc 632
|
||||
setAttr_T2cleartxt 633
|
||||
setAttr_TokICCsig 634
|
||||
setAttr_SecDevSig 635
|
||||
set_brand_IATA_ATA 636
|
||||
set_brand_Diners 637
|
||||
set_brand_AmericanExpress 638
|
||||
set_brand_JCB 639
|
||||
set_brand_Visa 640
|
||||
set_brand_MasterCard 641
|
||||
set_brand_Novus 642
|
||||
des_cdmf 643
|
||||
rsaOAEPEncryptionSET 644
|
||||
itu_t 645
|
||||
joint_iso_itu_t 646
|
||||
international_organizations 647
|
||||
ms_smartcard_login 648
|
||||
ms_upn 649
|
||||
aes_128_cfb1 650
|
||||
aes_192_cfb1 651
|
||||
aes_256_cfb1 652
|
||||
aes_128_cfb8 653
|
||||
aes_192_cfb8 654
|
||||
aes_256_cfb8 655
|
||||
des_cfb1 656
|
||||
des_cfb8 657
|
||||
des_ede3_cfb1 658
|
||||
des_ede3_cfb8 659
|
||||
streetAddress 660
|
||||
postalCode 661
|
||||
id_ppl 662
|
||||
proxyCertInfo 663
|
||||
id_ppl_anyLanguage 664
|
||||
id_ppl_inheritAll 665
|
||||
name_constraints 666
|
||||
Independent 667
|
||||
sha256WithRSAEncryption 668
|
||||
sha384WithRSAEncryption 669
|
||||
sha512WithRSAEncryption 670
|
||||
sha224WithRSAEncryption 671
|
||||
sha256 672
|
||||
sha384 673
|
||||
sha512 674
|
||||
sha224 675
|
||||
identified_organization 676
|
||||
certicom_arc 677
|
||||
wap 678
|
||||
wap_wsg 679
|
||||
X9_62_id_characteristic_two_basis 680
|
||||
X9_62_onBasis 681
|
||||
X9_62_tpBasis 682
|
||||
X9_62_ppBasis 683
|
||||
X9_62_c2pnb163v1 684
|
||||
X9_62_c2pnb163v2 685
|
||||
X9_62_c2pnb163v3 686
|
||||
X9_62_c2pnb176v1 687
|
||||
X9_62_c2tnb191v1 688
|
||||
X9_62_c2tnb191v2 689
|
||||
X9_62_c2tnb191v3 690
|
||||
X9_62_c2onb191v4 691
|
||||
X9_62_c2onb191v5 692
|
||||
X9_62_c2pnb208w1 693
|
||||
X9_62_c2tnb239v1 694
|
||||
X9_62_c2tnb239v2 695
|
||||
X9_62_c2tnb239v3 696
|
||||
X9_62_c2onb239v4 697
|
||||
X9_62_c2onb239v5 698
|
||||
X9_62_c2pnb272w1 699
|
||||
X9_62_c2pnb304w1 700
|
||||
X9_62_c2tnb359v1 701
|
||||
X9_62_c2pnb368w1 702
|
||||
X9_62_c2tnb431r1 703
|
||||
secp112r1 704
|
||||
secp112r2 705
|
||||
secp128r1 706
|
||||
secp128r2 707
|
||||
secp160k1 708
|
||||
secp160r1 709
|
||||
secp160r2 710
|
||||
secp192k1 711
|
||||
secp224k1 712
|
||||
secp224r1 713
|
||||
secp256k1 714
|
||||
secp384r1 715
|
||||
secp521r1 716
|
||||
sect113r1 717
|
||||
sect113r2 718
|
||||
sect131r1 719
|
||||
sect131r2 720
|
||||
sect163k1 721
|
||||
sect163r1 722
|
||||
sect163r2 723
|
||||
sect193r1 724
|
||||
sect193r2 725
|
||||
sect233k1 726
|
||||
sect233r1 727
|
||||
sect239k1 728
|
||||
sect283k1 729
|
||||
sect283r1 730
|
||||
sect409k1 731
|
||||
sect409r1 732
|
||||
sect571k1 733
|
||||
sect571r1 734
|
||||
wap_wsg_idm_ecid_wtls1 735
|
||||
wap_wsg_idm_ecid_wtls3 736
|
||||
wap_wsg_idm_ecid_wtls4 737
|
||||
wap_wsg_idm_ecid_wtls5 738
|
||||
wap_wsg_idm_ecid_wtls6 739
|
||||
wap_wsg_idm_ecid_wtls7 740
|
||||
wap_wsg_idm_ecid_wtls8 741
|
||||
wap_wsg_idm_ecid_wtls9 742
|
||||
wap_wsg_idm_ecid_wtls10 743
|
||||
wap_wsg_idm_ecid_wtls11 744
|
||||
wap_wsg_idm_ecid_wtls12 745
|
||||
any_policy 746
|
||||
policy_mappings 747
|
||||
inhibit_any_policy 748
|
||||
ipsec3 749
|
||||
ipsec4 750
|
||||
camellia_128_cbc 751
|
||||
camellia_192_cbc 752
|
||||
camellia_256_cbc 753
|
||||
camellia_128_ecb 754
|
||||
camellia_192_ecb 755
|
||||
camellia_256_ecb 756
|
||||
camellia_128_cfb128 757
|
||||
camellia_192_cfb128 758
|
||||
camellia_256_cfb128 759
|
||||
camellia_128_cfb1 760
|
||||
camellia_192_cfb1 761
|
||||
camellia_256_cfb1 762
|
||||
camellia_128_cfb8 763
|
||||
camellia_192_cfb8 764
|
||||
camellia_256_cfb8 765
|
||||
camellia_128_ofb128 766
|
||||
camellia_192_ofb128 767
|
||||
camellia_256_ofb128 768
|
||||
subject_directory_attributes 769
|
||||
issuing_distribution_point 770
|
||||
certificate_issuer 771
|
||||
korea 772
|
||||
kisa 773
|
||||
kftc 774
|
||||
npki_alg 775
|
||||
seed_ecb 776
|
||||
seed_cbc 777
|
||||
seed_ofb128 778
|
||||
seed_cfb128 779
|
||||
hmac_md5 780
|
||||
hmac_sha1 781
|
||||
id_PasswordBasedMAC 782
|
||||
id_DHBasedMac 783
|
||||
id_it_suppLangTags 784
|
||||
caRepository 785
|
||||
id_smime_ct_compressedData 786
|
||||
id_ct_asciiTextWithCRLF 787
|
||||
id_aes128_wrap 788
|
||||
id_aes192_wrap 789
|
||||
id_aes256_wrap 790
|
||||
ecdsa_with_Recommended 791
|
||||
ecdsa_with_Specified 792
|
||||
ecdsa_with_SHA224 793
|
||||
ecdsa_with_SHA256 794
|
||||
ecdsa_with_SHA384 795
|
||||
ecdsa_with_SHA512 796
|
||||
hmacWithMD5 797
|
||||
hmacWithSHA224 798
|
||||
hmacWithSHA256 799
|
||||
hmacWithSHA384 800
|
||||
hmacWithSHA512 801
|
||||
dsa_with_SHA224 802
|
||||
dsa_with_SHA256 803
|
||||
whirlpool 804
|
||||
cryptopro 805
|
||||
cryptocom 806
|
||||
id_GostR3411_94_with_GostR3410_2001 807
|
||||
id_GostR3411_94_with_GostR3410_94 808
|
||||
id_GostR3411_94 809
|
||||
id_HMACGostR3411_94 810
|
||||
id_GostR3410_2001 811
|
||||
id_GostR3410_94 812
|
||||
id_Gost28147_89 813
|
||||
gost89_cnt 814
|
||||
id_Gost28147_89_MAC 815
|
||||
id_GostR3411_94_prf 816
|
||||
id_GostR3410_2001DH 817
|
||||
id_GostR3410_94DH 818
|
||||
id_Gost28147_89_CryptoPro_KeyMeshing 819
|
||||
id_Gost28147_89_None_KeyMeshing 820
|
||||
id_GostR3411_94_TestParamSet 821
|
||||
id_GostR3411_94_CryptoProParamSet 822
|
||||
id_Gost28147_89_TestParamSet 823
|
||||
id_Gost28147_89_CryptoPro_A_ParamSet 824
|
||||
id_Gost28147_89_CryptoPro_B_ParamSet 825
|
||||
id_Gost28147_89_CryptoPro_C_ParamSet 826
|
||||
id_Gost28147_89_CryptoPro_D_ParamSet 827
|
||||
id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828
|
||||
id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829
|
||||
id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830
|
||||
id_GostR3410_94_TestParamSet 831
|
||||
id_GostR3410_94_CryptoPro_A_ParamSet 832
|
||||
id_GostR3410_94_CryptoPro_B_ParamSet 833
|
||||
id_GostR3410_94_CryptoPro_C_ParamSet 834
|
||||
id_GostR3410_94_CryptoPro_D_ParamSet 835
|
||||
id_GostR3410_94_CryptoPro_XchA_ParamSet 836
|
||||
id_GostR3410_94_CryptoPro_XchB_ParamSet 837
|
||||
id_GostR3410_94_CryptoPro_XchC_ParamSet 838
|
||||
id_GostR3410_2001_TestParamSet 839
|
||||
id_GostR3410_2001_CryptoPro_A_ParamSet 840
|
||||
id_GostR3410_2001_CryptoPro_B_ParamSet 841
|
||||
id_GostR3410_2001_CryptoPro_C_ParamSet 842
|
||||
id_GostR3410_2001_CryptoPro_XchA_ParamSet 843
|
||||
id_GostR3410_2001_CryptoPro_XchB_ParamSet 844
|
||||
id_GostR3410_94_a 845
|
||||
id_GostR3410_94_aBis 846
|
||||
id_GostR3410_94_b 847
|
||||
id_GostR3410_94_bBis 848
|
||||
id_Gost28147_89_cc 849
|
||||
id_GostR3410_94_cc 850
|
||||
id_GostR3410_2001_cc 851
|
||||
id_GostR3411_94_with_GostR3410_94_cc 852
|
||||
id_GostR3411_94_with_GostR3410_2001_cc 853
|
||||
id_GostR3410_2001_ParamSet_cc 854
|
||||
hmac 855
|
||||
LocalKeySet 856
|
||||
freshest_crl 857
|
||||
id_on_permanentIdentifier 858
|
||||
searchGuide 859
|
||||
businessCategory 860
|
||||
postalAddress 861
|
||||
postOfficeBox 862
|
||||
physicalDeliveryOfficeName 863
|
||||
telephoneNumber 864
|
||||
telexNumber 865
|
||||
teletexTerminalIdentifier 866
|
||||
facsimileTelephoneNumber 867
|
||||
x121Address 868
|
||||
internationaliSDNNumber 869
|
||||
registeredAddress 870
|
||||
destinationIndicator 871
|
||||
preferredDeliveryMethod 872
|
||||
presentationAddress 873
|
||||
supportedApplicationContext 874
|
||||
member 875
|
||||
owner 876
|
||||
roleOccupant 877
|
||||
seeAlso 878
|
||||
userPassword 879
|
||||
userCertificate 880
|
||||
cACertificate 881
|
||||
authorityRevocationList 882
|
||||
certificateRevocationList 883
|
||||
crossCertificatePair 884
|
||||
enhancedSearchGuide 885
|
||||
protocolInformation 886
|
||||
distinguishedName 887
|
||||
uniqueMember 888
|
||||
houseIdentifier 889
|
||||
supportedAlgorithms 890
|
||||
deltaRevocationList 891
|
||||
dmdName 892
|
||||
id_alg_PWRI_KEK 893
|
||||
cmac 894
|
||||
aes_128_gcm 895
|
||||
aes_128_ccm 896
|
||||
id_aes128_wrap_pad 897
|
||||
aes_192_gcm 898
|
||||
aes_192_ccm 899
|
||||
id_aes192_wrap_pad 900
|
||||
aes_256_gcm 901
|
||||
aes_256_ccm 902
|
||||
id_aes256_wrap_pad 903
|
||||
aes_128_ctr 904
|
||||
aes_192_ctr 905
|
||||
aes_256_ctr 906
|
||||
id_camellia128_wrap 907
|
||||
id_camellia192_wrap 908
|
||||
id_camellia256_wrap 909
|
||||
anyExtendedKeyUsage 910
|
||||
mgf1 911
|
||||
rsassaPss 912
|
||||
aes_128_xts 913
|
||||
aes_256_xts 914
|
||||
rc4_hmac_md5 915
|
||||
aes_128_cbc_hmac_sha1 916
|
||||
aes_192_cbc_hmac_sha1 917
|
||||
aes_256_cbc_hmac_sha1 918
|
||||
rsaesOaep 919
|
||||
dhpublicnumber 920
|
||||
brainpoolP160r1 921
|
||||
brainpoolP160t1 922
|
||||
brainpoolP192r1 923
|
||||
brainpoolP192t1 924
|
||||
brainpoolP224r1 925
|
||||
brainpoolP224t1 926
|
||||
brainpoolP256r1 927
|
||||
brainpoolP256t1 928
|
||||
brainpoolP320r1 929
|
||||
brainpoolP320t1 930
|
||||
brainpoolP384r1 931
|
||||
brainpoolP384t1 932
|
||||
brainpoolP512r1 933
|
||||
brainpoolP512t1 934
|
||||
pSpecified 935
|
||||
dhSinglePass_stdDH_sha1kdf_scheme 936
|
||||
dhSinglePass_stdDH_sha224kdf_scheme 937
|
||||
dhSinglePass_stdDH_sha256kdf_scheme 938
|
||||
dhSinglePass_stdDH_sha384kdf_scheme 939
|
||||
dhSinglePass_stdDH_sha512kdf_scheme 940
|
||||
dhSinglePass_cofactorDH_sha1kdf_scheme 941
|
||||
dhSinglePass_cofactorDH_sha224kdf_scheme 942
|
||||
dhSinglePass_cofactorDH_sha256kdf_scheme 943
|
||||
dhSinglePass_cofactorDH_sha384kdf_scheme 944
|
||||
dhSinglePass_cofactorDH_sha512kdf_scheme 945
|
||||
dh_std_kdf 946
|
||||
dh_cofactor_kdf 947
|
||||
aes_128_cbc_hmac_sha256 948
|
||||
aes_192_cbc_hmac_sha256 949
|
||||
aes_256_cbc_hmac_sha256 950
|
||||
ct_precert_scts 951
|
||||
ct_precert_poison 952
|
||||
ct_precert_signer 953
|
||||
ct_cert_scts 954
|
||||
jurisdictionLocalityName 955
|
||||
jurisdictionStateOrProvinceName 956
|
||||
jurisdictionCountryName 957
|
||||
222
openssl-1.0.2f/crypto/objects/obj_xref.c
Normal file
222
openssl-1.0.2f/crypto/objects/obj_xref.c
Normal file
@@ -0,0 +1,222 @@
|
||||
/* crypto/objects/obj_xref.c */
|
||||
/*
|
||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
||||
* 2006.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openssl/objects.h>
|
||||
#include "obj_xref.h"
|
||||
|
||||
DECLARE_STACK_OF(nid_triple)
|
||||
STACK_OF(nid_triple) *sig_app, *sigx_app;
|
||||
|
||||
static int sig_cmp(const nid_triple *a, const nid_triple *b)
|
||||
{
|
||||
return a->sign_id - b->sign_id;
|
||||
}
|
||||
|
||||
DECLARE_OBJ_BSEARCH_CMP_FN(nid_triple, nid_triple, sig);
|
||||
IMPLEMENT_OBJ_BSEARCH_CMP_FN(nid_triple, nid_triple, sig);
|
||||
|
||||
static int sig_sk_cmp(const nid_triple *const *a, const nid_triple *const *b)
|
||||
{
|
||||
return (*a)->sign_id - (*b)->sign_id;
|
||||
}
|
||||
|
||||
DECLARE_OBJ_BSEARCH_CMP_FN(const nid_triple *, const nid_triple *, sigx);
|
||||
|
||||
static int sigx_cmp(const nid_triple *const *a, const nid_triple *const *b)
|
||||
{
|
||||
int ret;
|
||||
ret = (*a)->hash_id - (*b)->hash_id;
|
||||
if (ret)
|
||||
return ret;
|
||||
return (*a)->pkey_id - (*b)->pkey_id;
|
||||
}
|
||||
|
||||
IMPLEMENT_OBJ_BSEARCH_CMP_FN(const nid_triple *, const nid_triple *, sigx);
|
||||
|
||||
int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid)
|
||||
{
|
||||
nid_triple tmp;
|
||||
const nid_triple *rv = NULL;
|
||||
tmp.sign_id = signid;
|
||||
|
||||
if (sig_app) {
|
||||
int idx = sk_nid_triple_find(sig_app, &tmp);
|
||||
if (idx >= 0)
|
||||
rv = sk_nid_triple_value(sig_app, idx);
|
||||
}
|
||||
#ifndef OBJ_XREF_TEST2
|
||||
if (rv == NULL) {
|
||||
rv = OBJ_bsearch_sig(&tmp, sigoid_srt,
|
||||
sizeof(sigoid_srt) / sizeof(nid_triple));
|
||||
}
|
||||
#endif
|
||||
if (rv == NULL)
|
||||
return 0;
|
||||
if (pdig_nid)
|
||||
*pdig_nid = rv->hash_id;
|
||||
if (ppkey_nid)
|
||||
*ppkey_nid = rv->pkey_id;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid)
|
||||
{
|
||||
nid_triple tmp;
|
||||
const nid_triple *t = &tmp;
|
||||
const nid_triple **rv = NULL;
|
||||
|
||||
tmp.hash_id = dig_nid;
|
||||
tmp.pkey_id = pkey_nid;
|
||||
|
||||
if (sigx_app) {
|
||||
int idx = sk_nid_triple_find(sigx_app, &tmp);
|
||||
if (idx >= 0) {
|
||||
t = sk_nid_triple_value(sigx_app, idx);
|
||||
rv = &t;
|
||||
}
|
||||
}
|
||||
#ifndef OBJ_XREF_TEST2
|
||||
if (rv == NULL) {
|
||||
rv = OBJ_bsearch_sigx(&t, sigoid_srt_xref,
|
||||
sizeof(sigoid_srt_xref) / sizeof(nid_triple *)
|
||||
);
|
||||
}
|
||||
#endif
|
||||
if (rv == NULL)
|
||||
return 0;
|
||||
if (psignid)
|
||||
*psignid = (*rv)->sign_id;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int OBJ_add_sigid(int signid, int dig_id, int pkey_id)
|
||||
{
|
||||
nid_triple *ntr;
|
||||
if (!sig_app)
|
||||
sig_app = sk_nid_triple_new(sig_sk_cmp);
|
||||
if (!sig_app)
|
||||
return 0;
|
||||
if (!sigx_app)
|
||||
sigx_app = sk_nid_triple_new(sigx_cmp);
|
||||
if (!sigx_app)
|
||||
return 0;
|
||||
ntr = OPENSSL_malloc(sizeof(int) * 3);
|
||||
if (!ntr)
|
||||
return 0;
|
||||
ntr->sign_id = signid;
|
||||
ntr->hash_id = dig_id;
|
||||
ntr->pkey_id = pkey_id;
|
||||
|
||||
if (!sk_nid_triple_push(sig_app, ntr)) {
|
||||
OPENSSL_free(ntr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!sk_nid_triple_push(sigx_app, ntr))
|
||||
return 0;
|
||||
|
||||
sk_nid_triple_sort(sig_app);
|
||||
sk_nid_triple_sort(sigx_app);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void sid_free(nid_triple *tt)
|
||||
{
|
||||
OPENSSL_free(tt);
|
||||
}
|
||||
|
||||
void OBJ_sigid_free(void)
|
||||
{
|
||||
if (sig_app) {
|
||||
sk_nid_triple_pop_free(sig_app, sid_free);
|
||||
sig_app = NULL;
|
||||
}
|
||||
if (sigx_app) {
|
||||
sk_nid_triple_free(sigx_app);
|
||||
sigx_app = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef OBJ_XREF_TEST
|
||||
|
||||
main()
|
||||
{
|
||||
int n1, n2, n3;
|
||||
|
||||
int i, rv;
|
||||
# ifdef OBJ_XREF_TEST2
|
||||
for (i = 0; i < sizeof(sigoid_srt) / sizeof(nid_triple); i++) {
|
||||
OBJ_add_sigid(sigoid_srt[i][0], sigoid_srt[i][1], sigoid_srt[i][2]);
|
||||
}
|
||||
# endif
|
||||
|
||||
for (i = 0; i < sizeof(sigoid_srt) / sizeof(nid_triple); i++) {
|
||||
n1 = sigoid_srt[i][0];
|
||||
rv = OBJ_find_sigid_algs(n1, &n2, &n3);
|
||||
printf("Forward: %d, %s %s %s\n", rv,
|
||||
OBJ_nid2ln(n1), OBJ_nid2ln(n2), OBJ_nid2ln(n3));
|
||||
n1 = 0;
|
||||
rv = OBJ_find_sigid_by_algs(&n1, n2, n3);
|
||||
printf("Reverse: %d, %s %s %s\n", rv,
|
||||
OBJ_nid2ln(n1), OBJ_nid2ln(n2), OBJ_nid2ln(n3));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
99
openssl-1.0.2f/crypto/objects/obj_xref.h
Normal file
99
openssl-1.0.2f/crypto/objects/obj_xref.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/* AUTOGENERATED BY objxref.pl, DO NOT EDIT */
|
||||
|
||||
typedef struct {
|
||||
int sign_id;
|
||||
int hash_id;
|
||||
int pkey_id;
|
||||
} nid_triple;
|
||||
|
||||
static const nid_triple sigoid_srt[] = {
|
||||
{NID_md2WithRSAEncryption, NID_md2, NID_rsaEncryption},
|
||||
{NID_md5WithRSAEncryption, NID_md5, NID_rsaEncryption},
|
||||
{NID_shaWithRSAEncryption, NID_sha, NID_rsaEncryption},
|
||||
{NID_sha1WithRSAEncryption, NID_sha1, NID_rsaEncryption},
|
||||
{NID_dsaWithSHA, NID_sha, NID_dsa},
|
||||
{NID_dsaWithSHA1_2, NID_sha1, NID_dsa_2},
|
||||
{NID_mdc2WithRSA, NID_mdc2, NID_rsaEncryption},
|
||||
{NID_md5WithRSA, NID_md5, NID_rsa},
|
||||
{NID_dsaWithSHA1, NID_sha1, NID_dsa},
|
||||
{NID_sha1WithRSA, NID_sha1, NID_rsa},
|
||||
{NID_ripemd160WithRSA, NID_ripemd160, NID_rsaEncryption},
|
||||
{NID_md4WithRSAEncryption, NID_md4, NID_rsaEncryption},
|
||||
{NID_ecdsa_with_SHA1, NID_sha1, NID_X9_62_id_ecPublicKey},
|
||||
{NID_sha256WithRSAEncryption, NID_sha256, NID_rsaEncryption},
|
||||
{NID_sha384WithRSAEncryption, NID_sha384, NID_rsaEncryption},
|
||||
{NID_sha512WithRSAEncryption, NID_sha512, NID_rsaEncryption},
|
||||
{NID_sha224WithRSAEncryption, NID_sha224, NID_rsaEncryption},
|
||||
{NID_ecdsa_with_Recommended, NID_undef, NID_X9_62_id_ecPublicKey},
|
||||
{NID_ecdsa_with_Specified, NID_undef, NID_X9_62_id_ecPublicKey},
|
||||
{NID_ecdsa_with_SHA224, NID_sha224, NID_X9_62_id_ecPublicKey},
|
||||
{NID_ecdsa_with_SHA256, NID_sha256, NID_X9_62_id_ecPublicKey},
|
||||
{NID_ecdsa_with_SHA384, NID_sha384, NID_X9_62_id_ecPublicKey},
|
||||
{NID_ecdsa_with_SHA512, NID_sha512, NID_X9_62_id_ecPublicKey},
|
||||
{NID_dsa_with_SHA224, NID_sha224, NID_dsa},
|
||||
{NID_dsa_with_SHA256, NID_sha256, NID_dsa},
|
||||
{NID_id_GostR3411_94_with_GostR3410_2001, NID_id_GostR3411_94,
|
||||
NID_id_GostR3410_2001},
|
||||
{NID_id_GostR3411_94_with_GostR3410_94, NID_id_GostR3411_94,
|
||||
NID_id_GostR3410_94},
|
||||
{NID_id_GostR3411_94_with_GostR3410_94_cc, NID_id_GostR3411_94,
|
||||
NID_id_GostR3410_94_cc},
|
||||
{NID_id_GostR3411_94_with_GostR3410_2001_cc, NID_id_GostR3411_94,
|
||||
NID_id_GostR3410_2001_cc},
|
||||
{NID_rsassaPss, NID_undef, NID_rsaEncryption},
|
||||
{NID_dhSinglePass_stdDH_sha1kdf_scheme, NID_sha1, NID_dh_std_kdf},
|
||||
{NID_dhSinglePass_stdDH_sha224kdf_scheme, NID_sha224, NID_dh_std_kdf},
|
||||
{NID_dhSinglePass_stdDH_sha256kdf_scheme, NID_sha256, NID_dh_std_kdf},
|
||||
{NID_dhSinglePass_stdDH_sha384kdf_scheme, NID_sha384, NID_dh_std_kdf},
|
||||
{NID_dhSinglePass_stdDH_sha512kdf_scheme, NID_sha512, NID_dh_std_kdf},
|
||||
{NID_dhSinglePass_cofactorDH_sha1kdf_scheme, NID_sha1,
|
||||
NID_dh_cofactor_kdf},
|
||||
{NID_dhSinglePass_cofactorDH_sha224kdf_scheme, NID_sha224,
|
||||
NID_dh_cofactor_kdf},
|
||||
{NID_dhSinglePass_cofactorDH_sha256kdf_scheme, NID_sha256,
|
||||
NID_dh_cofactor_kdf},
|
||||
{NID_dhSinglePass_cofactorDH_sha384kdf_scheme, NID_sha384,
|
||||
NID_dh_cofactor_kdf},
|
||||
{NID_dhSinglePass_cofactorDH_sha512kdf_scheme, NID_sha512,
|
||||
NID_dh_cofactor_kdf},
|
||||
};
|
||||
|
||||
static const nid_triple *const sigoid_srt_xref[] = {
|
||||
&sigoid_srt[0],
|
||||
&sigoid_srt[1],
|
||||
&sigoid_srt[7],
|
||||
&sigoid_srt[2],
|
||||
&sigoid_srt[4],
|
||||
&sigoid_srt[3],
|
||||
&sigoid_srt[9],
|
||||
&sigoid_srt[5],
|
||||
&sigoid_srt[8],
|
||||
&sigoid_srt[12],
|
||||
&sigoid_srt[30],
|
||||
&sigoid_srt[35],
|
||||
&sigoid_srt[6],
|
||||
&sigoid_srt[10],
|
||||
&sigoid_srt[11],
|
||||
&sigoid_srt[13],
|
||||
&sigoid_srt[24],
|
||||
&sigoid_srt[20],
|
||||
&sigoid_srt[32],
|
||||
&sigoid_srt[37],
|
||||
&sigoid_srt[14],
|
||||
&sigoid_srt[21],
|
||||
&sigoid_srt[33],
|
||||
&sigoid_srt[38],
|
||||
&sigoid_srt[15],
|
||||
&sigoid_srt[22],
|
||||
&sigoid_srt[34],
|
||||
&sigoid_srt[39],
|
||||
&sigoid_srt[16],
|
||||
&sigoid_srt[23],
|
||||
&sigoid_srt[19],
|
||||
&sigoid_srt[31],
|
||||
&sigoid_srt[36],
|
||||
&sigoid_srt[25],
|
||||
&sigoid_srt[26],
|
||||
&sigoid_srt[27],
|
||||
&sigoid_srt[28],
|
||||
};
|
||||
BIN
openssl-1.0.2f/crypto/objects/obj_xref.o
Normal file
BIN
openssl-1.0.2f/crypto/objects/obj_xref.o
Normal file
Binary file not shown.
58
openssl-1.0.2f/crypto/objects/obj_xref.txt
Normal file
58
openssl-1.0.2f/crypto/objects/obj_xref.txt
Normal file
@@ -0,0 +1,58 @@
|
||||
# OID cross reference table.
|
||||
# Links signatures OIDs to their corresponding public key algorithms
|
||||
# and digests.
|
||||
|
||||
md2WithRSAEncryption md2 rsaEncryption
|
||||
md5WithRSAEncryption md5 rsaEncryption
|
||||
shaWithRSAEncryption sha rsaEncryption
|
||||
sha1WithRSAEncryption sha1 rsaEncryption
|
||||
md4WithRSAEncryption md4 rsaEncryption
|
||||
sha256WithRSAEncryption sha256 rsaEncryption
|
||||
sha384WithRSAEncryption sha384 rsaEncryption
|
||||
sha512WithRSAEncryption sha512 rsaEncryption
|
||||
sha224WithRSAEncryption sha224 rsaEncryption
|
||||
mdc2WithRSA mdc2 rsaEncryption
|
||||
ripemd160WithRSA ripemd160 rsaEncryption
|
||||
# For PSS the digest algorithm can vary and depends on the included
|
||||
# AlgorithmIdentifier. The digest "undef" indicates the public key
|
||||
# method should handle this explicitly.
|
||||
rsassaPss undef rsaEncryption
|
||||
|
||||
# Alternative deprecated OIDs. By using the older "rsa" OID this
|
||||
# type will be recognized by not normally used.
|
||||
|
||||
md5WithRSA md5 rsa
|
||||
sha1WithRSA sha1 rsa
|
||||
|
||||
dsaWithSHA sha dsa
|
||||
dsaWithSHA1 sha1 dsa
|
||||
|
||||
dsaWithSHA1_2 sha1 dsa_2
|
||||
|
||||
ecdsa_with_SHA1 sha1 X9_62_id_ecPublicKey
|
||||
ecdsa_with_SHA224 sha224 X9_62_id_ecPublicKey
|
||||
ecdsa_with_SHA256 sha256 X9_62_id_ecPublicKey
|
||||
ecdsa_with_SHA384 sha384 X9_62_id_ecPublicKey
|
||||
ecdsa_with_SHA512 sha512 X9_62_id_ecPublicKey
|
||||
ecdsa_with_Recommended undef X9_62_id_ecPublicKey
|
||||
ecdsa_with_Specified undef X9_62_id_ecPublicKey
|
||||
|
||||
dsa_with_SHA224 sha224 dsa
|
||||
dsa_with_SHA256 sha256 dsa
|
||||
|
||||
id_GostR3411_94_with_GostR3410_2001 id_GostR3411_94 id_GostR3410_2001
|
||||
id_GostR3411_94_with_GostR3410_94 id_GostR3411_94 id_GostR3410_94
|
||||
id_GostR3411_94_with_GostR3410_94_cc id_GostR3411_94 id_GostR3410_94_cc
|
||||
id_GostR3411_94_with_GostR3410_2001_cc id_GostR3411_94 id_GostR3410_2001_cc
|
||||
# ECDH KDFs and their corresponding message digests and schemes
|
||||
dhSinglePass_stdDH_sha1kdf_scheme sha1 dh_std_kdf
|
||||
dhSinglePass_stdDH_sha224kdf_scheme sha224 dh_std_kdf
|
||||
dhSinglePass_stdDH_sha256kdf_scheme sha256 dh_std_kdf
|
||||
dhSinglePass_stdDH_sha384kdf_scheme sha384 dh_std_kdf
|
||||
dhSinglePass_stdDH_sha512kdf_scheme sha512 dh_std_kdf
|
||||
|
||||
dhSinglePass_cofactorDH_sha1kdf_scheme sha1 dh_cofactor_kdf
|
||||
dhSinglePass_cofactorDH_sha224kdf_scheme sha224 dh_cofactor_kdf
|
||||
dhSinglePass_cofactorDH_sha256kdf_scheme sha256 dh_cofactor_kdf
|
||||
dhSinglePass_cofactorDH_sha384kdf_scheme sha384 dh_cofactor_kdf
|
||||
dhSinglePass_cofactorDH_sha512kdf_scheme sha512 dh_cofactor_kdf
|
||||
44
openssl-1.0.2f/crypto/objects/objects.README
Normal file
44
openssl-1.0.2f/crypto/objects/objects.README
Normal file
@@ -0,0 +1,44 @@
|
||||
objects.txt syntax
|
||||
------------------
|
||||
|
||||
To cover all the naming hacks that were previously in objects.h needed some
|
||||
kind of hacks in objects.txt.
|
||||
|
||||
The basic syntax for adding an object is as follows:
|
||||
|
||||
1 2 3 4 : shortName : Long Name
|
||||
|
||||
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.
|
||||
|
||||
Note that if the base name contains spaces, dashes or periods,
|
||||
those will be converte to underscore.
|
||||
|
||||
Then there are some extra commands:
|
||||
|
||||
!Alias foo 1 2 3 4
|
||||
|
||||
This just makes a name foo for an OID. The C macro
|
||||
OBJ_foo will be created as a result.
|
||||
|
||||
!Cname foo
|
||||
|
||||
This makes sure that the name foo will be used as base name
|
||||
in C.
|
||||
|
||||
!module foo
|
||||
1 2 3 4 : shortName : Long Name
|
||||
!global
|
||||
|
||||
The !module command was meant to define a kind of modularity.
|
||||
What it does is to make sure the module name is prepended
|
||||
to the base name. !global turns this off. This construction
|
||||
is not recursive.
|
||||
|
||||
Lines starting with # are treated as comments, as well as any line starting
|
||||
with ! and not matching the commands above.
|
||||
|
||||
1143
openssl-1.0.2f/crypto/objects/objects.h
Normal file
1143
openssl-1.0.2f/crypto/objects/objects.h
Normal file
File diff suppressed because it is too large
Load Diff
240
openssl-1.0.2f/crypto/objects/objects.pl
Normal file
240
openssl-1.0.2f/crypto/objects/objects.pl
Normal file
@@ -0,0 +1,240 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
open (NUMIN,"$ARGV[1]") || die "Can't open number file $ARGV[1]";
|
||||
$max_nid=0;
|
||||
$o=0;
|
||||
while(<NUMIN>)
|
||||
{
|
||||
chop;
|
||||
$o++;
|
||||
s/#.*$//;
|
||||
next if /^\s*$/;
|
||||
$_ = 'X'.$_;
|
||||
($Cname,$mynum) = split;
|
||||
$Cname =~ s/^X//;
|
||||
if (defined($nidn{$mynum}))
|
||||
{ die "$ARGV[1]:$o:There's already an object with NID ",$mynum," on line ",$order{$mynum},"\n"; }
|
||||
if (defined($nid{$Cname}))
|
||||
{ die "$ARGV[1]:$o:There's already an object with name ",$Cname," on line ",$order{$nid{$Cname}},"\n"; }
|
||||
$nid{$Cname} = $mynum;
|
||||
$nidn{$mynum} = $Cname;
|
||||
$order{$mynum} = $o;
|
||||
$max_nid = $mynum if $mynum > $max_nid;
|
||||
}
|
||||
close NUMIN;
|
||||
|
||||
open (IN,"$ARGV[0]") || die "Can't open input file $ARGV[0]";
|
||||
$Cname="";
|
||||
$o=0;
|
||||
while (<IN>)
|
||||
{
|
||||
chop;
|
||||
$o++;
|
||||
if (/^!module\s+(.*)$/)
|
||||
{
|
||||
$module = $1."-";
|
||||
$module =~ s/\./_/g;
|
||||
$module =~ s/-/_/g;
|
||||
}
|
||||
if (/^!global$/)
|
||||
{ $module = ""; }
|
||||
if (/^!Cname\s+(.*)$/)
|
||||
{ $Cname = $1; }
|
||||
if (/^!Alias\s+(.+?)\s+(.*)$/)
|
||||
{
|
||||
$Cname = $module.$1;
|
||||
$myoid = $2;
|
||||
$myoid = &process_oid($myoid);
|
||||
$Cname =~ s/-/_/g;
|
||||
$ordern{$o} = $Cname;
|
||||
$order{$Cname} = $o;
|
||||
$obj{$Cname} = $myoid;
|
||||
$_ = "";
|
||||
$Cname = "";
|
||||
}
|
||||
s/!.*$//;
|
||||
s/#.*$//;
|
||||
next if /^\s*$/;
|
||||
($myoid,$mysn,$myln) = split ':';
|
||||
$mysn =~ s/^\s*//;
|
||||
$mysn =~ s/\s*$//;
|
||||
$myln =~ s/^\s*//;
|
||||
$myln =~ s/\s*$//;
|
||||
$myoid =~ s/^\s*//;
|
||||
$myoid =~ s/\s*$//;
|
||||
if ($myoid ne "")
|
||||
{
|
||||
$myoid = &process_oid($myoid);
|
||||
}
|
||||
|
||||
if ($Cname eq "" && ($myln =~ /^[_A-Za-z][\w.-]*$/ ))
|
||||
{
|
||||
$Cname = $myln;
|
||||
$Cname =~ s/\./_/g;
|
||||
$Cname =~ s/-/_/g;
|
||||
if ($Cname ne "" && defined($ln{$module.$Cname}))
|
||||
{ die "objects.txt:$o:There's already an object with long name ",$ln{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; }
|
||||
}
|
||||
if ($Cname eq "")
|
||||
{
|
||||
$Cname = $mysn;
|
||||
$Cname =~ s/-/_/g;
|
||||
if ($Cname ne "" && defined($sn{$module.$Cname}))
|
||||
{ die "objects.txt:$o:There's already an object with short name ",$sn{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; }
|
||||
}
|
||||
if ($Cname eq "")
|
||||
{
|
||||
$Cname = $myln;
|
||||
$Cname =~ s/-/_/g;
|
||||
$Cname =~ s/\./_/g;
|
||||
$Cname =~ s/ /_/g;
|
||||
if ($Cname ne "" && defined($ln{$module.$Cname}))
|
||||
{ die "objects.txt:$o:There's already an object with long name ",$ln{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; }
|
||||
}
|
||||
$Cname =~ s/\./_/g;
|
||||
$Cname =~ s/-/_/g;
|
||||
$Cname = $module.$Cname;
|
||||
$ordern{$o} = $Cname;
|
||||
$order{$Cname} = $o;
|
||||
$sn{$Cname} = $mysn;
|
||||
$ln{$Cname} = $myln;
|
||||
$obj{$Cname} = $myoid;
|
||||
if (!defined($nid{$Cname}))
|
||||
{
|
||||
$max_nid++;
|
||||
$nid{$Cname} = $max_nid;
|
||||
$nidn{$max_nid} = $Cname;
|
||||
print STDERR "Added OID $Cname\n";
|
||||
}
|
||||
$Cname="";
|
||||
}
|
||||
close IN;
|
||||
|
||||
open (NUMOUT,">$ARGV[1]") || die "Can't open output file $ARGV[1]";
|
||||
foreach (sort { $a <=> $b } keys %nidn)
|
||||
{
|
||||
print NUMOUT $nidn{$_},"\t\t",$_,"\n";
|
||||
}
|
||||
close NUMOUT;
|
||||
|
||||
open (OUT,">$ARGV[2]") || die "Can't open output file $ARGV[2]";
|
||||
print OUT <<'EOF';
|
||||
/* crypto/objects/obj_mac.h */
|
||||
|
||||
/*
|
||||
* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the following
|
||||
* command: perl objects.pl objects.txt obj_mac.num obj_mac.h
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#define SN_undef "UNDEF"
|
||||
#define LN_undef "undefined"
|
||||
#define NID_undef 0
|
||||
#define OBJ_undef 0L
|
||||
EOF
|
||||
|
||||
sub expand
|
||||
{
|
||||
my $string = shift;
|
||||
|
||||
1 while $string =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
foreach (sort { $a <=> $b } keys %ordern)
|
||||
{
|
||||
$Cname=$ordern{$_};
|
||||
print OUT "\n";
|
||||
print OUT expand("#define SN_$Cname\t\t\"$sn{$Cname}\"\n") if $sn{$Cname} ne "";
|
||||
print OUT expand("#define LN_$Cname\t\t\"$ln{$Cname}\"\n") if $ln{$Cname} ne "";
|
||||
print OUT expand("#define NID_$Cname\t\t$nid{$Cname}\n") if $nid{$Cname} ne "";
|
||||
print OUT expand("#define OBJ_$Cname\t\t$obj{$Cname}\n") if $obj{$Cname} ne "";
|
||||
}
|
||||
|
||||
close OUT;
|
||||
|
||||
sub process_oid
|
||||
{
|
||||
local($oid)=@_;
|
||||
local(@a,$oid_pref);
|
||||
|
||||
@a = split(/\s+/,$myoid);
|
||||
$pref_oid = "";
|
||||
$pref_sep = "";
|
||||
if (!($a[0] =~ /^[0-9]+$/))
|
||||
{
|
||||
$a[0] =~ s/-/_/g;
|
||||
if (!defined($obj{$a[0]}))
|
||||
{ die "$ARGV[0]:$o:Undefined identifier ",$a[0],"\n"; }
|
||||
$pref_oid = "OBJ_" . $a[0];
|
||||
$pref_sep = ",";
|
||||
shift @a;
|
||||
}
|
||||
$oids = join('L,',@a) . "L";
|
||||
if ($oids ne "L")
|
||||
{
|
||||
$oids = $pref_oid . $pref_sep . $oids;
|
||||
}
|
||||
else
|
||||
{
|
||||
$oids = $pref_oid;
|
||||
}
|
||||
return($oids);
|
||||
}
|
||||
1350
openssl-1.0.2f/crypto/objects/objects.txt
Normal file
1350
openssl-1.0.2f/crypto/objects/objects.txt
Normal file
File diff suppressed because it is too large
Load Diff
116
openssl-1.0.2f/crypto/objects/objxref.pl
Normal file
116
openssl-1.0.2f/crypto/objects/objxref.pl
Normal file
@@ -0,0 +1,116 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
use strict;
|
||||
|
||||
my %xref_tbl;
|
||||
my %oid_tbl;
|
||||
|
||||
my ($mac_file, $xref_file) = @ARGV;
|
||||
|
||||
open(IN, $mac_file) || die "Can't open $mac_file";
|
||||
|
||||
# Read in OID nid values for a lookup table.
|
||||
|
||||
while (<IN>)
|
||||
{
|
||||
chomp;
|
||||
my ($name, $num) = /^(\S+)\s+(\S+)$/;
|
||||
$oid_tbl{$name} = $num;
|
||||
}
|
||||
close IN;
|
||||
|
||||
open(IN, $xref_file) || die "Can't open $xref_file";
|
||||
|
||||
my $ln = 1;
|
||||
|
||||
while (<IN>)
|
||||
{
|
||||
chomp;
|
||||
s/#.*$//;
|
||||
next if (/^\S*$/);
|
||||
my ($xr, $p1, $p2) = /^(\S+)\s+(\S+)\s+(\S+)/;
|
||||
check_oid($xr);
|
||||
check_oid($p1);
|
||||
check_oid($p2);
|
||||
$xref_tbl{$xr} = [$p1, $p2, $ln];
|
||||
}
|
||||
|
||||
my @xrkeys = keys %xref_tbl;
|
||||
|
||||
my @srt1 = sort { $oid_tbl{$a} <=> $oid_tbl{$b}} @xrkeys;
|
||||
|
||||
my $i;
|
||||
for($i = 0; $i <= $#srt1; $i++)
|
||||
{
|
||||
$xref_tbl{$srt1[$i]}[2] = $i;
|
||||
}
|
||||
|
||||
my @srt2 = sort
|
||||
{
|
||||
my$ap1 = $oid_tbl{$xref_tbl{$a}[0]};
|
||||
my$bp1 = $oid_tbl{$xref_tbl{$b}[0]};
|
||||
return $ap1 - $bp1 if ($ap1 != $bp1);
|
||||
my$ap2 = $oid_tbl{$xref_tbl{$a}[1]};
|
||||
my$bp2 = $oid_tbl{$xref_tbl{$b}[1]};
|
||||
|
||||
return $ap2 - $bp2;
|
||||
} @xrkeys;
|
||||
|
||||
my $pname = $0;
|
||||
|
||||
$pname =~ s|^.[^/]/||;
|
||||
|
||||
print <<EOF;
|
||||
/* AUTOGENERATED BY $pname, DO NOT EDIT */
|
||||
|
||||
typedef struct {
|
||||
int sign_id;
|
||||
int hash_id;
|
||||
int pkey_id;
|
||||
} nid_triple;
|
||||
|
||||
static const nid_triple sigoid_srt[] = {
|
||||
EOF
|
||||
|
||||
foreach (@srt1)
|
||||
{
|
||||
my $xr = $_;
|
||||
my ($p1, $p2) = @{$xref_tbl{$_}};
|
||||
my $o1 = " {NID_$xr, NID_$p1,";
|
||||
my $o2 = "NID_$p2},";
|
||||
if (length("$o1 $o2") < 78)
|
||||
{
|
||||
print "$o1 $o2\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "$o1\n $o2\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "};";
|
||||
print <<EOF;
|
||||
|
||||
|
||||
static const nid_triple *const sigoid_srt_xref[] = {
|
||||
EOF
|
||||
|
||||
foreach (@srt2)
|
||||
{
|
||||
my ($p1, $p2, $x) = @{$xref_tbl{$_}};
|
||||
# If digest or signature algorithm is "undef" then the algorithm
|
||||
# needs special handling and is excluded from the cross reference table.
|
||||
next if $p1 eq "undef" || $p2 eq "undef";
|
||||
print " \&sigoid_srt\[$x\],\n";
|
||||
}
|
||||
|
||||
print "};\n";
|
||||
|
||||
sub check_oid
|
||||
{
|
||||
my ($chk) = @_;
|
||||
if (!exists $oid_tbl{$chk})
|
||||
{
|
||||
die "Not Found \"$chk\"\n";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user