Skip to content

Instantly share code, notes, and snippets.

Avatar

Mathieu Leplatre leplatrem

View GitHub Profile
View verify-chain.rs
// [dependencies]
// x509-parser = "0.9"
// ring = "0.16"
// oid-registry = "0.1"
use oid_registry;
use ring::signature;
use x509_parser::{self, certificate::X509Certificate, pem::Pem};
fn verify_chain(pem_content: &[u8]) {
View rs-publish.py
import json
import os
from kinto_http import Client, BearerTokenAuth
SERVER = os.getenv("ENV", "prod")
SERVER_URL = {
"prod": "https://settings-writer.prod.mozaws.net/v1/",
"stage": "https://settings-writer.stage.mozaws.net/v1/",
View gist:58d428dae53603843659226348937aff
➜ canonicaljson-spec git:(gh-pages) ./test.sh ../canonicaljson-rs/demo/target/debug/demo
malformed/empty OK
malformed/hex_number OK
malformed/invalid_string_character OK
malformed/invalid_string_escape OK
malformed/invalid_string_unicode_escape OK
malformed/leading_plus_number OK
malformed/leading_zero_number OK
malformed/missing_array_element OK
malformed/missing_integer_number OK
View Cargo.toml
[package]
name = "contentsig"
version = "0.1.0"
authors = ["Mathieu Leplatre <mathieu@mozilla.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
base64 = "0.11.0"
View verifysig.py
import base64
import ecdsa
import requests
import cryptography.x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.hashes import SHA384
from cryptography.hazmat.primitives.asymmetric import ec as cryptography_ec
from cryptography.hazmat.primitives.asymmetric.utils import encode_dss_signature
View Arpit_Bharti_GSoC_2019_Report.md

Arpit Bharti - GSoC 2019 Progress Report

Project - Ship the Public Suffix List (PSL) over Remote Settings

Organization - Mozilla

Project Mentor - Mathieu Leplatre

Summary

View kinto-offline-client.js
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@leplatrem
leplatrem / 0.md
Last active Jul 5, 2019
notes for Bug 1563226
View 0.md
View gist:88b6bbf48c7a7abdd3e9b9b16b38eaf4
make up
docker-compose kill
./scripts/build.sh
Sending build context to Docker daemon 17.66MB
Step 1/11 : FROM python:3.6
---> 4f13b7f2138e
Step 2/11 : ENV PYTHONDONTWRITEBYTECODE 1
---> Using cache
---> 9db6e2d323b4
Step 3/11 : WORKDIR /app
View merge.py
import os
from github import Github
WITH_BORS = [("mozilla-services", "kinto-dist")]
def main():
g = Github(os.getenv("TOKEN"))