Skip to content

Commit

Permalink
log
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Nov 19, 2024
1 parent 57f35a5 commit 87720d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions source/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ PyObject *aws_py_rsa_public_key_from_der_data(PyObject *self, PyObject *args) {

size_t decoded_len = 0;
if (aws_base64_compute_decoded_len(&der_data_cur, &decoded_len)) {
PyErr_AwsLastError();
//PyErr_AwsLastError();
PyErr_Format(PyExc_ValueError, "Invalid len %zu", der_data_cur.len);
goto on_done;
}

Expand All @@ -433,7 +434,8 @@ PyObject *aws_py_rsa_public_key_from_der_data(PyObject *self, PyObject *args) {
struct aws_rsa_key_pair *key_pair = aws_rsa_key_pair_new_from_public_key_pkcs1(allocator, raw_der);

if (key_pair == NULL) {
PyErr_AwsLastError();
//PyErr_AwsLastError();
PyErr_Format(PyExc_ValueError, "Invalid len decoded %zu", decoded_len);
goto on_done;
}

Expand Down
9 changes: 7 additions & 2 deletions test/test_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@
'xgMJci1Irh66xVZQ9aT2OZwb0TXglULm+b8HM+GKHgoTMwr9gAGpFDoYi22PvxC/'
'cqKHKIaYw7KNOPwImzQ6cp5oQJTAPQKRUwIDAQAB')

RSA_PUBLIC_KEY_DER_BOTO3 = 'MIIBCgKCAQEAmC9Sp2vAK8r/B+5SvW4iMwU1wqwMISzuJqsFLLp6b/shkeDSN+quDFn2ngSyd4dzut0Uk2/hshFWQhXhutmrnHZf4jx2ri1IAEV3f8/f8o/sajMtupD5HTltyXhQIL8Dzcprq4GyXYKAhD+W9O3GDUuMnP6aTbjMO2kOmE4GedA+RU+9L3AI/CFg5zgnzpQ3CCnCxrDK/ARaE4mB5L6BvqzkyEo6jGi1OdJgWF/rJGNud2mjsDh95LmN+i0XGqDqw+3m4AyRBzerSMnM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