diff options
author | Theodore Tso <tytso@mit.edu> | 1990-12-18 17:33:25 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1990-12-18 17:33:25 +0000 |
commit | db1fd0bc319dd2868df0aca8565aba0ddfb51090 (patch) | |
tree | beb2e17a8b503ae8da9871acebaef5660c724768 /src/lib/krb5/krb/copy_cksum.c | |
parent | c615e803bdad7cb3deedd364c7a3d243aed27453 (diff) | |
download | krb5-db1fd0bc319dd2868df0aca8565aba0ddfb51090.zip krb5-db1fd0bc319dd2868df0aca8565aba0ddfb51090.tar.gz krb5-db1fd0bc319dd2868df0aca8565aba0ddfb51090.tar.bz2 |
Initial revision
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1561 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/krb/copy_cksum.c')
-rw-r--r-- | src/lib/krb5/krb/copy_cksum.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/lib/krb5/krb/copy_cksum.c b/src/lib/krb5/krb/copy_cksum.c new file mode 100644 index 0000000..f86a965 --- /dev/null +++ b/src/lib/krb5/krb/copy_cksum.c @@ -0,0 +1,45 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * <krb5/copyright.h>. + * + * krb5_copy_authenticator() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_copy_checksum_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/copyright.h> +#include <krb5/krb5.h> + +#include <krb5/ext-proto.h> + +static krb5_error_code +krb5_copy_checksum(ckfrom, ckto) +const krb5_authenticator *ckfrom; +krb5_authenticator **ckto; +{ + krb5_error_code retval; + krb5_checksum *tempto; + + if (!(tempto = (krb5_checksum *)malloc(sizeof(*tempto)))) + return ENOMEM; + *tempto = *ckfrom; + + if (!(tempto->contents = + (krb5_octet *)malloc(tempto->length))) { + xfree(tempto); + return ENOMEM; + } + memcpy((char *) tempto->contents, (char *) ckfrom->contents, + ckfrom->length); + + *ckto = tempto; + return 0; +} |