From b586255b0dc1d6940c4a552a7125c9875e8adba6 Mon Sep 17 00:00:00 2001 From: Benedict Date: Mon, 21 Mar 2016 23:06:08 +0100 Subject: completed set2. challenge 15 wait this is not the given order. Whaaats upp? Carzy guy! --- set2/Makefile | 6 ++++-- set2/task15.c | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 set2/task15.c (limited to 'set2') diff --git a/set2/Makefile b/set2/Makefile index b0c56a2..1f8f890 100644 --- a/set2/Makefile +++ b/set2/Makefile @@ -3,11 +3,13 @@ CC=gcc CFLAGS := -g $(CFLAGS) CLIBS=`pkg-config --cflags --libs libcrypto` -all: task9 task10 +all: task9 task10 task15 task9: $(CC) $(CFLAGS) task9.c $(LIB) $(CLIBS) -o task9 task10: $(CC) $(CFLAGS) task10.c $(LIB) $(CLIBS) -o task10 +task15: + $(CC) $(CFLAGS) task15.c $(LIB) $(CLIBS) -o task15 clean: - rm task9 task10 + rm task9 task10 task15 diff --git a/set2/task15.c b/set2/task15.c new file mode 100644 index 0000000..504eabb --- /dev/null +++ b/set2/task15.c @@ -0,0 +1,21 @@ +#include "../lib/lib2.h" + + + + +int main(int argc, char **Argv) +{ + + + char *padded_text = pkcs7_padding("YELLOW SUBMARINE", 16, 20); + char *unpadded = malloc(100); + //char *padded_text = "ICE ICE BABY\x01\x02\x03\x04"; + printf("padded text: %s\n", padded_text); + int result = valid_pkcs7_padding(padded_text, 20,unpadded, 20); + + if(result) + printf("valid padding: %s\n", unpadded); + else + printf("invalid padding\n"); + +} -- cgit v1.2.3-70-g09d2