| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Coverage decreased (-2.2%) to 41.385% when pulling 01614ea on joeleong:add-custom-pubkey-encoding into d0be33c on google:master. |
Sorry, something went wrong.
|
Let's help this thing reach master!
Hopefully I'll be able to do it soon. |
Sorry, something went wrong.
There was a problem hiding this comment.
Started a review for adb/android_pubkey.py.
This is currently just a suggested cleanup, to increase readability for future reviews.
I will soon be inspecting the RSA-related code, with regards to:
Let me know what you think!
Sorry, something went wrong.
| def _to_bytes(n, length, endianess='big'): | ||
| """partial python2 compatibility with int.to_bytes | ||
| https://stackoverflow.com/a/20793663""" | ||
| if six.PY2: |
There was a problem hiding this comment.
Verify endianness argument:
assert endianess in ('little', 'big')
Sorry, something went wrong.
There was a problem hiding this comment.
Hey! Thanks for the review. I like your changes overall.
The only ones I'm unsure about are the size_in changes.
I'm not sure it's much clearer that way and might just be adding some unnecessary machinery, especially because it looks like its only used in two places. I'm probably open to it if you feel strongly about it, but how would you feel about leaving it the way it is, but maybe adding some comments to make it clearer?
I'll take a closer look when I get a chance and probably incorporate most/all of them.
It should be pretty easy to port to the other crypto lib but I haven't looked at it specifically.
I can help with that if you'd like.
The tests are probably most important.
Sorry, something went wrong.
|
Hi. I completely agree :) The size_in function lets you convert sizes between different units. But what if the modulus length is not a multiple of 32 or 8 bits? The size_in is a simple formula which handles these cases. Also agreed on the tests, probably most important. I'll try to get to those soon 👍 |
Sorry, something went wrong.
Co-Authored-By: Halastra <turchy@gmail.com>
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request. Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project). ℹ️ Googlers: Go here for more info. |
Sorry, something went wrong.
Implementation and some comments from the following: - [auth.cpp] (https://github.com/aosp-mirror/platform_system_core/blob/c55fab4a59cfa461857c6a61d8a0f1ae4591900c/adb/client/auth.cpp) - [android_pubkey.c] (https://github.com/aosp-mirror/platform_system_core/blob/c55fab4a59cfa461857c6a61d8a0f1ae4591900c/libcrypto_utils/android_pubkey.c) - [android_pubkey.h] (https://github.com/aosp-mirror/platform_system_core/blob/c55fab4a59cfa461857c6a61d8a0f1ae4591900c/libcrypto_utils/include/crypto_utils/android_pubkey.h) Note: It looks like [2dc4ca] (aosp-mirror/platform_system_core@2dc4cab) removes the use of the public key file and directly extracts the public key from the private key.
With help from @Halastra suggestions from code review of google#144 - Define ANDROID_RSAPUBLICKEY_STRUCT - Remove use of six package - Fix some flake8 warnings Co-Authored-By: Halastra <turchy@gmail.com>
|
I rebased and incorporated most of your suggestions in 0791b9. I also ported it to use py-cryptography instead of pycryptodome. Let me know what you think! |
Sorry, something went wrong.
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Sorry, something went wrong.
|
Well that took longer than expected.. but here goes.
Add the following code under test/test_cryptography.py: import unittest
from adb import sign_cryptography
from adb import android_pubkey
from tempfile import TemporaryDirectory
from os import path
class CryptographyTest(unittest.TestCase):
def testKeygenAndSigner(self):
private_key_file_name = 'adbkey'
with TemporaryDirectory() as temp_dir:
private_key_file_path = path.join(
temp_dir,
private_key_file_name
)
android_pubkey.keygen(private_key_file_path)
signer = sign_cryptography.CryptographySigner(private_key_file_path)
Regarding your previous notes:
Please add the above changes. I will review and approve them (promise!). |
Sorry, something went wrong.
|
Hey thanks for your suggestions! I haven't really been keeping up with this project, particularly #167 and all the stuff @JeffLIrion has been contributing, so it is a little unclear to me what the best path forward is. It's very possible his PR's could supersede this one. I'm happy to incorporate your suggestions to this PR either directly or you can maybe submit a PR to https://github.com/joeleong/python-adb/tree/add-custom-pubkey-encoding and I'll push your commits here. |
Sorry, something went wrong.
|
You are right in your observations. His work is indeed an improvement in many areas! So I guess I'll submit a PR to your repository as you suggested. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Should address #95 and #131
Note: I did update the dependencies since the pubkey code uses pycryptodome and six.
I was having problems similar to #109, so I think you need M2Crypto or rsa and pycryptodome (2 libraries). There is probably a way to implement the pubkey stuff with the other crypto libraries but I didn't bother. Happy to change things if necessary.