projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop localisation and checkpoint tracing in files not covered by the merge.
[tinc]
/
src
/
gcrypt
/
rsa.c
diff --git
a/src/gcrypt/rsa.c
b/src/gcrypt/rsa.c
index
bb0f9bb
..
ea18a0e
100644
(file)
--- a/
src/gcrypt/rsa.c
+++ b/
src/gcrypt/rsa.c
@@
-26,7
+26,7
@@
#include "logger.h"
#include "rsa.h"
#include "logger.h"
#include "rsa.h"
-// Base64
encoding/decoding tables
+// Base64
decoding table
static const uint8_t b64d[128] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
static const uint8_t b64d[128] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@@
-53,8
+53,6
@@
static const uint8_t b64d[128] = {
0xff, 0xff
};
0xff, 0xff
};
-static const char b64e[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
// PEM encoding/decoding functions
static bool pem_decode(FILE *fp, const char *header, uint8_t *buf, size_t size, size_t *outsize) {
// PEM encoding/decoding functions
static bool pem_decode(FILE *fp, const char *header, uint8_t *buf, size_t size, size_t *outsize) {
@@
-191,7
+189,7
@@
bool rsa_set_hex_public_key(rsa_t *rsa, char *n, char *e) {
?: gcry_mpi_scan(&rsa->e, GCRYMPI_FMT_HEX, n, 0, NULL);
if(err) {
?: gcry_mpi_scan(&rsa->e, GCRYMPI_FMT_HEX, n, 0, NULL);
if(err) {
- logger(LOG_ERR,
_("Error while reading RSA public key: %s")
, gcry_strerror(errno));
+ logger(LOG_ERR,
"Error while reading RSA public key: %s"
, gcry_strerror(errno));
return false;
}
return false;
}
@@
-206,7
+204,7
@@
bool rsa_set_hex_private_key(rsa_t *rsa, char *n, char *e, char *d) {
?: gcry_mpi_scan(&rsa->d, GCRYMPI_FMT_HEX, n, 0, NULL);
if(err) {
?: gcry_mpi_scan(&rsa->d, GCRYMPI_FMT_HEX, n, 0, NULL);
if(err) {
- logger(LOG_ERR,
_("Error while reading RSA public key: %s")
, gcry_strerror(errno));
+ logger(LOG_ERR,
"Error while reading RSA public key: %s"
, gcry_strerror(errno));
return false;
}
return false;
}
@@
-220,7
+218,7
@@
bool rsa_read_pem_public_key(rsa_t *rsa, FILE *fp) {
size_t derlen;
if(!pem_decode(fp, "RSA PUBLIC KEY", derbuf, sizeof derbuf, &derlen)) {
size_t derlen;
if(!pem_decode(fp, "RSA PUBLIC KEY", derbuf, sizeof derbuf, &derlen)) {
- logger(LOG_ERR,
_("Unable to read RSA public key: %s")
, strerror(errno));
+ logger(LOG_ERR,
"Unable to read RSA public key: %s"
, strerror(errno));
return NULL;
}
return NULL;
}
@@
-228,7
+226,7
@@
bool rsa_read_pem_public_key(rsa_t *rsa, FILE *fp) {
|| !ber_read_mpi(&derp, &derlen, &rsa->n)
|| !ber_read_mpi(&derp, &derlen, &rsa->e)
|| derlen) {
|| !ber_read_mpi(&derp, &derlen, &rsa->n)
|| !ber_read_mpi(&derp, &derlen, &rsa->e)
|| derlen) {
- logger(LOG_ERR,
_("Error while decoding RSA public key")
);
+ logger(LOG_ERR,
"Error while decoding RSA public key"
);
return NULL;
}
return NULL;
}
@@
-240,7
+238,7
@@
bool rsa_read_pem_private_key(rsa_t *rsa, FILE *fp) {
size_t derlen;
if(!pem_decode(fp, "RSA PRIVATE KEY", derbuf, sizeof derbuf, &derlen)) {
size_t derlen;
if(!pem_decode(fp, "RSA PRIVATE KEY", derbuf, sizeof derbuf, &derlen)) {
- logger(LOG_ERR,
_("Unable to read RSA private key: %s")
, strerror(errno));
+ logger(LOG_ERR,
"Unable to read RSA private key: %s"
, strerror(errno));
return NULL;
}
return NULL;
}
@@
-255,7
+253,7
@@
bool rsa_read_pem_private_key(rsa_t *rsa, FILE *fp) {
|| !ber_read_mpi(&derp, &derlen, NULL)
|| !ber_read_mpi(&derp, &derlen, NULL) // u
|| derlen) {
|| !ber_read_mpi(&derp, &derlen, NULL)
|| !ber_read_mpi(&derp, &derlen, NULL) // u
|| derlen) {
- logger(LOG_ERR,
_("Error while decoding RSA private key")
);
+ logger(LOG_ERR,
"Error while decoding RSA private key"
);
return NULL;
}
return NULL;
}