This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
char secret[32]; | |
char public[32]; | |
void print_strings(char *buffer, int len) { | |
for (int i=0; i<len; i++) { | |
if (buffer[i] != 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE' | |
classpath 'org.owasp:dependency-check-gradle:3.1.2' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is a dockerfile which builds picotls, and start a local TLS 1.3 server | |
# | |
# the following commands build a docker image | |
# | |
# $ docker build --file Dockerfile --tag picotls/server/tls13 . | |
# | |
# the following command starts a local picotls server | |
# | |
# $ docker run -p 20101:20101 picotls/server/tls13 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git clone https://github.com/h2o/picotls | |
cd picotls | |
export CFLAGS="-fprofile-arcs -ftest-coverage -g -O0 -fsanitize=address -fno-omit-frame-pointer" | |
export LDFLAGS="-fsanitize=address" | |
cmake \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/t/cli.c b/t/cli.c | |
index 8d9b68b..99cc4ab 100644 | |
--- a/t/cli.c | |
+++ b/t/cli.c | |
@@ -19,6 +19,11 @@ | |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
* IN THE SOFTWARE. | |
*/ | |
+ | |
+/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class SecurityConfiguration extends WebSecurityConfigurerAdapter { | |
private static final String readScope = "#oauth2.isOAuth() && #oauth2.hasScope('read')"; | |
@Bean | |
@Override | |
public AuthenticationManager authenticationManagerBean() throws Exception { | |
return super.authenticationManagerBean(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gypsyengineer.innerclass.field; | |
public class Outer { | |
private int secret = 10; | |
public void check() { | |
if (secret < 0) { | |
System.out.println("Oops"); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class A { | |
private int secret; | |
public class B { | |
public go() { | |
// do something | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gypsyengineer.innerclass.field; | |
public class AccessPrivateField { | |
public static void test01() throws Exception { | |
System.out.println("Test #1: try to modify a private field with the same classloader"); | |
System.out.println(" (no exception is expected, 'oops' should be printed out)"); | |
Outer outer = new Outer(); | |
go(outer); | |
outer.check(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gypsyengineer.innerclass.field; | |
public class AccessPrivateField { | |
public static void test02(ClassLoader cl) throws Exception { | |
System.out.println("Test #2: try to modify a private field with different classloader"); | |
System.out.println(" (an exception is expected)"); | |
// Load AccessPrivateField class with different classloader | |
Class clazz = cl.loadClass( | |
"com.gypsyengineer.innerclass.field.AccessPrivateField"); |