Skip to content

Instantly share code, notes, and snippets.

View bagder's full-sized avatar
⌨️
mostly typos

Daniel Stenberg bagder

⌨️
mostly typos
View GitHub Profile
@bagder
bagder / output.txt
Created December 29, 2022 08:18
pytest in tests/httpd (WITH apache2-dev installed)
cd tests/httpd
$ pytest
===================================== test session starts =====================================
platform linux -- Python 3.10.9, pytest-7.2.0, pluggy-1.0.0+repack
httpd: [/usr/sbin/apache2]
rootdir: /home/daniel/src/curl/tests/httpd
collected 0 items / 1 error
=========================================== ERRORS ============================================
______________________________ ERROR collecting test_01_basic.py ______________________________
@bagder
bagder / output.txt
Last active December 29, 2022 08:17
pytest in tests/httpd (without apache2-dev installed)
$ cd tests/httpd/
$ pytest
===================================== test session starts =====================================
platform linux -- Python 3.10.9, pytest-7.2.0, pluggy-1.0.0+repack
httpd: [/usr/sbin/apache2]
rootdir: /home/daniel/src/curl/tests/httpd
collected 0 items / 1 error
=========================================== ERRORS ============================================
______________________________ ERROR collecting test_01_basic.py ______________________________
@bagder
bagder / hackerone-annoyances.md
Last active December 22, 2022 14:07
hackerone annoyances

HackerOne feedback

The site is slow

Going to the page and render it can take many seconds, even on a powerful machine with fast Internet.

Sometimes it seems that clicking on a notification does nothing and you have to reload the page.

@bagder
bagder / audit-response.md
Last active December 21, 2022 13:21
The curl security-team's response to the curl security audit remarks December 2022

Proxy credentials are cached without encryption (TOB-CURLTM-1)

The subject was brought up for discussion on the mailing list: https://curl.se/mail/lib-2022-09/0149.html - no actual changes for this have been made.

Lack of support for MQTT over TLS (TOB-CURLTM-2)

This remains an outstanding TODO. MQTT is a little used protocol in curl and this (MQTT over TLS) has not appeared much as a wanted feature.

No warnings when TLS connection attempts fail with the --ssl flag (TOB-CURLTM-3)

@bagder
bagder / base64decode.c
Created December 5, 2022 09:19
base64 decode performance test
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
#define F "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\x01\xff"
#define F2 F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F
int main(void)
{
printf("%s\n", curl_version());
@bagder
bagder / base64encoder.c
Created December 4, 2022 22:29
base64 emcoding test program
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
#define F "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\x01\xff"
#define F2 F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F
#define F3 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2
#define F4 F3 F3
int main(void)
@bagder
bagder / output.txt
Last active December 2, 2022 12:37
curl -w %{certs}
curl [master]$ ./src/curl -w '%{certs}\n' https://curl.se/ -s -o /dev/null
Subject:CN = curl.se
Issuer:C = US, O = Let's Encrypt, CN = R3
Version:2
Serial Number:03439cffb072ac0cf6e9e08c4cf8b12fca6a
Signature Algorithm:sha256WithRSAEncryption
Public Key Algorithm:rsaEncryption
X509v3 Key Usage:Digital Signature, Key Encipherment
X509v3 Extended Key Usage:TLS Web Server Authentication, TLS Web Client Authentication
@bagder
bagder / boringbuild.sh
Created December 1, 2022 14:28
build boringssl for curl
#!/bin/sh
CXX=g++ CC=gcc cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1 && cmake --build build
mkdir -p lib
cp ./build/crypto/libcrypto.so ./lib/
cp ./build/ssl/libssl.so ./lib/
cmake --build build --target clean
rm -f build/CMakeCache.txt
CXX="g++" CC="gcc" cmake -H. -Bbuild -GNinja -DCMAKE_POSITION_INDEPENDENT_CODE=on && cmake --build build
@bagder
bagder / speedparse.c
Last active September 6, 2022 14:01
speedparse -- bechmark the the libcurl URL parser
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2022, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
@bagder
bagder / URLs.txt
Last active July 19, 2022 15:16
CA cert bundle PEM files from the past
https://curl.se/ca/cacert-2016-01-20.pem
https://curl.se/ca/cacert-2016-04-20.pem
https://curl.se/ca/cacert-2016-09-07.pem
https://curl.se/ca/cacert-2016-09-14.pem
https://curl.se/ca/cacert-2016-11-02.pem
https://curl.se/ca/cacert-2017-01-18.pem
https://curl.se/ca/cacert-2017-06-07.pem
https://curl.se/ca/cacert-2017-09-20.pem
https://curl.se/ca/cacert-2018-01-17.pem
https://curl.se/ca/cacert-2018-03-07.pem