diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-06-17 12:07:32 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-06-17 12:07:32 +0200 |
commit | d83b3d9ebef272f11eab90dfccc8a87f777d8d5c (patch) | |
tree | 2bd25820b9c86ec8c16dd68ca745d5b427d501b1 /src | |
parent | 6f8b5ed679876427c4b2ff17b60a7fa3cbd02a54 (diff) | |
download | libssh-d83b3d9ebef272f11eab90dfccc8a87f777d8d5c.tar.gz libssh-d83b3d9ebef272f11eab90dfccc8a87f777d8d5c.tar.xz libssh-d83b3d9ebef272f11eab90dfccc8a87f777d8d5c.zip |
pki: Limit privkey to 4M for now.
Diffstat (limited to 'src')
-rw-r--r-- | src/pki.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -442,6 +442,12 @@ int ssh_pki_import_privkey_file(const char *filename, return SSH_ERROR; } + if (sb.st_size > MAX_PRIVKEY_SIZE) { + ssh_pki_log("Private key is bigger than 4M."); + fclose(file); + return SSH_ERROR; + } + key_buf = malloc(sb.st_size + 1); if (key_buf == NULL) { fclose(file); |