summaryrefslogtreecommitdiff
path: root/scard.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-06-12 16:16:35 +0000
committerColin Watson <cjwatson@debian.org>2007-06-12 16:16:35 +0000
commitb7e40fa9da0b5491534a429dadb321eab5a77558 (patch)
treebed1da11e9f829925797aa093e379fc0b5868ecd /scard.c
parent4f84beedf1005e44ff33c854abd6b711ffc0adb7 (diff)
parent086ea76990b1e6287c24b6db74adffd4605eb3b0 (diff)
* New upstream release (closes: #395507, #397961, #420035). Important
changes not previously backported to 4.3p2: - 4.4/4.4p1 (http://www.openssh.org/txt/release-4.4): + On portable OpenSSH, fix a GSSAPI authentication abort that could be used to determine the validity of usernames on some platforms. + Implemented conditional configuration in sshd_config(5) using the "Match" directive. This allows some configuration options to be selectively overridden if specific criteria (based on user, group, hostname and/or address) are met. So far a useful subset of post-authentication options are supported and more are expected to be added in future releases. + Add support for Diffie-Hellman group exchange key agreement with a final hash of SHA256. + Added a "ForceCommand" directive to sshd_config(5). Similar to the command="..." option accepted in ~/.ssh/authorized_keys, this forces the execution of the specified command regardless of what the user requested. This is very useful in conjunction with the new "Match" option. + Add a "PermitOpen" directive to sshd_config(5). This mirrors the permitopen="..." authorized_keys option, allowing fine-grained control over the port-forwardings that a user is allowed to establish. + Add optional logging of transactions to sftp-server(8). + ssh(1) will now record port numbers for hosts stored in ~/.ssh/known_hosts when a non-standard port has been requested (closes: #50612). + Add an "ExitOnForwardFailure" option to cause ssh(1) to exit (with a non-zero exit code) when requested port forwardings could not be established. + Extend sshd_config(5) "SubSystem" declarations to allow the specification of command-line arguments. + Replacement of all integer overflow susceptible invocations of malloc(3) and realloc(3) with overflow-checking equivalents. + Many manpage fixes and improvements. + Add optional support for OpenSSL hardware accelerators (engines), enabled using the --with-ssl-engine configure option. + Tokens in configuration files may be double-quoted in order to contain spaces (closes: #319639). + Move a debug() call out of a SIGCHLD handler, fixing a hang when the session exits very quickly (closes: #307890). + Fix some incorrect buffer allocation calculations (closes: #410599). + ssh-add doesn't ask for a passphrase if key file permissions are too liberal (closes: #103677). + Likewise, ssh doesn't ask either (closes: #99675). - 4.6/4.6p1 (http://www.openssh.org/txt/release-4.6): + sshd now allows the enabling and disabling of authentication methods on a per user, group, host and network basis via the Match directive in sshd_config. + Fixed an inconsistent check for a terminal when displaying scp progress meter (closes: #257524). + Fix "hang on exit" when background processes are running at the time of exit on a ttyful/login session (closes: #88337). * Update to current GSSAPI patch from http://www.sxw.org.uk/computing/patches/openssh-4.6p1-gsskex-20070312.patch; install ChangeLog.gssapi.
Diffstat (limited to 'scard.c')
-rw-r--r--scard.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/scard.c b/scard.c
index b3d25058a..9fd3ca1b4 100644
--- a/scard.c
+++ b/scard.c
@@ -1,3 +1,4 @@
1/* $OpenBSD: scard.c,v 1.36 2006/11/06 21:25:28 markus Exp $ */
1/* 2/*
2 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
3 * 4 *
@@ -24,14 +25,18 @@
24 25
25#include "includes.h" 26#include "includes.h"
26#if defined(SMARTCARD) && defined(USE_SECTOK) 27#if defined(SMARTCARD) && defined(USE_SECTOK)
27RCSID("$OpenBSD: scard.c,v 1.29 2004/05/08 00:21:31 djm Exp $");
28 28
29#include <openssl/evp.h> 29#include <sys/types.h>
30
30#include <sectok.h> 31#include <sectok.h>
32#include <stdarg.h>
33#include <string.h>
34
35#include <openssl/evp.h>
31 36
37#include "xmalloc.h"
32#include "key.h" 38#include "key.h"
33#include "log.h" 39#include "log.h"
34#include "xmalloc.h"
35#include "misc.h" 40#include "misc.h"
36#include "scard.h" 41#include "scard.h"
37 42
@@ -125,7 +130,7 @@ sc_init(void)
125 if (status == SCARD_ERROR_NOCARD) { 130 if (status == SCARD_ERROR_NOCARD) {
126 return SCARD_ERROR_NOCARD; 131 return SCARD_ERROR_NOCARD;
127 } 132 }
128 if (status < 0 ) { 133 if (status < 0) {
129 error("sc_open failed"); 134 error("sc_open failed");
130 return status; 135 return status;
131 } 136 }
@@ -215,7 +220,7 @@ sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa,
215 olen = len = sw = 0; 220 olen = len = sw = 0;
216 if (sc_fd < 0) { 221 if (sc_fd < 0) {
217 status = sc_init(); 222 status = sc_init();
218 if (status < 0 ) 223 if (status < 0)
219 goto err; 224 goto err;
220 } 225 }
221 if (padding != RSA_PKCS1_PADDING) 226 if (padding != RSA_PKCS1_PADDING)
@@ -255,7 +260,7 @@ sc_private_encrypt(int flen, u_char *from, u_char *to, RSA *rsa,
255 len = sw = 0; 260 len = sw = 0;
256 if (sc_fd < 0) { 261 if (sc_fd < 0) {
257 status = sc_init(); 262 status = sc_init();
258 if (status < 0 ) 263 if (status < 0)
259 goto err; 264 goto err;
260 } 265 }
261 if (padding != RSA_PKCS1_PADDING) 266 if (padding != RSA_PKCS1_PADDING)
@@ -378,23 +383,25 @@ sc_get_keys(const char *id, const char *pin)
378 key_free(k); 383 key_free(k);
379 return NULL; 384 return NULL;
380 } 385 }
381 if (status < 0 ) { 386 if (status < 0) {
382 error("sc_read_pubkey failed"); 387 error("sc_read_pubkey failed");
383 key_free(k); 388 key_free(k);
384 return NULL; 389 return NULL;
385 } 390 }
386 keys = xmalloc((nkeys+1) * sizeof(Key *)); 391 keys = xcalloc((nkeys+1), sizeof(Key *));
387 392
388 n = key_new(KEY_RSA1); 393 n = key_new(KEY_RSA1);
389 BN_copy(n->rsa->n, k->rsa->n); 394 if ((BN_copy(n->rsa->n, k->rsa->n) == NULL) ||
390 BN_copy(n->rsa->e, k->rsa->e); 395 (BN_copy(n->rsa->e, k->rsa->e) == NULL))
396 fatal("sc_get_keys: BN_copy failed");
391 RSA_set_method(n->rsa, sc_get_rsa()); 397 RSA_set_method(n->rsa, sc_get_rsa());
392 n->flags |= KEY_FLAG_EXT; 398 n->flags |= KEY_FLAG_EXT;
393 keys[0] = n; 399 keys[0] = n;
394 400
395 n = key_new(KEY_RSA); 401 n = key_new(KEY_RSA);
396 BN_copy(n->rsa->n, k->rsa->n); 402 if ((BN_copy(n->rsa->n, k->rsa->n) == NULL) ||
397 BN_copy(n->rsa->e, k->rsa->e); 403 (BN_copy(n->rsa->e, k->rsa->e) == NULL))
404 fatal("sc_get_keys: BN_copy failed");
398 RSA_set_method(n->rsa, sc_get_rsa()); 405 RSA_set_method(n->rsa, sc_get_rsa());
399 n->flags |= KEY_FLAG_EXT; 406 n->flags |= KEY_FLAG_EXT;
400 keys[1] = n; 407 keys[1] = n;