aboutsummaryrefslogtreecommitdiff
path: root/crypto/heimdal/lib/asn1/der_copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/asn1/der_copy.c')
-rw-r--r--crypto/heimdal/lib/asn1/der_copy.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/crypto/heimdal/lib/asn1/der_copy.c b/crypto/heimdal/lib/asn1/der_copy.c
index 3a0a8c5ffa6a..4faf87014280 100644
--- a/crypto/heimdal/lib/asn1/der_copy.c
+++ b/crypto/heimdal/lib/asn1/der_copy.c
@@ -55,6 +55,13 @@ der_copy_integer (const int *from, int *to)
}
int
+der_copy_integer64 (const int64_t *from, int64_t *to)
+{
+ *to = *from;
+ return 0;
+}
+
+int
der_copy_unsigned (const unsigned *from, unsigned *to)
{
*to = *from;
@@ -62,6 +69,13 @@ der_copy_unsigned (const unsigned *from, unsigned *to)
}
int
+der_copy_unsigned64 (const uint64_t *from, uint64_t *to)
+{
+ *to = *from;
+ return 0;
+}
+
+int
der_copy_generalized_time (const time_t *from, time_t *to)
{
*to = *from;
@@ -135,8 +149,12 @@ int
der_copy_octet_string (const heim_octet_string *from, heim_octet_string *to)
{
to->length = from->length;
- to->data = malloc(to->length);
- if(to->length != 0 && to->data == NULL)
+ if (from->data == NULL) {
+ to->data = NULL;
+ return 0;
+ }
+ to->data = malloc(to->length);
+ if (to->length != 0 && to->data == NULL)
return ENOMEM;
memcpy(to->data, from->data, to->length);
return 0;