View | Details | Raw Unified | Return to bug 1371 | Differences between
and this patch

Collapse All | Expand All

(-)openssh-4.7p1/pkcs11.c (+23 lines)
Lines 186-191 _pkcs11_convert_to_ssh_key(const pkcs11h Link Here
186
	pkcs11h_openssl_session_t openssl_session = NULL;
186
	pkcs11h_openssl_session_t openssl_session = NULL;
187
	Key *internal_key = NULL;
187
	Key *internal_key = NULL;
188
	char *internal_comment = NULL;
188
	char *internal_comment = NULL;
189
#if defined(ENABLE_PKCS11_X509)
190
	X509 *x509 = NULL;
191
#endif
189
	RSA *rsa = NULL;
192
	RSA *rsa = NULL;
190
	size_t temp;
193
	size_t temp;
191
	CK_RV rv = CKR_OK;
194
	CK_RV rv = CKR_OK;
Lines 245-255 _pkcs11_convert_to_ssh_key(const pkcs11h Link Here
245
		goto cleanup;
248
		goto cleanup;
246
	}
249
	}
247
250
251
#if defined(ENABLE_PKCS11_X509)
252
	if ((x509 = pkcs11h_openssl_session_getX509(openssl_session)) == NULL) {
253
		error("PKCS#11: Unable get certificate object");
254
		goto cleanup;
255
	}
256
#endif
257
248
	internal_key = key_new_private(KEY_UNSPEC);
258
	internal_key = key_new_private(KEY_UNSPEC);
249
	internal_key->flags |= KEY_FLAG_EXT;
259
	internal_key->flags |= KEY_FLAG_EXT;
250
	internal_key->rsa = rsa;
260
	internal_key->rsa = rsa;
251
	rsa = NULL;
261
	rsa = NULL;
262
#if defined(ENABLE_PKCS11_X509)
263
	internal_key->type = KEY_X509_RSA;
264
	internal_key->x509 = x509;
265
	x509 = NULL;
266
#else
252
	internal_key->type = KEY_RSA;
267
	internal_key->type = KEY_RSA;
268
#endif
253
269
254
	*key = internal_key;
270
	*key = internal_key;
255
	internal_key = NULL;
271
	internal_key = NULL;
Lines 257-262 _pkcs11_convert_to_ssh_key(const pkcs11h Link Here
257
	internal_comment = NULL;
273
	internal_comment = NULL;
258
274
259
cleanup:
275
cleanup:
276
#if defined(ENABLE_PKCS11_X509)
277
	if (x509 != NULL) {
278
		X509_free(x509);
279
		x509 = NULL;
280
	}
281
#endif
282
260
	if (internal_key != NULL) {
283
	if (internal_key != NULL) {
261
		key_free(internal_key);
284
		key_free(internal_key);
262
		internal_key = NULL;
285
		internal_key = NULL;
(-)openssh-4.7p1/configure.ac (+5 lines)
Lines 3978-3983 if test ! -z "$blibpath" ; then Link Here
3978
	AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
3992
	AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
3979
fi
3993
fi
3980
3994
3995
if test -n "$ssh_x509" -a "x$ssh_pkcs11" = "xyes"; then
3996
	PKCS11_MSG="${PKCS11_MSG} + x509"
3997
	AC_DEFINE(ENABLE_PKCS11_X509, 1, [Define if you want to use X509 with PKCS11])
3998
fi
3999
3981
dnl Adding -Werror to CFLAGS early prevents configure tests from running.
4000
dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3982
dnl Add now.
4001
dnl Add now.
3983
CFLAGS="$CFLAGS $werror_flags"
4002
CFLAGS="$CFLAGS $werror_flags"

Return to bug 1371