-/* $OpenBSD: ssh-keygen.c,v 1.321 2018/09/13 02:08:33 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.322 2018/09/14 04:17:44 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
free(type);
return NULL;
}
- if ((key = sshkey_new_private(ktype)) == NULL)
- fatal("sshkey_new_private failed");
+ if ((key = sshkey_new(ktype)) == NULL)
+ fatal("sshkey_new failed");
free(type);
switch (key->type) {
-/* $OpenBSD: sshkey.c,v 1.69 2018/09/13 02:08:33 djm Exp $ */
+/* $OpenBSD: sshkey.c,v 1.70 2018/09/14 04:17:44 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
return k;
}
-/* XXX garbage-collect this API */
-struct sshkey *
-sshkey_new_private(int type)
-{
- struct sshkey *k = sshkey_new(type);
-
- if (k == NULL)
- return NULL;
- return k;
-}
-
void
sshkey_free(struct sshkey *k)
{
switch (type) {
#ifdef WITH_OPENSSL
case KEY_DSA:
- if ((k = sshkey_new_private(type)) == NULL) {
+ if ((k = sshkey_new(type)) == NULL) {
r = SSH_ERR_ALLOC_FAIL;
goto out;
}
dsa_priv_key = NULL; /* transferred */
break;
case KEY_ECDSA:
- if ((k = sshkey_new_private(type)) == NULL) {
+ if ((k = sshkey_new(type)) == NULL) {
r = SSH_ERR_ALLOC_FAIL;
goto out;
}
goto out;
break;
case KEY_RSA:
- if ((k = sshkey_new_private(type)) == NULL) {
+ if ((k = sshkey_new(type)) == NULL) {
r = SSH_ERR_ALLOC_FAIL;
goto out;
}
break;
#endif /* WITH_OPENSSL */
case KEY_ED25519:
- if ((k = sshkey_new_private(type)) == NULL) {
+ if ((k = sshkey_new(type)) == NULL) {
r = SSH_ERR_ALLOC_FAIL;
goto out;
}
break;
#ifdef WITH_XMSS
case KEY_XMSS:
- if ((k = sshkey_new_private(type)) == NULL) {
+ if ((k = sshkey_new(type)) == NULL) {
r = SSH_ERR_ALLOC_FAIL;
goto out;
}
-/* $OpenBSD: sshkey.h,v 1.29 2018/09/13 02:08:33 djm Exp $ */
+/* $OpenBSD: sshkey.h,v 1.30 2018/09/14 04:17:44 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
#define ED25519_PK_SZ crypto_sign_ed25519_PUBLICKEYBYTES
struct sshkey *sshkey_new(int);
-struct sshkey *sshkey_new_private(int); /* XXX garbage collect */
void sshkey_free(struct sshkey *);
int sshkey_equal_public(const struct sshkey *,
const struct sshkey *);