mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 07:44:29 +02:00
- markus@cvs.openbsd.org 2001/07/02 22:40:18
[ssh-keygen.c] update for sectok.h interface changes.
This commit is contained in:
parent
4f42d8cda3
commit
0047764526
@ -121,6 +121,9 @@
|
|||||||
- markus@cvs.openbsd.org 2001/07/02 22:29:20
|
- markus@cvs.openbsd.org 2001/07/02 22:29:20
|
||||||
[readpass.c]
|
[readpass.c]
|
||||||
do not return NULL, use "" instead.
|
do not return NULL, use "" instead.
|
||||||
|
- markus@cvs.openbsd.org 2001/07/02 22:40:18
|
||||||
|
[ssh-keygen.c]
|
||||||
|
update for sectok.h interface changes.
|
||||||
|
|
||||||
20010629
|
20010629
|
||||||
- (bal) Removed net_aton() since we don't use it any more
|
- (bal) Removed net_aton() since we don't use it any more
|
||||||
@ -5948,4 +5951,4 @@
|
|||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1374 2001/07/04 05:19:27 mouring Exp $
|
$Id: ChangeLog,v 1.1375 2001/07/04 05:24:27 mouring Exp $
|
||||||
|
27
ssh-keygen.c
27
ssh-keygen.c
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: ssh-keygen.c,v 1.71 2001/06/29 07:11:01 markus Exp $");
|
RCSID("$OpenBSD: ssh-keygen.c,v 1.72 2001/07/02 22:40:18 markus Exp $");
|
||||||
|
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
@ -403,7 +403,7 @@ do_upload(struct passwd *pw, int reader)
|
|||||||
u_char atr[256];
|
u_char atr[256];
|
||||||
u_char AUT0[] = {0xad, 0x9f, 0x61, 0xfe, 0xfa, 0x20, 0xce, 0x63};
|
u_char AUT0[] = {0xad, 0x9f, 0x61, 0xfe, 0xfa, 0x20, 0xce, 0x63};
|
||||||
int len, status = 1, i, fd = -1, ret;
|
int len, status = 1, i, fd = -1, ret;
|
||||||
int r1 = 0, r2 = 0, cla = 0x00;
|
int sw = 0, cla = 0x00;
|
||||||
|
|
||||||
for (i = 0; i < NUM_RSA_KEY_ELEMENTS; i++)
|
for (i = 0; i < NUM_RSA_KEY_ELEMENTS; i++)
|
||||||
elements[i] = NULL;
|
elements[i] = NULL;
|
||||||
@ -425,14 +425,14 @@ do_upload(struct passwd *pw, int reader)
|
|||||||
COPY_RSA_KEY(dmp1, 4);
|
COPY_RSA_KEY(dmp1, 4);
|
||||||
COPY_RSA_KEY(n, 5);
|
COPY_RSA_KEY(n, 5);
|
||||||
len = BN_num_bytes(prv->rsa->n);
|
len = BN_num_bytes(prv->rsa->n);
|
||||||
fd = scopen(reader, 0, NULL);
|
fd = sectok_open(reader, 0, NULL);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
error("scopen failed");
|
error("sectok_open failed");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
ret = screset(fd, atr, NULL);
|
ret = sectok_reset(fd, 0, atr, &sw);
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
error("screset failed");
|
error("sectok_reset failed");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if ((cla = cyberflex_inq_class(fd)) < 0) {
|
if ((cla = cyberflex_inq_class(fd)) < 0) {
|
||||||
@ -446,21 +446,21 @@ do_upload(struct passwd *pw, int reader)
|
|||||||
key_fid[0] = 0x00;
|
key_fid[0] = 0x00;
|
||||||
key_fid[1] = 0x12;
|
key_fid[1] = 0x12;
|
||||||
if (cyberflex_load_rsa_priv(fd, cla, key_fid, 5, 8*len, elements,
|
if (cyberflex_load_rsa_priv(fd, cla, key_fid, 5, 8*len, elements,
|
||||||
&r1, &r2) < 0) {
|
&sw) < 0) {
|
||||||
error("cyberflex_load_rsa_priv failed: %s", get_r1r2s(r1, r1));
|
error("cyberflex_load_rsa_priv failed: %s", sectok_get_sw(sw));
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (r1 != 0x90 && r1 != 0x61)
|
if (!sectok_swOK(sw))
|
||||||
goto done;
|
goto done;
|
||||||
log("cyberflex_load_rsa_priv done");
|
log("cyberflex_load_rsa_priv done");
|
||||||
key_fid[0] = 0x73;
|
key_fid[0] = 0x73;
|
||||||
key_fid[1] = 0x68;
|
key_fid[1] = 0x68;
|
||||||
if (cyberflex_load_rsa_pub(fd, cla, key_fid, len, elements[5],
|
if (cyberflex_load_rsa_pub(fd, cla, key_fid, len, elements[5],
|
||||||
&r1, &r2) < 0) {
|
&sw) < 0) {
|
||||||
error("cyberflex_load_rsa_pub failed: %s", get_r1r2s(r1, r1));
|
error("cyberflex_load_rsa_pub failed: %s", sectok_get_sw(sw));
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (r1 != 0x90 && r1 != 0x61)
|
if (!sectok_swOK(sw))
|
||||||
goto done;
|
goto done;
|
||||||
log("cyberflex_load_rsa_pub done");
|
log("cyberflex_load_rsa_pub done");
|
||||||
status = 0;
|
status = 0;
|
||||||
@ -469,9 +469,10 @@ done:
|
|||||||
if (prv)
|
if (prv)
|
||||||
key_free(prv);
|
key_free(prv);
|
||||||
for (i = 0; i < NUM_RSA_KEY_ELEMENTS; i++)
|
for (i = 0; i < NUM_RSA_KEY_ELEMENTS; i++)
|
||||||
|
if (elements[i])
|
||||||
xfree(elements[i]);
|
xfree(elements[i]);
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
scclose(fd);
|
sectok_close(fd);
|
||||||
exit(status);
|
exit(status);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user