Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Oct 13, 2023
1 parent 6ef2fc7 commit 9011142
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion awscrt/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __init__(self, native_handle):
self._rsa = native_handle

@staticmethod
def new_private_key_from_pem_data(pem_data: Union[str, bytes, bytearray, memoryview]) -> 'RSA' :
def new_private_key_from_pem_data(pem_data: Union[str, bytes, bytearray, memoryview]) -> 'RSA':
"""
Creates a new instance of private RSA key pair from pem data.
Raises ValueError if pem does not have private key object.
Expand Down
9 changes: 8 additions & 1 deletion source/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,14 @@ PyObject *aws_py_rsa_verify(PyObject *self, PyObject *args) {
struct aws_byte_cursor digest_cur;
struct aws_byte_cursor signature_cur;
if (!PyArg_ParseTuple(
args, "Oiy#y#", &rsa_capsule, &sign_algo, &digest_cur.ptr, &digest_cur.len, &signature_cur.ptr, &signature_cur.len)) {
args,
"Oiy#y#",
&rsa_capsule,
&sign_algo,
&digest_cur.ptr,
&digest_cur.len,
&signature_cur.ptr,
&signature_cur.len)) {
return NULL;
}

Expand Down
8 changes: 6 additions & 2 deletions source/mqtt5_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ static void s_on_publish_received(const struct aws_mqtt5_packet_publish_view *pu
/* i */ (int)(publish_packet->payload_format ? *publish_packet->payload_format : 0),
/* O */ publish_packet->message_expiry_interval_seconds ? Py_True : Py_False,
/* I */
(unsigned int)(publish_packet->message_expiry_interval_seconds ? *publish_packet->message_expiry_interval_seconds : 0),
(unsigned int)(publish_packet->message_expiry_interval_seconds
? *publish_packet->message_expiry_interval_seconds
: 0),
/* O */ publish_packet->topic_alias ? Py_True : Py_False,
/* H */ (unsigned short)(publish_packet->topic_alias ? *publish_packet->topic_alias : 0),
/* s */ publish_packet->response_topic ? publish_packet->response_topic->ptr : NULL,
Expand Down Expand Up @@ -539,7 +541,9 @@ static void s_lifecycle_event_disconnection(
/* i */ (int)(disconnect ? disconnect->reason_code : 0),
/* O */ (disconnect && disconnect->session_expiry_interval_seconds) ? Py_True : Py_False,
/* I */
(unsigned int)((disconnect && disconnect->session_expiry_interval_seconds) ? *disconnect->session_expiry_interval_seconds : 0),
(unsigned int)((disconnect && disconnect->session_expiry_interval_seconds)
? *disconnect->session_expiry_interval_seconds
: 0),
/* s */ (disconnect && disconnect->reason_string) ? disconnect->reason_string->ptr : NULL,
/* # */ (disconnect && disconnect->reason_string) ? disconnect->reason_string->len : 0,
/* O */ user_property_count > 0 ? user_properties_list : Py_None,
Expand Down

0 comments on commit 9011142

Please sign in to comment.