X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fgcrypt%2Frsa.c;h=5e4ba41fdedba7e6102e378e092c2559909cfff2;hb=4c68a8cb60eb0a4c05d9ce98963b930a976b55ee;hp=ea18a0e10f3c6dddd65dec783de1b17c71e0d65e;hpb=07a560eab66b575f382428a956550817697e25e2;p=meshlink diff --git a/src/gcrypt/rsa.c b/src/gcrypt/rsa.c index ea18a0e1..5e4ba41f 100644 --- a/src/gcrypt/rsa.c +++ b/src/gcrypt/rsa.c @@ -12,11 +12,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "system.h" @@ -186,7 +184,7 @@ bool rsa_set_hex_public_key(rsa_t *rsa, char *n, char *e) { gcry_error_t err = 0; err = gcry_mpi_scan(&rsa->n, GCRYMPI_FMT_HEX, n, 0, NULL) - ?: gcry_mpi_scan(&rsa->e, GCRYMPI_FMT_HEX, n, 0, NULL); + ?: gcry_mpi_scan(&rsa->e, GCRYMPI_FMT_HEX, e, 0, NULL); if(err) { logger(LOG_ERR, "Error while reading RSA public key: %s", gcry_strerror(errno)); @@ -200,8 +198,8 @@ bool rsa_set_hex_private_key(rsa_t *rsa, char *n, char *e, char *d) { gcry_error_t err = 0; err = gcry_mpi_scan(&rsa->n, GCRYMPI_FMT_HEX, n, 0, NULL) - ?: gcry_mpi_scan(&rsa->e, GCRYMPI_FMT_HEX, n, 0, NULL) - ?: gcry_mpi_scan(&rsa->d, GCRYMPI_FMT_HEX, n, 0, NULL); + ?: gcry_mpi_scan(&rsa->e, GCRYMPI_FMT_HEX, e, 0, NULL) + ?: gcry_mpi_scan(&rsa->d, GCRYMPI_FMT_HEX, d, 0, NULL); if(err) { logger(LOG_ERR, "Error while reading RSA public key: %s", gcry_strerror(errno));