Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Net_Crypto a module-private type. #689

Merged
merged 1 commit into from
Jan 16, 2018
Merged

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Jan 15, 2018

This change is Reviewable

@iphydf iphydf added this to the v0.2.0 milestone Jan 15, 2018
@jhert0
Copy link
Member

jhert0 commented Jan 15, 2018

Reviewed 26 of 26 files at r1.
Review status: all files reviewed at latest revision, 8 unresolved discussions, some commit checks failed.


auto_tests/onion_test.c, line 482 at r1 (raw file):

    printf("adding friend\n");
    int frnum_f = onion_addfriend(onions[NUM_FIRST]->onion_c,
                                  nc_get_self_secret_key(onion_get_net_crypto(onions[NUM_LAST]->onion_c)));

You are passingself_secret_key when you should be passing self_public_key


auto_tests/onion_test.c, line 484 at r1 (raw file):

                                  nc_get_self_secret_key(onion_get_net_crypto(onions[NUM_LAST]->onion_c)));
    int frnum = onion_addfriend(onions[NUM_LAST]->onion_c,
                                nc_get_self_secret_key(onion_get_net_crypto(onions[NUM_FIRST]->onion_c)));

You are passingself_secret_key when you should be passing self_public_key


toxcore/onion_client.c, line 591 at r1 (raw file):

    if (num == 0) {
        len = create_announce_request(request, sizeof(request), dest_pubkey, nc_get_self_public_key(onion_c->c),
                                      nc_get_self_public_key(onion_c->c), ping_id, nc_get_self_public_key(onion_c->c),

The second nc_get_self_public_key should be nc_get_self_secret_key


toxcore/onion_client.c, line 851 at r1 (raw file):

    if (num == 0) {
        len = decrypt_data(public_key, nc_get_self_public_key(onion_c->c),

You are passing the public key when you need to be passing the secret key.


toxcore/onion_client.c, line 918 at r1 (raw file):

    VLA(uint8_t, plain, SIZEOF_VLA(temp_plain) - DATA_IN_RESPONSE_MIN_SIZE);
    len = decrypt_data(temp_plain, nc_get_self_public_key(onion_c->c),

You are passing the public key when you need to be passing the secret key


toxcore/onion_client.c, line 1072 at r1 (raw file):

    memcpy(packet, nc_get_self_public_key(onion_c->c), CRYPTO_PUBLIC_KEY_SIZE);
    int len = encrypt_data(onion_c->friends_list[friend_num].real_public_key,
                           nc_get_self_public_key(onion_c->c), nonce, data,

You are passing the public key when you should be passing the secret key.


toxcore/onion_client.c, line 1128 at r1 (raw file):

    memcpy(temp + CRYPTO_PUBLIC_KEY_SIZE, nonce, CRYPTO_NONCE_SIZE);
    int len = encrypt_data(onion_c->friends_list[friend_num].real_public_key,
                           nc_get_self_public_key(onion_c->c), nonce, data,

You are passing the public key when you should be passing the secret key.


toxcore/onion_client.c, line 1160 at r1 (raw file):

    uint8_t plain[DHTPK_DATA_MAX_LENGTH];
    int len = decrypt_data(packet, nc_get_self_public_key(onion_c->c),

You are passing the public key when you should be passing the secret key.


Comments from Reviewable

@sudden6
Copy link

sudden6 commented Jan 15, 2018

besides @endoffile78 remarks, :lgtm_strong:


Reviewed 26 of 26 files at r1.
Review status: all files reviewed at latest revision, 8 unresolved discussions, some commit checks broke.


Comments from Reviewable

@iphydf
Copy link
Member Author

iphydf commented Jan 16, 2018

Review status: 3 of 7 files reviewed at latest revision, 8 unresolved discussions, some commit checks pending.


auto_tests/onion_test.c, line 482 at r1 (raw file):

Previously, endoffile78 (Endoffile) wrote…

You are passingself_secret_key when you should be passing self_public_key

Done.


auto_tests/onion_test.c, line 484 at r1 (raw file):

Previously, endoffile78 (Endoffile) wrote…

You are passingself_secret_key when you should be passing self_public_key

Done.


toxcore/onion_client.c, line 591 at r1 (raw file):

Previously, endoffile78 (Endoffile) wrote…

The second nc_get_self_public_key should be nc_get_self_secret_key

Done.


toxcore/onion_client.c, line 851 at r1 (raw file):

Previously, endoffile78 (Endoffile) wrote…

You are passing the public key when you need to be passing the secret key.

Done.


toxcore/onion_client.c, line 918 at r1 (raw file):

Previously, endoffile78 (Endoffile) wrote…

You are passing the public key when you need to be passing the secret key

Done.


toxcore/onion_client.c, line 1072 at r1 (raw file):

Previously, endoffile78 (Endoffile) wrote…

You are passing the public key when you should be passing the secret key.

Done.


toxcore/onion_client.c, line 1128 at r1 (raw file):

Previously, endoffile78 (Endoffile) wrote…

You are passing the public key when you should be passing the secret key.

Done.


toxcore/onion_client.c, line 1160 at r1 (raw file):

Previously, endoffile78 (Endoffile) wrote…

You are passing the public key when you should be passing the secret key.

Done.


Comments from Reviewable

@jhert0
Copy link
Member

jhert0 commented Jan 16, 2018

Reviewed 5 of 5 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


toxcore/onion_client.c, line 1128 at r1 (raw file):

Previously, iphydf wrote…

Done.

This one wasn't fixed.


Comments from Reviewable

@iphydf
Copy link
Member Author

iphydf commented Jan 16, 2018

Review status: 5 of 7 files reviewed at latest revision, 1 unresolved discussion.


toxcore/onion_client.c, line 1128 at r1 (raw file):

Previously, endoffile78 (Endoffile) wrote…

This one wasn't fixed.

*siiiiigh* done.

Don't do many things at the same time, especially not unrelated things. This is iphy being bad at multitasking.


Comments from Reviewable

@jhert0
Copy link
Member

jhert0 commented Jan 16, 2018

:lgtm_strong:


Reviewed 3 of 3 files at r3.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@iphydf iphydf merged commit 22db2b9 into TokTok:master Jan 16, 2018
@iphydf iphydf deleted the adt-net-crypto branch January 16, 2018 17:22
@robinlinden robinlinden changed the title Make Net_Crypto a module-private type. Make Net_Crypto a module-private type. Feb 27, 2018
@iphydf iphydf changed the title Make Net_Crypto a module-private type. Make Net_Crypto a module-private type. Feb 28, 2018
@iphydf iphydf changed the title Make Net_Crypto a module-private type. Make Net_Crypto a module-private type. Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants