mirror of
https://github.com/clearml/dropbear
synced 2025-04-30 10:34:09 +00:00
Fix compiling with ECDSA and DSS disabled
This commit is contained in:
parent
2a1d28ea3a
commit
6b5317e7cc
16
keyimport.c
16
keyimport.c
@ -602,13 +602,18 @@ static sign_key *openssh_read(const char *filename, char * UNUSED(passphrase))
|
|||||||
*/
|
*/
|
||||||
blobbuf = buf_new(3000);
|
blobbuf = buf_new(3000);
|
||||||
|
|
||||||
|
#ifdef DROPBEAR_DSS
|
||||||
if (key->type == OSSH_DSA) {
|
if (key->type == OSSH_DSA) {
|
||||||
buf_putstring(blobbuf, "ssh-dss", 7);
|
buf_putstring(blobbuf, "ssh-dss", 7);
|
||||||
retkey->type = DROPBEAR_SIGNKEY_DSS;
|
retkey->type = DROPBEAR_SIGNKEY_DSS;
|
||||||
} else if (key->type == OSSH_RSA) {
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef DROPBEAR_RSA
|
||||||
|
if (key->type == OSSH_RSA) {
|
||||||
buf_putstring(blobbuf, "ssh-rsa", 7);
|
buf_putstring(blobbuf, "ssh-rsa", 7);
|
||||||
retkey->type = DROPBEAR_SIGNKEY_RSA;
|
retkey->type = DROPBEAR_SIGNKEY_RSA;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < num_integers; i++) {
|
for (i = 0; i < num_integers; i++) {
|
||||||
ret = ber_read_id_len(p, key->keyblob+key->keyblob_len-p,
|
ret = ber_read_id_len(p, key->keyblob+key->keyblob_len-p,
|
||||||
@ -831,7 +836,14 @@ static int openssh_write(const char *filename, sign_key *key,
|
|||||||
mp_int dmp1, dmq1, iqmp, tmpval; /* for rsa */
|
mp_int dmp1, dmq1, iqmp, tmpval; /* for rsa */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (key->type == DROPBEAR_SIGNKEY_RSA || key->type == DROPBEAR_SIGNKEY_DSS)
|
if (
|
||||||
|
#ifdef DROPBEAR_RSA
|
||||||
|
key->type == DROPBEAR_SIGNKEY_RSA ||
|
||||||
|
#endif
|
||||||
|
#ifdef DROPBEAR_DSS
|
||||||
|
key->type == DROPBEAR_SIGNKEY_DSS ||
|
||||||
|
#endif
|
||||||
|
0)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Fetch the key blobs.
|
* Fetch the key blobs.
|
||||||
|
@ -106,6 +106,7 @@ enum signkey_type signkey_type_from_name(const char* name, unsigned int namelen)
|
|||||||
void **
|
void **
|
||||||
signkey_key_ptr(sign_key *key, enum signkey_type type) {
|
signkey_key_ptr(sign_key *key, enum signkey_type type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
#ifdef DROPBEAR_ECDSA
|
||||||
#ifdef DROPBEAR_ECC_256
|
#ifdef DROPBEAR_ECC_256
|
||||||
case DROPBEAR_SIGNKEY_ECDSA_NISTP256:
|
case DROPBEAR_SIGNKEY_ECDSA_NISTP256:
|
||||||
return (void**)&key->ecckey256;
|
return (void**)&key->ecckey256;
|
||||||
@ -118,6 +119,7 @@ signkey_key_ptr(sign_key *key, enum signkey_type type) {
|
|||||||
case DROPBEAR_SIGNKEY_ECDSA_NISTP521:
|
case DROPBEAR_SIGNKEY_ECDSA_NISTP521:
|
||||||
return (void**)&key->ecckey521;
|
return (void**)&key->ecckey521;
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* DROPBEAR_ECDSA */
|
||||||
#ifdef DROPBEAR_RSA
|
#ifdef DROPBEAR_RSA
|
||||||
case DROPBEAR_SIGNKEY_RSA:
|
case DROPBEAR_SIGNKEY_RSA:
|
||||||
return (void**)&key->rsakey;
|
return (void**)&key->rsakey;
|
||||||
|
Loading…
Reference in New Issue
Block a user