kexdhc.c (261320) | kexdhc.c (263712) |
---|---|
1/* $OpenBSD: kexdhc.c,v 1.14 2014/01/12 08:13:13 djm Exp $ */ | 1/* $OpenBSD: kexdhc.c,v 1.15 2014/02/02 03:44:31 djm Exp $ */ |
2/* 3 * Copyright (c) 2001 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. --- 109 unchanged lines hidden (view full) --- 119 fatal("DH_compute_key: failed"); 120#ifdef DEBUG_KEXDH 121 dump_digest("shared secret", kbuf, kout); 122#endif 123 if ((shared_secret = BN_new()) == NULL) 124 fatal("kexdh_client: BN_new failed"); 125 if (BN_bin2bn(kbuf, kout, shared_secret) == NULL) 126 fatal("kexdh_client: BN_bin2bn failed"); | 2/* 3 * Copyright (c) 2001 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. --- 109 unchanged lines hidden (view full) --- 119 fatal("DH_compute_key: failed"); 120#ifdef DEBUG_KEXDH 121 dump_digest("shared secret", kbuf, kout); 122#endif 123 if ((shared_secret = BN_new()) == NULL) 124 fatal("kexdh_client: BN_new failed"); 125 if (BN_bin2bn(kbuf, kout, shared_secret) == NULL) 126 fatal("kexdh_client: BN_bin2bn failed"); |
127 memset(kbuf, 0, klen); | 127 explicit_bzero(kbuf, klen); |
128 free(kbuf); 129 130 /* calc and verify H */ 131 kex_dh_hash( 132 kex->client_version_string, 133 kex->server_version_string, 134 buffer_ptr(&kex->my), buffer_len(&kex->my), 135 buffer_ptr(&kex->peer), buffer_len(&kex->peer), --- 26 unchanged lines hidden --- | 128 free(kbuf); 129 130 /* calc and verify H */ 131 kex_dh_hash( 132 kex->client_version_string, 133 kex->server_version_string, 134 buffer_ptr(&kex->my), buffer_len(&kex->my), 135 buffer_ptr(&kex->peer), buffer_len(&kex->peer), --- 26 unchanged lines hidden --- |