resolve naming problem
This commit is contained in:
parent
795ed55d1a
commit
7663d126b1
|
|
@ -197,7 +197,7 @@ void pcrypto_ctr_encdec_free(
|
|||
psync_free(enc);
|
||||
}
|
||||
|
||||
void pcrypto_ctr_encdec_encode(
|
||||
void pcrypto_ctr_encdec_decode(
|
||||
pcrypto_ctr_encdec_t enc, void *data, size_t datalen,
|
||||
uint64_t dataoffset) {
|
||||
unsigned char buff[PAES_BLOCK_SIZE * 3], *aessrc, *aesdst;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ typedef pcrypto_encdec_iv_t *pcrypto_sector_encdec_t;
|
|||
#define PSYNC_CRYPTO_INVALID_REVISIONID ((uint32_t)-1)
|
||||
|
||||
pcrypto_ctr_encdec_t pcrypto_ctr_encdec_create(pssl_symkey_t *key);
|
||||
void pcrypto_ctr_encdec_encode(pcrypto_ctr_encdec_t enc, void *data, size_t datalen, uint64_t dataoffset);
|
||||
void pcrypto_ctr_encdec_decode(pcrypto_ctr_encdec_t enc, void *data, size_t datalen, uint64_t dataoffset);
|
||||
void pcrypto_ctr_encdec_free(pcrypto_ctr_encdec_t enc);
|
||||
int pcrypto_decode_sec(pcrypto_sector_encdec_t enc, const unsigned char *data, size_t datalen, unsigned char *out, const pcrypto_sector_auth_t auth, uint64_t sectorid);
|
||||
unsigned char * pcrypto_decode_text(pcrypto_textdec_t enc, const unsigned char *data, size_t datalen);
|
||||
|
|
|
|||
|
|
@ -1191,7 +1191,7 @@ int pcryptofolder_setup(const char *password, const char *hint) {
|
|||
return PSYNC_CRYPTO_SETUP_KEYGEN_FAILED;
|
||||
}
|
||||
debug(D_NOTICE, "encoding private key");
|
||||
pcrypto_ctr_encdec_encode(enc, rsaprivatebin->data,
|
||||
pcrypto_ctr_encdec_decode(enc, rsaprivatebin->data,
|
||||
rsaprivatebin->datalen, 0);
|
||||
pcrypto_ctr_encdec_free(enc);
|
||||
debug(D_NOTICE, "encoded private key, uploading keys");
|
||||
|
|
@ -1357,7 +1357,7 @@ int pcryptofolder_unlock(const char *password) {
|
|||
psymkey_free(aeskey);
|
||||
rsaprivdec = (unsigned char *)pmemlock_malloc(rsaprivlen);
|
||||
memcpy(rsaprivdec, rsapriv, rsaprivlen);
|
||||
pcrypto_ctr_encdec_encode(enc, rsaprivdec, rsaprivlen, 0);
|
||||
pcrypto_ctr_encdec_decode(enc, rsaprivdec, rsaprivlen, 0);
|
||||
pcrypto_ctr_encdec_free(enc);
|
||||
debug(D_NOTICE, "successfully decoded private key");
|
||||
|
||||
|
|
@ -1819,7 +1819,7 @@ int psync_pcloud_crypto_reencode_key(const unsigned char *rsapub, size_t rsapubl
|
|||
goto err_nm_1;
|
||||
}
|
||||
memcpy(rsaprivdec, rsapriv_struct->key, rsaprivlen);
|
||||
pcrypto_ctr_encdec_encode(enc, rsaprivdec, rsaprivlen,
|
||||
pcrypto_ctr_encdec_decode(enc, rsaprivdec, rsaprivlen,
|
||||
0);
|
||||
pcrypto_ctr_encdec_free(enc);
|
||||
newpriv = (unsigned char *)psync_malloc(offsetof(priv_key_ver1, key) +
|
||||
|
|
@ -1841,7 +1841,7 @@ int psync_pcloud_crypto_reencode_key(const unsigned char *rsapub, size_t rsapubl
|
|||
if (unlikely(enc == PSYNC_CRYPTO_INVALID_ENCODER))
|
||||
goto err_nm_1;
|
||||
memcpy(rsapriv_struct->key, rsaprivdec, rsaprivlen);
|
||||
pcrypto_ctr_encdec_encode(enc, rsapriv_struct->key,
|
||||
pcrypto_ctr_encdec_decode(enc, rsapriv_struct->key,
|
||||
rsaprivlen, 0);
|
||||
pcrypto_ctr_encdec_free(enc);
|
||||
newprivlen = offsetof(priv_key_ver1, key) + rsaprivlen;
|
||||
|
|
@ -1928,7 +1928,7 @@ int psync_pcloud_crypto_encode_key(const char *newpassphrase, uint32_t flags, ch
|
|||
if (unlikely(enc == PSYNC_CRYPTO_INVALID_ENCODER))
|
||||
goto err_nm_1;
|
||||
memcpy(rsapriv_struct->key, rsapriv->data, rsaprivlen);
|
||||
pcrypto_ctr_encdec_encode(enc, rsapriv_struct->key,
|
||||
pcrypto_ctr_encdec_decode(enc, rsapriv_struct->key,
|
||||
rsaprivlen, 0);
|
||||
pcrypto_ctr_encdec_free(enc);
|
||||
rsaprivlen += offsetof(priv_key_ver1, key);
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ static void psync_p2p_tcphandler(void *ptr) {
|
|||
rd = sizeof(buff);
|
||||
if (unlikely_log(pfile_read(fd, buff, rd) != rd))
|
||||
break;
|
||||
pcrypto_ctr_encdec_encode(encoder, buff, rd, off);
|
||||
pcrypto_ctr_encdec_decode(encoder, buff, rd, off);
|
||||
if (unlikely_log(socket_write_all(sock, buff, rd)))
|
||||
break;
|
||||
off += rd;
|
||||
|
|
@ -700,7 +700,7 @@ static int psync_p2p_download(int sock, psync_fileid_t fileid,
|
|||
rd = fsize - off;
|
||||
if (unlikely_log(socket_read_all(sock, buff, rd)))
|
||||
goto err0;
|
||||
pcrypto_ctr_encdec_encode(decoder, buff, rd, off);
|
||||
pcrypto_ctr_encdec_decode(decoder, buff, rd, off);
|
||||
if (unlikely_log(pfile_write(fd, buff, rd) != rd))
|
||||
goto err0;
|
||||
psync_hash_update(&hashctx, buff, rd);
|
||||
|
|
|
|||
Loading…
Reference in New Issue