mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
use configured scheme, not stored scheme when checking signatures
protects against notebook author choosing bad hash scheme.
This commit is contained in:
parent
6eec6fdf6e
commit
ffb3523d05
@ -214,7 +214,7 @@ class FileNotebookManager(NotebookManager):
|
||||
except Exception as e:
|
||||
raise web.HTTPError(400, u"Unreadable Notebook: %s %s" % (os_path, e))
|
||||
model['content'] = nb
|
||||
sign.mark_trusted_cells(nb, self.notary.secret)
|
||||
sign.mark_trusted_cells(nb, self.notary.secret, self.notary.scheme)
|
||||
return model
|
||||
|
||||
def save_notebook_model(self, model, name='', path=''):
|
||||
@ -239,7 +239,7 @@ class FileNotebookManager(NotebookManager):
|
||||
nb = current.to_notebook_json(model['content'])
|
||||
|
||||
if sign.check_trusted_cells(nb):
|
||||
sign.trust_notebook(nb, self.notary.secret, self.notary.signature_scheme)
|
||||
sign.trust_notebook(nb, self.notary.secret, self.notary.scheme)
|
||||
|
||||
if 'name' in nb['metadata']:
|
||||
nb['metadata']['name'] = u''
|
||||
|
Loading…
Reference in New Issue
Block a user