summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/objects
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/objects')
-rw-r--r--src/lib/libcrypto/objects/o_names.c6
-rw-r--r--src/lib/libcrypto/objects/obj_dat.c254
-rw-r--r--src/lib/libcrypto/objects/obj_dat.pl4
-rw-r--r--src/lib/libcrypto/objects/obj_err.c9
-rw-r--r--src/lib/libcrypto/objects/obj_lib.c3
-rw-r--r--src/lib/libcrypto/objects/obj_mac.num115
-rw-r--r--src/lib/libcrypto/objects/objects.h7
-rw-r--r--src/lib/libcrypto/objects/objects.txt185
8 files changed, 493 insertions, 90 deletions
diff --git a/src/lib/libcrypto/objects/o_names.c b/src/lib/libcrypto/objects/o_names.c
index 28c9370ca3..adb5731f76 100644
--- a/src/lib/libcrypto/objects/o_names.c
+++ b/src/lib/libcrypto/objects/o_names.c
@@ -111,8 +111,8 @@ int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),
111static int obj_name_cmp(const void *a_void, const void *b_void) 111static int obj_name_cmp(const void *a_void, const void *b_void)
112 { 112 {
113 int ret; 113 int ret;
114 OBJ_NAME *a = (OBJ_NAME *)a_void; 114 const OBJ_NAME *a = (const OBJ_NAME *)a_void;
115 OBJ_NAME *b = (OBJ_NAME *)b_void; 115 const OBJ_NAME *b = (const OBJ_NAME *)b_void;
116 116
117 ret=a->type-b->type; 117 ret=a->type-b->type;
118 if (ret == 0) 118 if (ret == 0)
@@ -133,7 +133,7 @@ static int obj_name_cmp(const void *a_void, const void *b_void)
133static unsigned long obj_name_hash(const void *a_void) 133static unsigned long obj_name_hash(const void *a_void)
134 { 134 {
135 unsigned long ret; 135 unsigned long ret;
136 OBJ_NAME *a = (OBJ_NAME *)a_void; 136 const OBJ_NAME *a = (const OBJ_NAME *)a_void;
137 137
138 if ((name_funcs_stack != NULL) && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) 138 if ((name_funcs_stack != NULL) && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type))
139 { 139 {
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c
index f549d078ef..7fd7433241 100644
--- a/src/lib/libcrypto/objects/obj_dat.c
+++ b/src/lib/libcrypto/objects/obj_dat.c
@@ -58,10 +58,12 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <ctype.h> 60#include <ctype.h>
61#include <limits.h>
61#include "cryptlib.h" 62#include "cryptlib.h"
62#include <openssl/lhash.h> 63#include <openssl/lhash.h>
63#include <openssl/asn1.h> 64#include <openssl/asn1.h>
64#include <openssl/objects.h> 65#include <openssl/objects.h>
66#include <openssl/bn.h>
65 67
66/* obj_dat.h is generated from objects.h by obj_dat.pl */ 68/* obj_dat.h is generated from objects.h by obj_dat.pl */
67#ifndef OPENSSL_NO_OBJECT 69#ifndef OPENSSL_NO_OBJECT
@@ -115,7 +117,7 @@ static unsigned long add_hash(const void *ca_void)
115 int i; 117 int i;
116 unsigned long ret=0; 118 unsigned long ret=0;
117 unsigned char *p; 119 unsigned char *p;
118 ADDED_OBJ *ca = (ADDED_OBJ *)ca_void; 120 const ADDED_OBJ *ca = (const ADDED_OBJ *)ca_void;
119 121
120 a=ca->obj; 122 a=ca->obj;
121 switch (ca->type) 123 switch (ca->type)
@@ -149,8 +151,8 @@ static int add_cmp(const void *ca_void, const void *cb_void)
149 { 151 {
150 ASN1_OBJECT *a,*b; 152 ASN1_OBJECT *a,*b;
151 int i; 153 int i;
152 ADDED_OBJ *ca = (ADDED_OBJ *)ca_void; 154 const ADDED_OBJ *ca = (const ADDED_OBJ *)ca_void;
153 ADDED_OBJ *cb = (ADDED_OBJ *)cb_void; 155 const ADDED_OBJ *cb = (const ADDED_OBJ *)cb_void;
154 156
155 i=ca->type-cb->type; 157 i=ca->type-cb->type;
156 if (i) return(i); 158 if (i) return(i);
@@ -161,7 +163,7 @@ static int add_cmp(const void *ca_void, const void *cb_void)
161 case ADDED_DATA: 163 case ADDED_DATA:
162 i=(a->length - b->length); 164 i=(a->length - b->length);
163 if (i) return(i); 165 if (i) return(i);
164 return(memcmp(a->data,b->data,a->length)); 166 return(memcmp(a->data,b->data,(size_t)a->length));
165 case ADDED_SNAME: 167 case ADDED_SNAME:
166 if (a->sn == NULL) return(-1); 168 if (a->sn == NULL) return(-1);
167 else if (b->sn == NULL) return(1); 169 else if (b->sn == NULL) return(1);
@@ -382,8 +384,8 @@ int OBJ_obj2nid(const ASN1_OBJECT *a)
382 adp=(ADDED_OBJ *)lh_retrieve(added,&ad); 384 adp=(ADDED_OBJ *)lh_retrieve(added,&ad);
383 if (adp != NULL) return (adp->obj->nid); 385 if (adp != NULL) return (adp->obj->nid);
384 } 386 }
385 op=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ, 387 op=(ASN1_OBJECT **)OBJ_bsearch((const char *)&a,(const char *)obj_objs,
386 sizeof(ASN1_OBJECT *),obj_cmp); 388 NUM_OBJ, sizeof(ASN1_OBJECT *),obj_cmp);
387 if (op == NULL) 389 if (op == NULL)
388 return(NID_undef); 390 return(NID_undef);
389 return((*op)->nid); 391 return((*op)->nid);
@@ -399,7 +401,9 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
399 { 401 {
400 int nid = NID_undef; 402 int nid = NID_undef;
401 ASN1_OBJECT *op=NULL; 403 ASN1_OBJECT *op=NULL;
402 unsigned char *buf,*p; 404 unsigned char *buf;
405 unsigned char *p;
406 const unsigned char *cp;
403 int i, j; 407 int i, j;
404 408
405 if(!no_name) { 409 if(!no_name) {
@@ -411,8 +415,8 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
411 /* Work out size of content octets */ 415 /* Work out size of content octets */
412 i=a2d_ASN1_OBJECT(NULL,0,s,-1); 416 i=a2d_ASN1_OBJECT(NULL,0,s,-1);
413 if (i <= 0) { 417 if (i <= 0) {
414 /* Clear the error */ 418 /* Don't clear the error */
415 ERR_get_error(); 419 /*ERR_clear_error();*/
416 return NULL; 420 return NULL;
417 } 421 }
418 /* Work out total size */ 422 /* Work out total size */
@@ -425,75 +429,170 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
425 ASN1_put_object(&p,0,i,V_ASN1_OBJECT,V_ASN1_UNIVERSAL); 429 ASN1_put_object(&p,0,i,V_ASN1_OBJECT,V_ASN1_UNIVERSAL);
426 /* Write out contents */ 430 /* Write out contents */
427 a2d_ASN1_OBJECT(p,i,s,-1); 431 a2d_ASN1_OBJECT(p,i,s,-1);
428 432
429 p=buf; 433 cp=buf;
430 op=d2i_ASN1_OBJECT(NULL,&p,j); 434 op=d2i_ASN1_OBJECT(NULL,&cp,j);
431 OPENSSL_free(buf); 435 OPENSSL_free(buf);
432 return op; 436 return op;
433 } 437 }
434 438
435int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name) 439int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
436{ 440{
437 int i,idx=0,n=0,len,nid; 441 int i,n=0,len,nid, first, use_bn;
442 BIGNUM *bl;
438 unsigned long l; 443 unsigned long l;
439 unsigned char *p; 444 unsigned char *p;
440 const char *s;
441 char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2]; 445 char tbuf[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
442 446
443 if (buf_len <= 0) return(0);
444
445 if ((a == NULL) || (a->data == NULL)) { 447 if ((a == NULL) || (a->data == NULL)) {
446 buf[0]='\0'; 448 buf[0]='\0';
447 return(0); 449 return(0);
448 } 450 }
449 451
450 if (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {
451 len=a->length;
452 p=a->data;
453 452
454 idx=0; 453 if (!no_name && (nid=OBJ_obj2nid(a)) != NID_undef)
455 l=0; 454 {
456 while (idx < a->length) { 455 const char *s;
457 l|=(p[idx]&0x7f); 456 s=OBJ_nid2ln(nid);
458 if (!(p[idx] & 0x80)) break; 457 if (s == NULL)
459 l<<=7L; 458 s=OBJ_nid2sn(nid);
460 idx++; 459 if (buf)
460 BUF_strlcpy(buf,s,buf_len);
461 n=strlen(s);
462 return n;
461 } 463 }
462 idx++;
463 i=(int)(l/40);
464 if (i > 2) i=2;
465 l-=(long)(i*40);
466
467 BIO_snprintf(tbuf,sizeof tbuf,"%d.%lu",i,l);
468 i=strlen(tbuf);
469 BUF_strlcpy(buf,tbuf,buf_len);
470 buf_len-=i;
471 buf+=i;
472 n+=i;
473 464
465
466 len=a->length;
467 p=a->data;
468
469 first = 1;
470 bl = NULL;
471
472 while (len > 0)
473 {
474 l=0; 474 l=0;
475 for (; idx<len; idx++) { 475 use_bn = 0;
476 l|=p[idx]&0x7f; 476 for (;;)
477 if (!(p[idx] & 0x80)) { 477 {
478 BIO_snprintf(tbuf,sizeof tbuf,".%lu",l); 478 unsigned char c = *p++;
479 i=strlen(tbuf); 479 len--;
480 if ((len == 0) && (c & 0x80))
481 goto err;
482 if (use_bn)
483 {
484 if (!BN_add_word(bl, c & 0x7f))
485 goto err;
486 }
487 else
488 l |= c & 0x7f;
489 if (!(c & 0x80))
490 break;
491 if (!use_bn && (l > (ULONG_MAX >> 7L)))
492 {
493 if (!bl && !(bl = BN_new()))
494 goto err;
495 if (!BN_set_word(bl, l))
496 goto err;
497 use_bn = 1;
498 }
499 if (use_bn)
500 {
501 if (!BN_lshift(bl, bl, 7))
502 goto err;
503 }
504 else
505 l<<=7L;
506 }
507
508 if (first)
509 {
510 first = 0;
511 if (l >= 80)
512 {
513 i = 2;
514 if (use_bn)
515 {
516 if (!BN_sub_word(bl, 80))
517 goto err;
518 }
519 else
520 l -= 80;
521 }
522 else
523 {
524 i=(int)(l/40);
525 l-=(long)(i*40);
526 }
527 if (buf && (buf_len > 0))
528 {
529 *buf++ = i + '0';
530 buf_len--;
531 }
532 n++;
533 }
534
535 if (use_bn)
536 {
537 char *bndec;
538 bndec = BN_bn2dec(bl);
539 if (!bndec)
540 goto err;
541 i = strlen(bndec);
542 if (buf)
543 {
480 if (buf_len > 0) 544 if (buf_len > 0)
481 BUF_strlcpy(buf,tbuf,buf_len); 545 {
482 buf_len-=i; 546 *buf++ = '.';
483 buf+=i; 547 buf_len--;
484 n+=i; 548 }
485 l=0; 549 BUF_strlcpy(buf,bndec,buf_len);
550 if (i > buf_len)
551 {
552 buf += buf_len;
553 buf_len = 0;
554 }
555 else
556 {
557 buf+=i;
558 buf_len-=i;
559 }
560 }
561 n++;
562 n += i;
563 OPENSSL_free(bndec);
564 }
565 else
566 {
567 BIO_snprintf(tbuf,sizeof tbuf,".%lu",l);
568 i=strlen(tbuf);
569 if (buf && (buf_len > 0))
570 {
571 BUF_strlcpy(buf,tbuf,buf_len);
572 if (i > buf_len)
573 {
574 buf += buf_len;
575 buf_len = 0;
576 }
577 else
578 {
579 buf+=i;
580 buf_len-=i;
581 }
582 }
583 n+=i;
584 l=0;
486 } 585 }
487 l<<=7L;
488 } 586 }
489 } else { 587
490 s=OBJ_nid2ln(nid); 588 if (bl)
491 if (s == NULL) 589 BN_free(bl);
492 s=OBJ_nid2sn(nid); 590 return n;
493 BUF_strlcpy(buf,s,buf_len); 591
494 n=strlen(s); 592 err:
495 } 593 if (bl)
496 return(n); 594 BN_free(bl);
595 return -1;
497} 596}
498 597
499int OBJ_txt2nid(const char *s) 598int OBJ_txt2nid(const char *s)
@@ -519,7 +618,7 @@ int OBJ_ln2nid(const char *s)
519 adp=(ADDED_OBJ *)lh_retrieve(added,&ad); 618 adp=(ADDED_OBJ *)lh_retrieve(added,&ad);
520 if (adp != NULL) return (adp->obj->nid); 619 if (adp != NULL) return (adp->obj->nid);
521 } 620 }
522 op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)ln_objs,NUM_LN, 621 op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)ln_objs, NUM_LN,
523 sizeof(ASN1_OBJECT *),ln_cmp); 622 sizeof(ASN1_OBJECT *),ln_cmp);
524 if (op == NULL) return(NID_undef); 623 if (op == NULL) return(NID_undef);
525 return((*op)->nid); 624 return((*op)->nid);
@@ -547,8 +646,8 @@ int OBJ_sn2nid(const char *s)
547static int obj_cmp(const void *ap, const void *bp) 646static int obj_cmp(const void *ap, const void *bp)
548 { 647 {
549 int j; 648 int j;
550 ASN1_OBJECT *a= *(ASN1_OBJECT **)ap; 649 const ASN1_OBJECT *a= *(ASN1_OBJECT * const *)ap;
551 ASN1_OBJECT *b= *(ASN1_OBJECT **)bp; 650 const ASN1_OBJECT *b= *(ASN1_OBJECT * const *)bp;
552 651
553 j=(a->length - b->length); 652 j=(a->length - b->length);
554 if (j) return(j); 653 if (j) return(j);
@@ -558,8 +657,14 @@ static int obj_cmp(const void *ap, const void *bp)
558const char *OBJ_bsearch(const char *key, const char *base, int num, int size, 657const char *OBJ_bsearch(const char *key, const char *base, int num, int size,
559 int (*cmp)(const void *, const void *)) 658 int (*cmp)(const void *, const void *))
560 { 659 {
561 int l,h,i,c; 660 return OBJ_bsearch_ex(key, base, num, size, cmp, 0);
562 const char *p; 661 }
662
663const char *OBJ_bsearch_ex(const char *key, const char *base, int num,
664 int size, int (*cmp)(const void *, const void *), int flags)
665 {
666 int l,h,i=0,c=0;
667 const char *p = NULL;
563 668
564 if (num == 0) return(NULL); 669 if (num == 0) return(NULL);
565 l=0; 670 l=0;
@@ -574,20 +679,33 @@ const char *OBJ_bsearch(const char *key, const char *base, int num, int size,
574 else if (c > 0) 679 else if (c > 0)
575 l=i+1; 680 l=i+1;
576 else 681 else
577 return(p); 682 break;
578 } 683 }
579#ifdef CHARSET_EBCDIC 684#ifdef CHARSET_EBCDIC
580/* THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and 685/* THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and
581 * I don't have perl (yet), we revert to a *LINEAR* search 686 * I don't have perl (yet), we revert to a *LINEAR* search
582 * when the object wasn't found in the binary search. 687 * when the object wasn't found in the binary search.
583 */ 688 */
584 for (i=0; i<num; ++i) { 689 if (c != 0)
585 p= &(base[i*size]); 690 {
586 if ((*cmp)(key,p) == 0) 691 for (i=0; i<num; ++i)
587 return p; 692 {
588 } 693 p= &(base[i*size]);
694 c = (*cmp)(key,p);
695 if (c == 0 || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH)))
696 return p;
697 }
698 }
589#endif 699#endif
590 return(NULL); 700 if (c != 0 && !(flags & OBJ_BSEARCH_VALUE_ON_NOMATCH))
701 p = NULL;
702 else if (c == 0 && (flags & OBJ_BSEARCH_FIRST_VALUE_ON_MATCH))
703 {
704 while(i > 0 && (*cmp)(key,&(base[(i-1)*size])) == 0)
705 i--;
706 p = &(base[i*size]);
707 }
708 return(p);
591 } 709 }
592 710
593int OBJ_create_objects(BIO *in) 711int OBJ_create_objects(BIO *in)
diff --git a/src/lib/libcrypto/objects/obj_dat.pl b/src/lib/libcrypto/objects/obj_dat.pl
index d0371661f9..8a09a46ee6 100644
--- a/src/lib/libcrypto/objects/obj_dat.pl
+++ b/src/lib/libcrypto/objects/obj_dat.pl
@@ -94,7 +94,7 @@ for ($i=0; $i<$n; $i++)
94 { 94 {
95 if (!defined($nid{$i})) 95 if (!defined($nid{$i}))
96 { 96 {
97 push(@out,"{NULL,NULL,NID_undef,0,NULL},\n"); 97 push(@out,"{NULL,NULL,NID_undef,0,NULL,0},\n");
98 } 98 }
99 else 99 else
100 { 100 {
@@ -138,7 +138,7 @@ for ($i=0; $i<$n; $i++)
138 } 138 }
139 else 139 else
140 { 140 {
141 $out.="0,NULL"; 141 $out.="0,NULL,0";
142 } 142 }
143 $out.="},\n"; 143 $out.="},\n";
144 push(@out,$out); 144 push(@out,$out);
diff --git a/src/lib/libcrypto/objects/obj_err.c b/src/lib/libcrypto/objects/obj_err.c
index 0682979b38..12b48850c6 100644
--- a/src/lib/libcrypto/objects/obj_err.c
+++ b/src/lib/libcrypto/objects/obj_err.c
@@ -91,15 +91,12 @@ static ERR_STRING_DATA OBJ_str_reasons[]=
91 91
92void ERR_load_OBJ_strings(void) 92void ERR_load_OBJ_strings(void)
93 { 93 {
94 static int init=1; 94#ifndef OPENSSL_NO_ERR
95 95
96 if (init) 96 if (ERR_func_error_string(OBJ_str_functs[0].error) == NULL)
97 { 97 {
98 init=0;
99#ifndef OPENSSL_NO_ERR
100 ERR_load_strings(0,OBJ_str_functs); 98 ERR_load_strings(0,OBJ_str_functs);
101 ERR_load_strings(0,OBJ_str_reasons); 99 ERR_load_strings(0,OBJ_str_reasons);
102#endif
103
104 } 100 }
101#endif
105 } 102 }
diff --git a/src/lib/libcrypto/objects/obj_lib.c b/src/lib/libcrypto/objects/obj_lib.c
index b0b0f2ff24..706fa0b0e7 100644
--- a/src/lib/libcrypto/objects/obj_lib.c
+++ b/src/lib/libcrypto/objects/obj_lib.c
@@ -82,7 +82,8 @@ ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o)
82 r->data=OPENSSL_malloc(o->length); 82 r->data=OPENSSL_malloc(o->length);
83 if (r->data == NULL) 83 if (r->data == NULL)
84 goto err; 84 goto err;
85 memcpy(r->data,o->data,o->length); 85 if (o->data != NULL)
86 memcpy(r->data,o->data,o->length);
86 r->length=o->length; 87 r->length=o->length;
87 r->nid=o->nid; 88 r->nid=o->nid;
88 r->ln=r->sn=NULL; 89 r->ln=r->sn=NULL;
diff --git a/src/lib/libcrypto/objects/obj_mac.num b/src/lib/libcrypto/objects/obj_mac.num
index 84555d936e..47815b1e4e 100644
--- a/src/lib/libcrypto/objects/obj_mac.num
+++ b/src/lib/libcrypto/objects/obj_mac.num
@@ -673,3 +673,118 @@ sha256 672
673sha384 673 673sha384 673
674sha512 674 674sha512 674
675sha224 675 675sha224 675
676identified_organization 676
677certicom_arc 677
678wap 678
679wap_wsg 679
680X9_62_id_characteristic_two_basis 680
681X9_62_onBasis 681
682X9_62_tpBasis 682
683X9_62_ppBasis 683
684X9_62_c2pnb163v1 684
685X9_62_c2pnb163v2 685
686X9_62_c2pnb163v3 686
687X9_62_c2pnb176v1 687
688X9_62_c2tnb191v1 688
689X9_62_c2tnb191v2 689
690X9_62_c2tnb191v3 690
691X9_62_c2onb191v4 691
692X9_62_c2onb191v5 692
693X9_62_c2pnb208w1 693
694X9_62_c2tnb239v1 694
695X9_62_c2tnb239v2 695
696X9_62_c2tnb239v3 696
697X9_62_c2onb239v4 697
698X9_62_c2onb239v5 698
699X9_62_c2pnb272w1 699
700X9_62_c2pnb304w1 700
701X9_62_c2tnb359v1 701
702X9_62_c2pnb368w1 702
703X9_62_c2tnb431r1 703
704secp112r1 704
705secp112r2 705
706secp128r1 706
707secp128r2 707
708secp160k1 708
709secp160r1 709
710secp160r2 710
711secp192k1 711
712secp224k1 712
713secp224r1 713
714secp256k1 714
715secp384r1 715
716secp521r1 716
717sect113r1 717
718sect113r2 718
719sect131r1 719
720sect131r2 720
721sect163k1 721
722sect163r1 722
723sect163r2 723
724sect193r1 724
725sect193r2 725
726sect233k1 726
727sect233r1 727
728sect239k1 728
729sect283k1 729
730sect283r1 730
731sect409k1 731
732sect409r1 732
733sect571k1 733
734sect571r1 734
735wap_wsg_idm_ecid_wtls1 735
736wap_wsg_idm_ecid_wtls3 736
737wap_wsg_idm_ecid_wtls4 737
738wap_wsg_idm_ecid_wtls5 738
739wap_wsg_idm_ecid_wtls6 739
740wap_wsg_idm_ecid_wtls7 740
741wap_wsg_idm_ecid_wtls8 741
742wap_wsg_idm_ecid_wtls9 742
743wap_wsg_idm_ecid_wtls10 743
744wap_wsg_idm_ecid_wtls11 744
745wap_wsg_idm_ecid_wtls12 745
746any_policy 746
747policy_mappings 747
748inhibit_any_policy 748
749ipsec3 749
750ipsec4 750
751camellia_128_cbc 751
752camellia_192_cbc 752
753camellia_256_cbc 753
754camellia_128_ecb 754
755camellia_192_ecb 755
756camellia_256_ecb 756
757camellia_128_cfb128 757
758camellia_192_cfb128 758
759camellia_256_cfb128 759
760camellia_128_cfb1 760
761camellia_192_cfb1 761
762camellia_256_cfb1 762
763camellia_128_cfb8 763
764camellia_192_cfb8 764
765camellia_256_cfb8 765
766camellia_128_ofb128 766
767camellia_192_ofb128 767
768camellia_256_ofb128 768
769subject_directory_attributes 769
770issuing_distribution_point 770
771certificate_issuer 771
772korea 772
773kisa 773
774kftc 774
775npki_alg 775
776seed_ecb 776
777seed_cbc 777
778seed_ofb128 778
779seed_cfb128 779
780hmac_md5 780
781hmac_sha1 781
782id_PasswordBasedMAC 782
783id_DHBasedMac 783
784id_it_suppLangTags 784
785caRepository 785
786id_smime_ct_compressedData 786
787id_ct_asciiTextWithCRLF 787
788id_aes128_wrap 788
789id_aes192_wrap 789
790id_aes256_wrap 790
diff --git a/src/lib/libcrypto/objects/objects.h b/src/lib/libcrypto/objects/objects.h
index f859d859b8..7242f76fb0 100644
--- a/src/lib/libcrypto/objects/objects.h
+++ b/src/lib/libcrypto/objects/objects.h
@@ -966,7 +966,10 @@
966#define OBJ_NAME_TYPE_COMP_METH 0x04 966#define OBJ_NAME_TYPE_COMP_METH 0x04
967#define OBJ_NAME_TYPE_NUM 0x05 967#define OBJ_NAME_TYPE_NUM 0x05
968 968
969#define OBJ_NAME_ALIAS 0x8000 969#define OBJ_NAME_ALIAS 0x8000
970
971#define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01
972#define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02
970 973
971 974
972#ifdef __cplusplus 975#ifdef __cplusplus
@@ -1010,6 +1013,8 @@ int OBJ_sn2nid(const char *s);
1010int OBJ_cmp(const ASN1_OBJECT *a,const ASN1_OBJECT *b); 1013int OBJ_cmp(const ASN1_OBJECT *a,const ASN1_OBJECT *b);
1011const char * OBJ_bsearch(const char *key,const char *base,int num,int size, 1014const char * OBJ_bsearch(const char *key,const char *base,int num,int size,
1012 int (*cmp)(const void *, const void *)); 1015 int (*cmp)(const void *, const void *));
1016const char * OBJ_bsearch_ex(const char *key,const char *base,int num,
1017 int size, int (*cmp)(const void *, const void *), int flags);
1013 1018
1014int OBJ_new_nid(int num); 1019int OBJ_new_nid(int num);
1015int OBJ_add_object(const ASN1_OBJECT *obj); 1020int OBJ_add_object(const ASN1_OBJECT *obj);
diff --git a/src/lib/libcrypto/objects/objects.txt b/src/lib/libcrypto/objects/objects.txt
index 2635c4e667..34c8d1d647 100644
--- a/src/lib/libcrypto/objects/objects.txt
+++ b/src/lib/libcrypto/objects/objects.txt
@@ -1,12 +1,28 @@
10 : CCITT : ccitt 1# CCITT was renamed to ITU-T quite some time ago
20 : ITU-T : itu-t
3!Alias ccitt itu-t
2 4
31 : ISO : iso 51 : ISO : iso
4 6
52 : JOINT-ISO-CCITT : joint-iso-ccitt 72 : JOINT-ISO-ITU-T : joint-iso-itu-t
8!Alias joint-iso-ccitt joint-iso-itu-t
6 9
7iso 2 : member-body : ISO Member Body 10iso 2 : member-body : ISO Member Body
8 11
9joint-iso-ccitt 5 1 5 : selected-attribute-types : Selected Attribute Types 12iso 3 : identified-organization
13
14# HMAC OIDs
15identified-organization 6 1 5 5 8 1 1 : HMAC-MD5 : hmac-md5
16identified-organization 6 1 5 5 8 1 2 : HMAC-SHA1 : hmac-sha1
17
18identified-organization 132 : certicom-arc
19
20joint-iso-itu-t 23 : international-organizations : International Organizations
21
22international-organizations 43 : wap
23wap 13 : wap-wsg
24
25joint-iso-itu-t 5 1 5 : selected-attribute-types : Selected Attribute Types
10 26
11selected-attribute-types 55 : clearance 27selected-attribute-types 55 : clearance
12 28
@@ -24,12 +40,34 @@ ISO-US 10045 : ansi-X9-62 : ANSI X9.62
24!Alias id-fieldType ansi-X9-62 1 40!Alias id-fieldType ansi-X9-62 1
25X9-62_id-fieldType 1 : prime-field 41X9-62_id-fieldType 1 : prime-field
26X9-62_id-fieldType 2 : characteristic-two-field 42X9-62_id-fieldType 2 : characteristic-two-field
27# ... characteristic-two-field OID subtree 43X9-62_characteristic-two-field 3 : id-characteristic-two-basis
44X9-62_id-characteristic-two-basis 1 : onBasis
45X9-62_id-characteristic-two-basis 2 : tpBasis
46X9-62_id-characteristic-two-basis 3 : ppBasis
28!Alias id-publicKeyType ansi-X9-62 2 47!Alias id-publicKeyType ansi-X9-62 2
29X9-62_id-publicKeyType 1 : id-ecPublicKey 48X9-62_id-publicKeyType 1 : id-ecPublicKey
30!Alias ellipticCurve ansi-X9-62 3 49!Alias ellipticCurve ansi-X9-62 3
31!Alias c-TwoCurve X9-62_ellipticCurve 0 50!Alias c-TwoCurve X9-62_ellipticCurve 0
32# ... characteristic 2 curve OIDs 51X9-62_c-TwoCurve 1 : c2pnb163v1
52X9-62_c-TwoCurve 2 : c2pnb163v2
53X9-62_c-TwoCurve 3 : c2pnb163v3
54X9-62_c-TwoCurve 4 : c2pnb176v1
55X9-62_c-TwoCurve 5 : c2tnb191v1
56X9-62_c-TwoCurve 6 : c2tnb191v2
57X9-62_c-TwoCurve 7 : c2tnb191v3
58X9-62_c-TwoCurve 8 : c2onb191v4
59X9-62_c-TwoCurve 9 : c2onb191v5
60X9-62_c-TwoCurve 10 : c2pnb208w1
61X9-62_c-TwoCurve 11 : c2tnb239v1
62X9-62_c-TwoCurve 12 : c2tnb239v2
63X9-62_c-TwoCurve 13 : c2tnb239v3
64X9-62_c-TwoCurve 14 : c2onb239v4
65X9-62_c-TwoCurve 15 : c2onb239v5
66X9-62_c-TwoCurve 16 : c2pnb272w1
67X9-62_c-TwoCurve 17 : c2pnb304w1
68X9-62_c-TwoCurve 18 : c2tnb359v1
69X9-62_c-TwoCurve 19 : c2pnb368w1
70X9-62_c-TwoCurve 20 : c2tnb431r1
33!Alias primeCurve X9-62_ellipticCurve 1 71!Alias primeCurve X9-62_ellipticCurve 1
34X9-62_primeCurve 1 : prime192v1 72X9-62_primeCurve 1 : prime192v1
35X9-62_primeCurve 2 : prime192v2 73X9-62_primeCurve 2 : prime192v2
@@ -42,6 +80,60 @@ X9-62_primeCurve 7 : prime256v1
42!global 80!global
43X9-62_id-ecSigType 1 : ecdsa-with-SHA1 81X9-62_id-ecSigType 1 : ecdsa-with-SHA1
44 82
83# SECG curve OIDs from "SEC 2: Recommended Elliptic Curve Domain Parameters"
84# (http://www.secg.org/)
85!Alias secg_ellipticCurve certicom-arc 0
86# SECG prime curves OIDs
87secg-ellipticCurve 6 : secp112r1
88secg-ellipticCurve 7 : secp112r2
89secg-ellipticCurve 28 : secp128r1
90secg-ellipticCurve 29 : secp128r2
91secg-ellipticCurve 9 : secp160k1
92secg-ellipticCurve 8 : secp160r1
93secg-ellipticCurve 30 : secp160r2
94secg-ellipticCurve 31 : secp192k1
95# NOTE: the curve secp192r1 is the same as prime192v1 defined above
96# and is therefore omitted
97secg-ellipticCurve 32 : secp224k1
98secg-ellipticCurve 33 : secp224r1
99secg-ellipticCurve 10 : secp256k1
100# NOTE: the curve secp256r1 is the same as prime256v1 defined above
101# and is therefore omitted
102secg-ellipticCurve 34 : secp384r1
103secg-ellipticCurve 35 : secp521r1
104# SECG characteristic two curves OIDs
105secg-ellipticCurve 4 : sect113r1
106secg-ellipticCurve 5 : sect113r2
107secg-ellipticCurve 22 : sect131r1
108secg-ellipticCurve 23 : sect131r2
109secg-ellipticCurve 1 : sect163k1
110secg-ellipticCurve 2 : sect163r1
111secg-ellipticCurve 15 : sect163r2
112secg-ellipticCurve 24 : sect193r1
113secg-ellipticCurve 25 : sect193r2
114secg-ellipticCurve 26 : sect233k1
115secg-ellipticCurve 27 : sect233r1
116secg-ellipticCurve 3 : sect239k1
117secg-ellipticCurve 16 : sect283k1
118secg-ellipticCurve 17 : sect283r1
119secg-ellipticCurve 36 : sect409k1
120secg-ellipticCurve 37 : sect409r1
121secg-ellipticCurve 38 : sect571k1
122secg-ellipticCurve 39 : sect571r1
123
124# WAP/TLS curve OIDs (http://www.wapforum.org/)
125!Alias wap-wsg-idm-ecid wap-wsg 4
126wap-wsg-idm-ecid 1 : wap-wsg-idm-ecid-wtls1
127wap-wsg-idm-ecid 3 : wap-wsg-idm-ecid-wtls3
128wap-wsg-idm-ecid 4 : wap-wsg-idm-ecid-wtls4
129wap-wsg-idm-ecid 5 : wap-wsg-idm-ecid-wtls5
130wap-wsg-idm-ecid 6 : wap-wsg-idm-ecid-wtls6
131wap-wsg-idm-ecid 7 : wap-wsg-idm-ecid-wtls7
132wap-wsg-idm-ecid 8 : wap-wsg-idm-ecid-wtls8
133wap-wsg-idm-ecid 9 : wap-wsg-idm-ecid-wtls9
134wap-wsg-idm-ecid 10 : wap-wsg-idm-ecid-wtls10
135wap-wsg-idm-ecid 11 : wap-wsg-idm-ecid-wtls11
136wap-wsg-idm-ecid 12 : wap-wsg-idm-ecid-wtls12
45 137
46 138
47ISO-US 113533 7 66 10 : CAST5-CBC : cast5-cbc 139ISO-US 113533 7 66 10 : CAST5-CBC : cast5-cbc
@@ -53,6 +145,10 @@ ISO-US 113533 7 66 10 : CAST5-CBC : cast5-cbc
53!Cname pbeWithMD5AndCast5-CBC 145!Cname pbeWithMD5AndCast5-CBC
54ISO-US 113533 7 66 12 : : pbeWithMD5AndCast5CBC 146ISO-US 113533 7 66 12 : : pbeWithMD5AndCast5CBC
55 147
148# Macs for CMP and CRMF
149ISO-US 113533 7 66 13 : id-PasswordBasedMAC : password based MAC
150ISO-US 113533 7 66 30 : id-DHBasedMac : Diffie-Hellman based MAC
151
56ISO-US 113549 : rsadsi : RSA Data Security, Inc. 152ISO-US 113549 : rsadsi : RSA Data Security, Inc.
57 153
58rsadsi 1 : pkcs : RSA Data Security, Inc. PKCS 154rsadsi 1 : pkcs : RSA Data Security, Inc. PKCS
@@ -149,6 +245,8 @@ id-smime-ct 5 : id-smime-ct-TDTInfo
149id-smime-ct 6 : id-smime-ct-contentInfo 245id-smime-ct 6 : id-smime-ct-contentInfo
150id-smime-ct 7 : id-smime-ct-DVCSRequestData 246id-smime-ct 7 : id-smime-ct-DVCSRequestData
151id-smime-ct 8 : id-smime-ct-DVCSResponseData 247id-smime-ct 8 : id-smime-ct-DVCSResponseData
248id-smime-ct 9 : id-smime-ct-compressedData
249id-smime-ct 27 : id-ct-asciiTextWithCRLF
152 250
153# S/MIME Attributes 251# S/MIME Attributes
154id-smime-aa 1 : id-smime-aa-receiptRequest 252id-smime-aa 1 : id-smime-aa-receiptRequest
@@ -396,6 +494,7 @@ id-it 12 : id-it-revPassphrase
396id-it 13 : id-it-implicitConfirm 494id-it 13 : id-it-implicitConfirm
397id-it 14 : id-it-confirmWaitTime 495id-it 14 : id-it-confirmWaitTime
398id-it 15 : id-it-origPKIMessage 496id-it 15 : id-it-origPKIMessage
497id-it 16 : id-it-suppLangTags
399 498
400# CRMF registration 499# CRMF registration
401id-pkip 1 : id-regCtrl 500id-pkip 1 : id-regCtrl
@@ -482,6 +581,7 @@ id-ad 2 : caIssuers : CA Issuers
482id-ad 3 : ad_timestamping : AD Time Stamping 581id-ad 3 : ad_timestamping : AD Time Stamping
483!Cname ad-dvcs 582!Cname ad-dvcs
484id-ad 4 : AD_DVCS : ad dvcs 583id-ad 4 : AD_DVCS : ad dvcs
584id-ad 5 : caRepository : CA Repository
485 585
486 586
487!Alias id-pkix-OCSP ad-OCSP 587!Alias id-pkix-OCSP ad-OCSP
@@ -569,6 +669,8 @@ X500algorithms 3 100 : RSA-MDC2 : mdc2WithRSA
569X500algorithms 3 101 : MDC2 : mdc2 669X500algorithms 3 101 : MDC2 : mdc2
570 670
571X500 29 : id-ce 671X500 29 : id-ce
672!Cname subject-directory-attributes
673id-ce 9 : subjectDirectoryAttributes : X509v3 Subject Directory Attributes
572!Cname subject-key-identifier 674!Cname subject-key-identifier
573id-ce 14 : subjectKeyIdentifier : X509v3 Subject Key Identifier 675id-ce 14 : subjectKeyIdentifier : X509v3 Subject Key Identifier
574!Cname key-usage 676!Cname key-usage
@@ -589,18 +691,28 @@ id-ce 21 : CRLReason : X509v3 CRL Reason Code
589id-ce 24 : invalidityDate : Invalidity Date 691id-ce 24 : invalidityDate : Invalidity Date
590!Cname delta-crl 692!Cname delta-crl
591id-ce 27 : deltaCRL : X509v3 Delta CRL Indicator 693id-ce 27 : deltaCRL : X509v3 Delta CRL Indicator
694!Cname issuing-distribution-point
695id-ce 28 : issuingDistributionPoint : X509v3 Issuing Distrubution Point
696!Cname certificate-issuer
697id-ce 29 : certificateIssuer : X509v3 Certificate Issuer
592!Cname name-constraints 698!Cname name-constraints
593id-ce 30 : nameConstraints : X509v3 Name Constraints 699id-ce 30 : nameConstraints : X509v3 Name Constraints
594!Cname crl-distribution-points 700!Cname crl-distribution-points
595id-ce 31 : crlDistributionPoints : X509v3 CRL Distribution Points 701id-ce 31 : crlDistributionPoints : X509v3 CRL Distribution Points
596!Cname certificate-policies 702!Cname certificate-policies
597id-ce 32 : certificatePolicies : X509v3 Certificate Policies 703id-ce 32 : certificatePolicies : X509v3 Certificate Policies
704!Cname any-policy
705certificate-policies 0 : anyPolicy : X509v3 Any Policy
706!Cname policy-mappings
707id-ce 33 : policyMappings : X509v3 Policy Mappings
598!Cname authority-key-identifier 708!Cname authority-key-identifier
599id-ce 35 : authorityKeyIdentifier : X509v3 Authority Key Identifier 709id-ce 35 : authorityKeyIdentifier : X509v3 Authority Key Identifier
600!Cname policy-constraints 710!Cname policy-constraints
601id-ce 36 : policyConstraints : X509v3 Policy Constraints 711id-ce 36 : policyConstraints : X509v3 Policy Constraints
602!Cname ext-key-usage 712!Cname ext-key-usage
603id-ce 37 : extendedKeyUsage : X509v3 Extended Key Usage 713id-ce 37 : extendedKeyUsage : X509v3 Extended Key Usage
714!Cname inhibit-any-policy
715id-ce 54 : inhibitAnyPolicy : X509v3 Inhibit Any Policy
604!Cname target-information 716!Cname target-information
605id-ce 55 : targetInformation : X509v3 AC Targeting 717id-ce 55 : targetInformation : X509v3 AC Targeting
606!Cname no-rev-avail 718!Cname no-rev-avail
@@ -668,7 +780,7 @@ mime-mhs-headings 2 : id-hex-multipart-message : id-hex-multipart-message
668!Cname rle-compression 780!Cname rle-compression
6691 1 1 1 666 1 : RLE : run length compression 7811 1 1 1 666 1 : RLE : run length compression
670!Cname zlib-compression 782!Cname zlib-compression
6711 1 1 1 666 2 : ZLIB : zlib compression 783id-smime-alg 8 : ZLIB : zlib compression
672 784
673# AES aka Rijndael 785# AES aka Rijndael
674 786
@@ -710,6 +822,10 @@ aes 44 : AES-256-CFB : aes-256-cfb
710 : DES-EDE3-CFB1 : des-ede3-cfb1 822 : DES-EDE3-CFB1 : des-ede3-cfb1
711 : DES-EDE3-CFB8 : des-ede3-cfb8 823 : DES-EDE3-CFB8 : des-ede3-cfb8
712 824
825aes 5 : id-aes128-wrap
826aes 25 : id-aes192-wrap
827aes 45 : id-aes256-wrap
828
713# OIDs for SHA224, SHA256, SHA385 and SHA512, according to x9.84. 829# OIDs for SHA224, SHA256, SHA385 and SHA512, according to x9.84.
714!Alias nist_hashalgs nistAlgorithms 2 830!Alias nist_hashalgs nistAlgorithms 2
715nist_hashalgs 1 : SHA256 : sha256 831nist_hashalgs 1 : SHA256 : sha256
@@ -728,9 +844,9 @@ holdInstruction 2 : holdInstructionCallIssuer : Hold Instruction Call Issuer
728!Cname hold-instruction-reject 844!Cname hold-instruction-reject
729holdInstruction 3 : holdInstructionReject : Hold Instruction Reject 845holdInstruction 3 : holdInstructionReject : Hold Instruction Reject
730 846
731# OID's from CCITT. Most of this is defined in RFC 1274. A couple of 847# OID's from ITU-T. Most of this is defined in RFC 1274. A couple of
732# them are also mentioned in RFC 2247 848# them are also mentioned in RFC 2247
733ccitt 9 : data 849itu-t 9 : data
734data 2342 : pss 850data 2342 : pss
735pss 19200300 : ucl 851pss 19200300 : ucl
736ucl 100 : pilot 852ucl 100 : pilot
@@ -804,7 +920,7 @@ pilotAttributeType 54 : : dITRedirect
804pilotAttributeType 55 : audio 920pilotAttributeType 55 : audio
805pilotAttributeType 56 : : documentPublisher 921pilotAttributeType 56 : : documentPublisher
806 922
8072 23 42 : id-set : Secure Electronic Transactions 923international-organizations 42 : id-set : Secure Electronic Transactions
808 924
809id-set 0 : set-ctype : content types 925id-set 0 : set-ctype : content types
810id-set 1 : set-msgExt : message extensions 926id-set 1 : set-msgExt : message extensions
@@ -950,3 +1066,54 @@ set-brand 6011 : set-brand-Novus
950 1066
951rsadsi 3 10 : DES-CDMF : des-cdmf 1067rsadsi 3 10 : DES-CDMF : des-cdmf
952rsadsi 1 1 6 : rsaOAEPEncryptionSET 1068rsadsi 1 1 6 : rsaOAEPEncryptionSET
1069
1070 : Oakley-EC2N-3 : ipsec3
1071 : Oakley-EC2N-4 : ipsec4
1072
1073
1074# Definitions for Camellia cipher - CBC MODE
10751 2 392 200011 61 1 1 1 2 : CAMELLIA-128-CBC : camellia-128-cbc
10761 2 392 200011 61 1 1 1 3 : CAMELLIA-192-CBC : camellia-192-cbc
10771 2 392 200011 61 1 1 1 4 : CAMELLIA-256-CBC : camellia-256-cbc
1078
1079# Definitions for Camellia cipher - ECB, CFB, OFB MODE
1080!Alias ntt-ds 0 3 4401 5
1081!Alias camellia ntt-ds 3 1 9
1082
1083camellia 1 : CAMELLIA-128-ECB : camellia-128-ecb
1084!Cname camellia-128-ofb128
1085camellia 3 : CAMELLIA-128-OFB : camellia-128-ofb
1086!Cname camellia-128-cfb128
1087camellia 4 : CAMELLIA-128-CFB : camellia-128-cfb
1088
1089camellia 21 : CAMELLIA-192-ECB : camellia-192-ecb
1090!Cname camellia-192-ofb128
1091camellia 23 : CAMELLIA-192-OFB : camellia-192-ofb
1092!Cname camellia-192-cfb128
1093camellia 24 : CAMELLIA-192-CFB : camellia-192-cfb
1094
1095camellia 41 : CAMELLIA-256-ECB : camellia-256-ecb
1096!Cname camellia-256-ofb128
1097camellia 43 : CAMELLIA-256-OFB : camellia-256-ofb
1098!Cname camellia-256-cfb128
1099camellia 44 : CAMELLIA-256-CFB : camellia-256-cfb
1100
1101# There are no OIDs for these modes...
1102
1103 : CAMELLIA-128-CFB1 : camellia-128-cfb1
1104 : CAMELLIA-192-CFB1 : camellia-192-cfb1
1105 : CAMELLIA-256-CFB1 : camellia-256-cfb1
1106 : CAMELLIA-128-CFB8 : camellia-128-cfb8
1107 : CAMELLIA-192-CFB8 : camellia-192-cfb8
1108 : CAMELLIA-256-CFB8 : camellia-256-cfb8
1109
1110
1111# Definitions for SEED cipher - ECB, CBC, OFB mode
1112
1113member-body 410 200004 : KISA : kisa
1114kisa 1 3 : SEED-ECB : seed-ecb
1115kisa 1 4 : SEED-CBC : seed-cbc
1116!Cname seed-cfb128
1117kisa 1 5 : SEED-CFB : seed-cfb
1118!Cname seed-ofb128
1119kisa 1 6 : SEED-OFB : seed-ofb