OpenSSL CVS Repository
http://cvs.openssl.org/
____________________________________________________________
________________
Server: cvs.openssl.org Name: Dr.
Stephen Henson
Root: /v/openssl/cvs Email: steve openssl.org
Module: openssl Date:
14-Apr-2007 19:53:56
Branch: HEAD Handle:
2007041418535500
Modified files:
openssl/crypto/asn1 asn1.h asn1_lib.c
Log:
New function ASN1_STRING_copy() to copy to an already
alloacted ASN1_STRING structure.
Summary:
Revision Changes Path
1.150 +1 -0 openssl/crypto/asn1/asn1.h
1.35 +19 -8 openssl/crypto/asn1/asn1_lib.c
____________________________________________________________
________________
patch -p0 <<' .'
Index: openssl/crypto/asn1/asn1.h
============================================================
================
$ cvs diff -u -r1.149 -r1.150 asn1.h
--- openssl/crypto/asn1/asn1.h 24 Dec 2006 16:22:54
-0000 1.149
+++ openssl/crypto/asn1/asn1.h 14 Apr 2007 17:53:55
-0000 1.150
 -765,6 +765,7 
ASN1_STRING * ASN1_STRING_new(void);
void ASN1_STRING_free(ASN1_STRING *a);
+int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING
*str);
ASN1_STRING * ASN1_STRING_dup(const ASN1_STRING *a);
ASN1_STRING * ASN1_STRING_type_new(int type );
int ASN1_STRING_cmp(const ASN1_STRING *a, const
ASN1_STRING *b);
 .
patch -p0 <<' .'
Index: openssl/crypto/asn1/asn1_lib.c
============================================================
================
$ cvs diff -u -r1.34 -r1.35 asn1_lib.c
--- openssl/crypto/asn1/asn1_lib.c 13 Apr 2007 01:06:39
-0000 1.34
+++ openssl/crypto/asn1/asn1_lib.c 14 Apr 2007 17:53:55
-0000 1.35
 -340,20 +340,31 
return(1);
}
+int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING
*str)
+ {
+ if (str == NULL)
+ return 0;
+ dst->type = str->type;
+ if (!ASN1_STRING_set(dst,str->data,str->length))
+ return 0;
+ dst->flags = str->flags;
+ return 1;
+ }
+
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str)
{
ASN1_STRING *ret;
-
- if (str == NULL) return(NULL);
- if ((ret=ASN1_STRING_type_new(str->type)) == NULL)
- return(NULL);
- if (!ASN1_STRING_set(ret,str->data,str->length))
+ if (!str)
+ return NULL;
+ ret=ASN1_STRING_new();
+ if (!ret)
+ return NULL;
+ if (!ASN1_STRING_copy(ret,str))
{
ASN1_STRING_free(ret);
- return(NULL);
+ return NULL;
}
- ret->flags = str->flags;
- return(ret);
+ return ret;
}
int ASN1_STRING_set(ASN1_STRING *str, const void *_data,
int len)
 .
____________________________________________________________
__________
OpenSSL Project http://www.openssl.org
CVS Repository Commit List
openssl-cvs openssl.org
Automated List Manager
majordomo openssl.org
|