freebsd-ports/picobsd/ssh-picobsd/files/patch-ax
Luigi Rizzo 90d8c77fba New port: stripped-down ssh version to be used in picobsd images.
"stripped down" refers to the fact that we build a single binary
which includes ssh, sshd and scp functionality without having
to bring in 3 copies of mostly the same code.

Requests to add this category and this port have been posted
on the ports list and directly to satoshi over the past few
months. I assume no reply means no problem.
2001-04-22 14:03:04 +00:00

25 lines
795 B
Text

--- rsaglue.c.orig Tue Nov 9 11:12:32 1999
+++ rsaglue.c Tue Nov 9 11:17:58 1999
@@ -139,6 +139,10 @@
input_bits = mpz_sizeinbase(input, 2);
input_len = (input_bits + 7) / 8;
+ if(input_bits > MAX_RSA_MODULUS_BITS)
+ fatal("Attempted to encrypt a block too large (%d bits, %d max) (malicious?).",
+ input_bits, MAX_RSA_MODULUS_BITS);
+
gmp_to_rsaref(input_data, input_len, input);
rsaref_public_key(&public_key, key);
@@ -172,6 +176,10 @@
input_bits = mpz_sizeinbase(input, 2);
input_len = (input_bits + 7) / 8;
+ if(input_bits > MAX_RSA_MODULUS_BITS)
+ fatal("Received session key too long (%d bits, %d max) (malicious?).",
+ input_bits, MAX_RSA_MODULUS_BITS);
+
gmp_to_rsaref(input_data, input_len, input);
rsaref_private_key(&private_key, key);