Deleted Added
full compact
ssh-keysign.c (204917) ssh-keysign.c (215116)
1/* $OpenBSD: ssh-keysign.c,v 1.30 2010/01/13 01:20:20 dtucker Exp $ */
1/* $OpenBSD: ssh-keysign.c,v 1.32 2010/08/04 06:08:40 djm Exp $ */
2/*
3 * Copyright (c) 2002 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.

--- 217 unchanged lines hidden (view full) ---

227 data = buffer_get_string(&b, &dlen);
228 if (valid_request(pw, host, &key, data, dlen) < 0)
229 fatal("not a valid request");
230 xfree(host);
231
232 found = 0;
233 for (i = 0; i < 2; i++) {
234 if (keys[i] != NULL &&
2/*
3 * Copyright (c) 2002 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.

--- 217 unchanged lines hidden (view full) ---

227 data = buffer_get_string(&b, &dlen);
228 if (valid_request(pw, host, &key, data, dlen) < 0)
229 fatal("not a valid request");
230 xfree(host);
231
232 found = 0;
233 for (i = 0; i < 2; i++) {
234 if (keys[i] != NULL &&
235 key_equal(key, keys[i])) {
235 key_equal_public(key, keys[i])) {
236 found = 1;
237 break;
238 }
239 }
240 if (!found)
241 fatal("no matching hostkey found");
242
243 if (key_sign(keys[i], &signature, &slen, data, dlen) != 0)
244 fatal("key_sign failed");
245 xfree(data);
246
247 /* send reply */
248 buffer_clear(&b);
249 buffer_put_string(&b, signature, slen);
250 if (ssh_msg_send(STDOUT_FILENO, version, &b) == -1)
251 fatal("ssh_msg_send failed");
252
253 return (0);
254}
236 found = 1;
237 break;
238 }
239 }
240 if (!found)
241 fatal("no matching hostkey found");
242
243 if (key_sign(keys[i], &signature, &slen, data, dlen) != 0)
244 fatal("key_sign failed");
245 xfree(data);
246
247 /* send reply */
248 buffer_clear(&b);
249 buffer_put_string(&b, signature, slen);
250 if (ssh_msg_send(STDOUT_FILENO, version, &b) == -1)
251 fatal("ssh_msg_send failed");
252
253 return (0);
254}