Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nonexistent committed Feb 8, 2019
1 parent fa88601 commit 6eeb89c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions oregano/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ def sign_raw_pkcs1(key, data):
errors = backend._consume_errors()
backend.openssl_assert(errors[0].lib == backend._lib.ERR_LIB_RSA)

if (
errors[0].reason ==
backend._lib.RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE
):
if (errors[0].reason ==
backend._lib.RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE):
reason = "Data too long for key size."
else:
reason = "RSA_private_encrypt error."
Expand Down
12 changes: 7 additions & 5 deletions oregano/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@
sign_router_descriptor,
NTorKey
)
from oregano.onion import *
from oregano.onion import (
check_nickname,
ORError,
ORConnImpl,
CircuitManager
)

HASH_LEN = 20
CURVE25519_KEY_LEN = 32

PLATFORM = "Oregano {version}".format(version=oregano.__version__)
DESCRIPTOR_TEMPLATE = '''
Expand Down Expand Up @@ -184,8 +188,7 @@ def set_handler(self):
if hasattr(self.config, "handler") and self.config.handler is not None:
self.handler = self.config.handler
else:
from oregano.handler import DefaultHandler
self.handler = DefaultHandler
self.handler = oregano.handler.DefaultHandler

def make_handler(self, link):
return self.handler(link)
Expand Down Expand Up @@ -424,7 +427,6 @@ def sigint_received(*args):
for server in servers:
server.shutdown()

import sys
sys.exit(0)

for key, setting in settings.items():
Expand Down

0 comments on commit 6eeb89c

Please sign in to comment.