From e92f2896db56232f502d5fa359ff1d481ef85c8f Mon Sep 17 00:00:00 2001 From: John Kohl Date: Mon, 26 Mar 1990 11:59:28 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@408 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/copy_key.c | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/lib/krb5/krb/copy_key.c diff --git a/src/lib/krb5/krb/copy_key.c b/src/lib/krb5/krb/copy_key.c new file mode 100644 index 000000000..0d6a2b61b --- /dev/null +++ b/src/lib/krb5/krb/copy_key.c @@ -0,0 +1,38 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * krb5_copy_keyblock() + */ + +#if !defined(lint) && !defined(SABER) +static char copy_key_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include +#include +#include + +#include + +/* + * Copy a keyblock, including alloc'ed storage. + */ +krb5_error_code +krb5_copy_keyblock(from, to) +krb5_keyblock *from; +krb5_keyblock *to; +{ + *to = *from; + to->contents = (krb5_octet *)malloc(to->length); + if (!to->contents) + return ENOMEM; + bcopy((char *)from->contents, (char *)to->contents, to->length); + return 0; +} -- 2.26.2