diff options
Diffstat (limited to 'crypto/heimdal/lib/asn1/der_copy.c')
-rw-r--r-- | crypto/heimdal/lib/asn1/der_copy.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/crypto/heimdal/lib/asn1/der_copy.c b/crypto/heimdal/lib/asn1/der_copy.c index 83c2446..30027e1 100644 --- a/crypto/heimdal/lib/asn1/der_copy.c +++ b/crypto/heimdal/lib/asn1/der_copy.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "der_locl.h" -RCSID("$Id: der_copy.c,v 1.8 1999/12/02 17:05:01 joda Exp $"); +RCSID("$Id: der_copy.c,v 1.9 2001/09/25 13:39:25 assar Exp $"); int copy_general_string (const general_string *from, general_string *to) @@ -55,3 +55,14 @@ copy_octet_string (const octet_string *from, octet_string *to) memcpy(to->data, from->data, to->length); return 0; } + +int +copy_oid (const oid *from, oid *to) +{ + to->length = from->length; + to->components = malloc(to->length * sizeof(*to->components)); + if (to->length != 0 && to->components == NULL) + return ENOMEM; + memcpy(to->components, from->components, to->length); + return 0; +} |