projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add PKCS#8 utility functions and add PBE options.
[oweals/openssl.git]
/
crypto
/
objects
/
obj_lib.c
diff --git
a/crypto/objects/obj_lib.c
b/crypto/objects/obj_lib.c
index 35a8d70e09ddf59e2222c212407621b6c2a32519..1a1ba0fc063cf548d935c17cef95ece4cddb4c26 100644
(file)
--- a/
crypto/objects/obj_lib.c
+++ b/
crypto/objects/obj_lib.c
@@
-1,5
+1,5
@@
/* crypto/objects/obj_lib.c */
/* crypto/objects/obj_lib.c */
-/* Copyright (C) 1995-199
7
Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-199
8
Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* All rights reserved.
*
* This package is an SSL implementation written
@@
-58,27
+58,27
@@
#include <stdio.h>
#include "cryptlib.h"
#include <stdio.h>
#include "cryptlib.h"
-#include
"lhash.h"
-#include
"objects.h"
-#include
"buffer.h"
+#include
<openssl/lhash.h>
+#include
<openssl/objects.h>
+#include
<openssl/buffer.h>
-ASN1_OBJECT *OBJ_dup(o)
-ASN1_OBJECT *o;
+ASN1_OBJECT *OBJ_dup(ASN1_OBJECT *o)
{
ASN1_OBJECT *r;
int i;
{
ASN1_OBJECT *r;
int i;
+ char *ln=NULL;
if (o == NULL) return(NULL);
if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
return(o);
if (o == NULL) return(NULL);
if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
return(o);
- r=
(ASN1_OBJECT *)
ASN1_OBJECT_new();
+ r=ASN1_OBJECT_new();
if (r == NULL)
{
OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB);
return(NULL);
}
if (r == NULL)
{
OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB);
return(NULL);
}
- r->data=
(unsigned char *)
Malloc(o->length);
+ r->data=Malloc(o->length);
if (r->data == NULL)
goto err;
memcpy(r->data,o->data,o->length);
if (r->data == NULL)
goto err;
memcpy(r->data,o->data,o->length);
@@
-88,35
+88,35
@@
ASN1_OBJECT *o;
if (o->ln != NULL)
{
i=strlen(o->ln)+1;
if (o->ln != NULL)
{
i=strlen(o->ln)+1;
- r->ln=
(char *)
Malloc(i);
+ r->ln=
ln=
Malloc(i);
if (r->ln == NULL) goto err;
if (r->ln == NULL) goto err;
- memcpy(
r->
ln,o->ln,i);
+ memcpy(ln,o->ln,i);
}
if (o->sn != NULL)
{
}
if (o->sn != NULL)
{
+ char *s;
+
i=strlen(o->sn)+1;
i=strlen(o->sn)+1;
- r->sn=
(char *)
Malloc(i);
+ r->sn=
s=
Malloc(i);
if (r->sn == NULL) goto err;
if (r->sn == NULL) goto err;
- memcpy(
r->sn
,o->sn,i);
+ memcpy(
s
,o->sn,i);
}
r->flags=o->flags|(ASN1_OBJECT_FLAG_DYNAMIC|
}
r->flags=o->flags|(ASN1_OBJECT_FLAG_DYNAMIC|
- ASN1_OBJECT_FLAG_DYNAMIC_STRINGS);
+ ASN1_OBJECT_FLAG_DYNAMIC_STRINGS
|ASN1_OBJECT_FLAG_DYNAMIC_DATA
);
return(r);
err:
OBJerr(OBJ_F_OBJ_DUP,ERR_R_MALLOC_FAILURE);
if (r != NULL)
{
return(r);
err:
OBJerr(OBJ_F_OBJ_DUP,ERR_R_MALLOC_FAILURE);
if (r != NULL)
{
- if (
r->ln != NULL) Free(r->
ln);
+ if (
ln != NULL) Free(
ln);
if (r->data != NULL) Free(r->data);
Free(r);
}
return(NULL);
}
if (r->data != NULL) Free(r->data);
Free(r);
}
return(NULL);
}
-int OBJ_cmp(a,b)
-ASN1_OBJECT *a;
-ASN1_OBJECT *b;
+int OBJ_cmp(ASN1_OBJECT *a, ASN1_OBJECT *b)
{
int ret;
{
int ret;