diff options
author | beck <> | 2000-03-19 11:13:58 +0000 |
---|---|---|
committer | beck <> | 2000-03-19 11:13:58 +0000 |
commit | 796d609550df3a33fc11468741c5d2f6d3df4c11 (patch) | |
tree | 6c6d539061caa20372dad0ac4ddb1dfae2fbe7fe /src/lib/libcrypto/objects/obj_dat.c | |
parent | 5be3114c1fd7e0dfea1e38d3abb4cbba75244419 (diff) | |
download | openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.gz openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.bz2 openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.zip |
OpenSSL 0.9.5 merge
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2
if you are using the ssl26 packages for ssh and other things to work you will
need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
Diffstat (limited to 'src/lib/libcrypto/objects/obj_dat.c')
-rw-r--r-- | src/lib/libcrypto/objects/obj_dat.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c index d47b874399..da6df3762a 100644 --- a/src/lib/libcrypto/objects/obj_dat.c +++ b/src/lib/libcrypto/objects/obj_dat.c | |||
@@ -214,16 +214,12 @@ int OBJ_new_nid(int num) | |||
214 | int OBJ_add_object(ASN1_OBJECT *obj) | 214 | int OBJ_add_object(ASN1_OBJECT *obj) |
215 | { | 215 | { |
216 | ASN1_OBJECT *o; | 216 | ASN1_OBJECT *o; |
217 | ADDED_OBJ *ao[4],*aop; | 217 | ADDED_OBJ *ao[4]={NULL,NULL,NULL,NULL},*aop; |
218 | int i; | 218 | int i; |
219 | 219 | ||
220 | if (added == NULL) | 220 | if (added == NULL) |
221 | if (!init_added()) return(0); | 221 | if (!init_added()) return(0); |
222 | if ((o=OBJ_dup(obj)) == NULL) goto err; | 222 | if ((o=OBJ_dup(obj)) == NULL) goto err; |
223 | ao[ADDED_DATA]=NULL; | ||
224 | ao[ADDED_SNAME]=NULL; | ||
225 | ao[ADDED_LNAME]=NULL; | ||
226 | ao[ADDED_NID]=NULL; | ||
227 | ao[ADDED_NID]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); | 223 | ao[ADDED_NID]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); |
228 | if ((o->length != 0) && (obj->data != NULL)) | 224 | if ((o->length != 0) && (obj->data != NULL)) |
229 | ao[ADDED_DATA]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); | 225 | ao[ADDED_DATA]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); |
@@ -238,7 +234,7 @@ int OBJ_add_object(ASN1_OBJECT *obj) | |||
238 | { | 234 | { |
239 | ao[i]->type=i; | 235 | ao[i]->type=i; |
240 | ao[i]->obj=o; | 236 | ao[i]->obj=o; |
241 | aop=(ADDED_OBJ *)lh_insert(added,(char *)ao[i]); | 237 | aop=(ADDED_OBJ *)lh_insert(added,ao[i]); |
242 | /* memory leak, buit should not normally matter */ | 238 | /* memory leak, buit should not normally matter */ |
243 | if (aop != NULL) | 239 | if (aop != NULL) |
244 | Free(aop); | 240 | Free(aop); |
@@ -276,7 +272,7 @@ ASN1_OBJECT *OBJ_nid2obj(int n) | |||
276 | ad.type=ADDED_NID; | 272 | ad.type=ADDED_NID; |
277 | ad.obj= &ob; | 273 | ad.obj= &ob; |
278 | ob.nid=n; | 274 | ob.nid=n; |
279 | adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); | 275 | adp=(ADDED_OBJ *)lh_retrieve(added,&ad); |
280 | if (adp != NULL) | 276 | if (adp != NULL) |
281 | return(adp->obj); | 277 | return(adp->obj); |
282 | else | 278 | else |
@@ -308,7 +304,7 @@ const char *OBJ_nid2sn(int n) | |||
308 | ad.type=ADDED_NID; | 304 | ad.type=ADDED_NID; |
309 | ad.obj= &ob; | 305 | ad.obj= &ob; |
310 | ob.nid=n; | 306 | ob.nid=n; |
311 | adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); | 307 | adp=(ADDED_OBJ *)lh_retrieve(added,&ad); |
312 | if (adp != NULL) | 308 | if (adp != NULL) |
313 | return(adp->obj->sn); | 309 | return(adp->obj->sn); |
314 | else | 310 | else |
@@ -340,7 +336,7 @@ const char *OBJ_nid2ln(int n) | |||
340 | ad.type=ADDED_NID; | 336 | ad.type=ADDED_NID; |
341 | ad.obj= &ob; | 337 | ad.obj= &ob; |
342 | ob.nid=n; | 338 | ob.nid=n; |
343 | adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); | 339 | adp=(ADDED_OBJ *)lh_retrieve(added,&ad); |
344 | if (adp != NULL) | 340 | if (adp != NULL) |
345 | return(adp->obj->ln); | 341 | return(adp->obj->ln); |
346 | else | 342 | else |
@@ -365,7 +361,7 @@ int OBJ_obj2nid(ASN1_OBJECT *a) | |||
365 | { | 361 | { |
366 | ad.type=ADDED_DATA; | 362 | ad.type=ADDED_DATA; |
367 | ad.obj=a; | 363 | ad.obj=a; |
368 | adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); | 364 | adp=(ADDED_OBJ *)lh_retrieve(added,&ad); |
369 | if (adp != NULL) return (adp->obj->nid); | 365 | if (adp != NULL) return (adp->obj->nid); |
370 | } | 366 | } |
371 | op=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ, | 367 | op=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ, |
@@ -504,7 +500,7 @@ int OBJ_ln2nid(const char *s) | |||
504 | { | 500 | { |
505 | ad.type=ADDED_LNAME; | 501 | ad.type=ADDED_LNAME; |
506 | ad.obj= &o; | 502 | ad.obj= &o; |
507 | adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); | 503 | adp=(ADDED_OBJ *)lh_retrieve(added,&ad); |
508 | if (adp != NULL) return (adp->obj->nid); | 504 | if (adp != NULL) return (adp->obj->nid); |
509 | } | 505 | } |
510 | op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)ln_objs,NUM_LN, | 506 | op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)ln_objs,NUM_LN, |
@@ -523,7 +519,7 @@ int OBJ_sn2nid(const char *s) | |||
523 | { | 519 | { |
524 | ad.type=ADDED_SNAME; | 520 | ad.type=ADDED_SNAME; |
525 | ad.obj= &o; | 521 | ad.obj= &o; |
526 | adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); | 522 | adp=(ADDED_OBJ *)lh_retrieve(added,&ad); |
527 | if (adp != NULL) return (adp->obj->nid); | 523 | if (adp != NULL) return (adp->obj->nid); |
528 | } | 524 | } |
529 | op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)sn_objs,NUM_SN, | 525 | op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)sn_objs,NUM_SN, |
@@ -647,7 +643,7 @@ int OBJ_create(char *oid, char *sn, char *ln) | |||
647 | ok=OBJ_add_object(op); | 643 | ok=OBJ_add_object(op); |
648 | err: | 644 | err: |
649 | ASN1_OBJECT_free(op); | 645 | ASN1_OBJECT_free(op); |
650 | Free((char *)buf); | 646 | Free(buf); |
651 | return(ok); | 647 | return(ok); |
652 | } | 648 | } |
653 | 649 | ||