aboutsummaryrefslogtreecommitdiff
path: root/lib/crypto/testdata
AgeCommit message (Collapse)Author
2026-01-15all: convert license and copyright to use SPDX identifiersShulhan
With help of spdxconv tool [1], we able to bulk update all files license and copyright format to comply with SPDX formats. [1] https://kilabit.info/project/spdxconv/
2023-11-19lib/crypto: trim the password read from SSH_ASKPASSShulhan
If user press enter on the GUI, the returned password will contains line feed, which makes the password invalid.
2023-11-18lib/crypto: add support for reading passphrase using SSH_ASKPASSShulhan
If the library failed to changes os.Stdin to raw, it will try to use a program defined in SSH_ASKPASS environment variable. The SSH_ASKPASS is controlled by environment SSH_ASKPASS_REQUIRE. - If SSH_ASKPASS_REQUIRE is empty the passphrase will read from terminal first, if not possible then using SSH_ASKPASS program. - If SSH_ASKPASS_REQUIRE is set to "never" the passphrase will read from terminal only. - If SSH_ASKPASS_REQUIRE is set to "prefer", the passphrase will read using SSH_ASKPASS program not from terminal, but require DISPLAY environment to be set. - If SSH_ASKPASS_REQUIRE is set to "force", the passphrase will read using SSH_ASKPASS program not from terminal, without checking DISPLAY environment. This changes affect the [ssh.NewClientInteractive] indirectly.
2023-09-20lib/crypto: implement RSA encrypt and decryption for large message sizeShulhan
The EncryptOaep extend the [rsa.EncryptOAEP] to make it able to encrypt a message larger than its than (public modulus size - 2*hash.Size - 2). The function signature is the same with [rsa.EncryptOAEP] except the name, to make it distinguishable. The DecryptOaep function extend the [rsa.DecryptOAEP] to make it able to decrypt a message larger than its public modulus size.
2023-09-20lib/crypto: add parameter passphrase to LoadPrivateKeyShulhan
The passphrase parameter is optional, it will be used only if the private key is encrypted.
2023-09-20lib/crypto: rewrite LoadPrivateKey as wrapper of ssh.ParseRawPrivateShulhan
Previously, the LoadPrivateKey function only able to load private key with PKCS#1 format. This changes make the function as a wrapper for ssh.ParseRawPrivate that can load RSA, DSA, ECDSA, and Ed25519 in PKCS#1, PKCS#8, OpenSSL, and OpenSSH formats.