* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
-RCSID("$OpenBSD: auth2.c,v 1.1 2000/04/26 21:28:32 markus Exp $");
+RCSID("$OpenBSD: auth2.c,v 1.2 2000/04/27 08:01:25 markus Exp $");
#include <openssl/dsa.h>
#include <openssl/rsa.h>
}
pkblob = packet_get_string(&blen);
key = dsa_key_from_blob(pkblob, blen);
-
- if (have_sig && key != NULL) {
- sig = packet_get_string(&slen);
- packet_done();
- buffer_init(&b);
- buffer_append(&b, session_id2, session_id2_len);
- buffer_put_char(&b, SSH2_MSG_USERAUTH_REQUEST);
- if (slen + 4 > rlen)
- fatal("bad rlen/slen");
- buffer_append(&b, raw, rlen - slen - 4);
+ if (key != NULL) {
+ if (have_sig) {
+ sig = packet_get_string(&slen);
+ packet_done();
+ buffer_init(&b);
+ buffer_append(&b, session_id2, session_id2_len);
+ buffer_put_char(&b, SSH2_MSG_USERAUTH_REQUEST);
+ if (slen + 4 > rlen)
+ fatal("bad rlen/slen");
+ buffer_append(&b, raw, rlen - slen - 4);
#ifdef DEBUG_DSS
- buffer_dump(&b);
+ buffer_dump(&b);
#endif
- /* test for correct signature */
- if (user_dsa_key_allowed(pw, key) &&
- dsa_verify(key, sig, slen, buffer_ptr(&b), buffer_len(&b)) == 1)
- authenticated = 1;
- buffer_clear(&b);
- xfree(sig);
- } else if (!have_sig && key != NULL) {
- packet_done();
- debug("test key...");
- /* test whether pkalg/pkblob are acceptable */
- /* XXX fake reply and always send PK_OK ? */
- if (user_dsa_key_allowed(pw, key)) {
- packet_start(SSH2_MSG_USERAUTH_PK_OK);
- packet_put_string(pkalg, alen);
- packet_put_string(pkblob, blen);
- packet_send();
- packet_write_wait();
- authenticated = -1;
+ /* test for correct signature */
+ if (user_dsa_key_allowed(pw, key) &&
+ dsa_verify(key, sig, slen, buffer_ptr(&b), buffer_len(&b)) == 1)
+ authenticated = 1;
+ buffer_clear(&b);
+ xfree(sig);
+ } else {
+ packet_done();
+ debug("test key...");
+ /* test whether pkalg/pkblob are acceptable */
+ /* XXX fake reply and always send PK_OK ? */
+ if (user_dsa_key_allowed(pw, key)) {
+ packet_start(SSH2_MSG_USERAUTH_PK_OK);
+ packet_put_string(pkalg, alen);
+ packet_put_string(pkblob, blen);
+ packet_send();
+ packet_write_wait();
+ authenticated = -1;
+ }
}
+ key_free(key);
}
xfree(pkalg);
xfree(pkblob);
*/
#include "includes.h"
-RCSID("$Id: ssh-keygen.c,v 1.20 2000/04/26 21:55:04 deraadt Exp $");
+RCSID("$Id: ssh-keygen.c,v 1.21 2000/04/27 08:01:27 markus Exp $");
#include <openssl/evp.h>
#include <openssl/pem.h>
dump_base64(stdout, blob, len);
fprintf(stdout, SSH_COM_MAGIC_END "\n");
key_free(k);
+ xfree(blob);
exit(0);
}
if (!key_write(k, stdout))
fprintf(stderr, "key_write failed");
key_free(k);
+ xfree(blob);
fprintf(stdout, "\n");
exit(0);
}
*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect2.c,v 1.2 2000/04/26 21:33:53 markus Exp $");
+RCSID("$OpenBSD: sshconnect2.c,v 1.3 2000/04/27 08:01:27 markus Exp $");
#include <openssl/bn.h>
#include <openssl/rsa.h>
dh_server_pub,
shared_secret
);
+ xfree(server_host_key_blob);
buffer_free(client_kexinit);
buffer_free(server_kexinit);
xfree(client_kexinit);
buffer_put_char(&b, 1);
buffer_put_cstring(&b, KEX_DSS);
buffer_put_string(&b, blob, bloblen);
+ xfree(blob);
/* generate signature */
dsa_sign(k, &signature, &slen, buffer_ptr(&b), buffer_len(&b));
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.110 2000/04/26 22:36:06 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.111 2000/04/27 08:01:28 markus Exp $");
#include "xmalloc.h"
#include "rsa.h"
memset(kbuf, 0, klen);
xfree(kbuf);
+ /* XXX precompute? */
dsa_make_key_blob(sensitive_data.dsa_host_key, &server_host_key_blob, &sbloblen);
/* calc H */ /* XXX depends on 'kex' */
packet_put_string((char *)signature, slen);
packet_send();
xfree(signature);
+ xfree(server_host_key_blob);
packet_write_wait();
kex_derive_keys(kex, hash, shared_secret);