cipher-bf1.c (181111) | cipher-bf1.c (221420) |
---|---|
1/* $OpenBSD: cipher-bf1.c,v 1.5 2006/08/03 03:34:42 deraadt Exp $ */ | 1/* $OpenBSD: cipher-bf1.c,v 1.6 2010/10/01 23:05:32 djm Exp $ */ |
2/* 3 * Copyright (c) 2003 Markus Friedl. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. --- 61 unchanged lines hidden (view full) --- 71 memcpy (&(ctx->oiv[0]), iv, 8); 72 memcpy (&(ctx->iv[0]), &(ctx->oiv[0]), 8); 73 if (key != NULL) 74 BF_set_key (&(ctx->c.bf_ks), EVP_CIPHER_CTX_key_length (ctx), 75 key); 76} 77#endif 78 | 2/* 3 * Copyright (c) 2003 Markus Friedl. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. --- 61 unchanged lines hidden (view full) --- 71 memcpy (&(ctx->oiv[0]), iv, 8); 72 memcpy (&(ctx->iv[0]), &(ctx->oiv[0]), 8); 73 if (key != NULL) 74 BF_set_key (&(ctx->c.bf_ks), EVP_CIPHER_CTX_key_length (ctx), 75 key); 76} 77#endif 78 |
79static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL; | 79static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, 80 const u_char *, LIBCRYPTO_EVP_INL_TYPE) = NULL; |
80 81static int | 81 82static int |
82bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len) | 83bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, 84 LIBCRYPTO_EVP_INL_TYPE len) |
83{ 84 int ret; 85 86 swap_bytes(in, out, len); 87 ret = (*orig_bf)(ctx, out, out, len); 88 swap_bytes(out, out, len); 89 return (ret); 90} --- 16 unchanged lines hidden --- | 85{ 86 int ret; 87 88 swap_bytes(in, out, len); 89 ret = (*orig_bf)(ctx, out, out, len); 90 swap_bytes(out, out, len); 91 return (ret); 92} --- 16 unchanged lines hidden --- |