X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=openssl.c;h=0808a8b09c22210e53ff6a4cd3b22f337aec7362;hb=fa9e0afda25c038c0c9d815f7d812f27f5f34ea0;hp=bc287905c2f4036bfac69c42938d8f5b44a47a16;hpb=be7c18842422e6fbf95dc726f8cfb9b13b09be0b;p=paraslash.git diff --git a/openssl.c b/openssl.c index bc287905..0808a8b0 100644 --- a/openssl.c +++ b/openssl.c @@ -97,7 +97,7 @@ static int read_bignum(const unsigned char *buf, size_t len, BIGNUM **result) return bnsize + 4; } -static int read_rsa_bignums(const unsigned char *blob, int blen, RSA **result) +static int read_public_key(const unsigned char *blob, int blen, RSA **result) { int ret; RSA *rsa; @@ -149,7 +149,7 @@ bio_free: return *rsa? RSA_size(*rsa) : -E_PRIVATE_KEY; } -static int read_private_rsa_params(const unsigned char *blob, +static int read_openssh_private_key(const unsigned char *blob, const unsigned char *end, RSA **result) { int ret; @@ -267,7 +267,7 @@ static int get_private_key(const char *path, RSA **rsa) if (ret < 0) goto free_blob; PARA_INFO_LOG("reading RSA params at offset %d\n", ret); - ret = read_private_rsa_params(blob + ret, end, rsa); + ret = read_openssh_private_key(blob + ret, end, rsa); } else ret = read_pem_private_key(path, rsa); free_blob: @@ -285,7 +285,7 @@ int apc_get_pubkey(const char *key_file, struct asymmetric_key **result) ret = decode_public_key(key_file, &blob, &decoded_size); if (ret < 0) goto out; - ret = read_rsa_bignums(blob + ret, decoded_size - ret, &key->rsa); + ret = read_public_key(blob + ret, decoded_size - ret, &key->rsa); if (ret < 0) goto free_blob; ret = RSA_size(key->rsa);