Mercurial > dropbear
comparison keyimport.c @ 1123:d7b752525b91
buf_getstring and buf_putstring now use non-unsigned char*
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 04 Jun 2015 23:08:50 +0800 |
parents | 845922d73e9c |
children | 6aeadee3f16b |
comparison
equal
deleted
inserted
replaced
1121:bb3a03feb31f | 1123:d7b752525b91 |
---|---|
600 */ | 600 */ |
601 blobbuf = buf_new(3000); | 601 blobbuf = buf_new(3000); |
602 | 602 |
603 #ifdef DROPBEAR_DSS | 603 #ifdef DROPBEAR_DSS |
604 if (key->type == OSSH_DSA) { | 604 if (key->type == OSSH_DSA) { |
605 buf_putstring(blobbuf, (const unsigned char *)"ssh-dss", 7); | 605 buf_putstring(blobbuf, "ssh-dss", 7); |
606 retkey->type = DROPBEAR_SIGNKEY_DSS; | 606 retkey->type = DROPBEAR_SIGNKEY_DSS; |
607 } | 607 } |
608 #endif | 608 #endif |
609 #ifdef DROPBEAR_RSA | 609 #ifdef DROPBEAR_RSA |
610 if (key->type == OSSH_RSA) { | 610 if (key->type == OSSH_RSA) { |
611 buf_putstring(blobbuf, (const unsigned char *)"ssh-rsa", 7); | 611 buf_putstring(blobbuf, "ssh-rsa", 7); |
612 retkey->type = DROPBEAR_SIGNKEY_RSA; | 612 retkey->type = DROPBEAR_SIGNKEY_RSA; |
613 } | 613 } |
614 #endif | 614 #endif |
615 | 615 |
616 for (i = 0; i < num_integers; i++) { | 616 for (i = 0; i < num_integers; i++) { |
647 if (i == 1) { | 647 if (i == 1) { |
648 /* Save the details for after we deal with number 2. */ | 648 /* Save the details for after we deal with number 2. */ |
649 modptr = p; | 649 modptr = p; |
650 modlen = len; | 650 modlen = len; |
651 } else if (i >= 2 && i <= 5) { | 651 } else if (i >= 2 && i <= 5) { |
652 buf_putstring(blobbuf, p, len); | 652 buf_putstring(blobbuf, (const char*)p, len); |
653 if (i == 2) { | 653 if (i == 2) { |
654 buf_putstring(blobbuf, modptr, modlen); | 654 buf_putstring(blobbuf, (const char*)modptr, modlen); |
655 } | 655 } |
656 } | 656 } |
657 } else if (key->type == OSSH_DSA) { | 657 } else if (key->type == OSSH_DSA) { |
658 /* | 658 /* |
659 * OpenSSH key order is p, q, g, y, x, | 659 * OpenSSH key order is p, q, g, y, x, |
660 * we want the same. | 660 * we want the same. |
661 */ | 661 */ |
662 buf_putstring(blobbuf, p, len); | 662 buf_putstring(blobbuf, (const char*)p, len); |
663 } | 663 } |
664 | 664 |
665 /* Skip past the number. */ | 665 /* Skip past the number. */ |
666 p += len; | 666 p += len; |
667 } | 667 } |