checking in some more research and primitive functions. i cannot, for the life of me, figure out why i can't (seemingly) properly decrypt private keys.

This commit is contained in:
2020-09-17 08:37:05 -04:00
parent 5f5d77a2a6
commit 6b956a3a49
10 changed files with 190 additions and 65 deletions

View File

@@ -5,26 +5,53 @@ const (
KeyV1Magic string = "openssh-key-v1"
)
// Cipher names. I believe only AES256-CTR is supported upstream currently.
// "Meta". Used for comment strings, etc.
const projUrl = "https://git.square-r00t.net/SSHSecure"
// Defaults.
const (
CIPHER_NULL string = "none"
CIPHER_AES256_CTR string = "aes256-ctr"
defCipher string = CipherAes256Ctr
defKeyType string = KeyEd25519
defKDF string = KdfBcrypt
defRounds uint32 = 100
defRSABitSize uint32 = 4096
defSaltLen int = 16
)
var allowed_ciphers = [...]string{CIPHER_NULL, CIPHER_AES256_CTR}
// Cipher names. I believe only AES256-CTR is supported upstream currently.
const (
CipherNull string = "none"
CipherAes256Ctr string = "aes256-ctr"
)
var allowed_ciphers = [...]string{CipherNull, CipherAes256Ctr}
// Key types.
const (
KEY_ED25519 string = "ssh-ed25519"
KEY_RSA string = "ssh-rsa"
KeyEd25519 string = "ssh-ed25519"
KeyRsa string = "ssh-rsa"
)
var allowed_keytypes = [...]string{KEY_ED25519, KEY_RSA}
var allowed_keytypes = [...]string{KeyEd25519, KeyRsa}
// KDF names. I believe only bcrypt is supported upstream currently.
const (
KDF_NULL string = "none"
KDF_BCRYPT string = "bcrypt"
KdfNull string = "none"
KdfBcrypt string = "bcrypt"
)
var allowed_kdfnames = [...]string{KDF_NULL, KDF_BCRYPT}
var allowed_kdfnames = [...]string{KdfNull, KdfBcrypt}
// Key lengths.
const (
// ED25519 in OpenSSH uses a static key size of 64 bytes.
ed25519Len uint32 = 64
)
// Key/Block sizes.
const (
keyEd25519 uint32 = 32
blockEd25519 uint32 = 16
blockNull uint32 = 8
)