mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-20 02:42:09 +03:00
Support for sk-ecdsa-sha2-nistp256 and sk-ssh-ed25519 keys, FIDO (#698)
Notes: Add support for sk-ecdsa-sha2-nistp256@openssh.com and sk-ssh-ed25519@openssh.com key exchange for FIDO auth using the OpenSSL backend. Stub API for other backends. Credit: Michael Buckley
This commit is contained in:
24
src/misc.c
24
src/misc.c
@@ -243,6 +243,30 @@ void _libssh2_store_str(unsigned char **buf, const char *str, size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
/* _libssh2_store_bignum2_bytes
|
||||
*/
|
||||
void _libssh2_store_bignum2_bytes(unsigned char **buf,
|
||||
const unsigned char *bytes,
|
||||
size_t len)
|
||||
{
|
||||
int extraByte = 0;
|
||||
const unsigned char *p;
|
||||
for(p = bytes; len > 0 && *p == 0; --len, ++p) {}
|
||||
|
||||
extraByte = (len > 0 && (p[0] & 0x80) != 0);
|
||||
_libssh2_store_u32(buf, len + extraByte);
|
||||
|
||||
if(extraByte) {
|
||||
*buf[0] = 0;
|
||||
*buf += 1;
|
||||
}
|
||||
|
||||
if(len > 0) {
|
||||
memcpy(*buf, p, len);
|
||||
*buf += len;
|
||||
}
|
||||
}
|
||||
|
||||
/* Base64 Conversion */
|
||||
|
||||
static const short base64_reverse_table[256] = {
|
||||
|
||||
Reference in New Issue
Block a user