diff options
| author | John Kohl <jtkohl@mit.edu> | 1990-03-26 11:59:28 +0000 |
|---|---|---|
| committer | John Kohl <jtkohl@mit.edu> | 1990-03-26 11:59:28 +0000 |
| commit | e92f2896db56232f502d5fa359ff1d481ef85c8f (patch) | |
| tree | b3293a6da4259f99e037bd33682e03005d99901e | |
| parent | de918b5b103004599b55d739e2bb62d76839e630 (diff) | |
| download | krb5-e92f2896db56232f502d5fa359ff1d481ef85c8f.tar.gz krb5-e92f2896db56232f502d5fa359ff1d481ef85c8f.tar.xz krb5-e92f2896db56232f502d5fa359ff1d481ef85c8f.zip | |
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@408 dc483132-0cff-0310-8789-dd5450dbe970
| -rw-r--r-- | src/lib/krb5/krb/copy_key.c | 38 |
1 files changed, 38 insertions, 0 deletions
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/mit-copyright.h>. + * + * krb5_copy_keyblock() + */ + +#if !defined(lint) && !defined(SABER) +static char copy_key_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/copyright.h> +#include <krb5/krb5.h> +#include <krb5/ext-proto.h> + +#include <errno.h> + +/* + * 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; +} |
