From e82eace59d11649e4063f0402c71470e67e870d7 Mon Sep 17 00:00:00 2001 From: tom_win Date: Sun, 10 May 2020 12:09:08 +0200 Subject: [PATCH] refaktorizacia rs232 i/o a posielanie velkych suborov --- kniznica/komunikacia.c | 252 ++++++++++++++++---------- kniznica/kryptografia.c | 64 +++++-- kniznica/kryptografia.h | 6 +- readme.txt | 2 +- rs232_kanal/klient/klient.c | 4 +- rs232_kanal/klient/obr.jpg | Bin 14242 -> 0 bytes rs232_kanal/klient/spustit_klient.bat | 2 +- rs232_kanal/server/obr.jpg | Bin 14242 -> 0 bytes rs232_kanal/server/server.c | 8 +- tcpip_kanal/klient/obr.jpg | Bin 14242 -> 0 bytes tcpip_kanal/klient/spustit_klient.bat | 2 +- tcpip_kanal/server/obr.jpg | Bin 14242 -> 0 bytes 12 files changed, 216 insertions(+), 124 deletions(-) delete mode 100644 rs232_kanal/klient/obr.jpg delete mode 100644 rs232_kanal/server/obr.jpg delete mode 100644 tcpip_kanal/klient/obr.jpg delete mode 100644 tcpip_kanal/server/obr.jpg diff --git a/kniznica/komunikacia.c b/kniznica/komunikacia.c index 4e17ae3..ab20931 100644 --- a/kniznica/komunikacia.c +++ b/kniznica/komunikacia.c @@ -58,6 +58,11 @@ int poslat_subor(WOLFSSL* ssl, WOLFSSL_CTX* ctx, const char* cesta, nastavenia_a //nastavi ukazovatel na zaciatok suboru //a nacita data zo suboru do pola unsigned char* pole = calloc(velkost, sizeof(unsigned char)); + if(pole == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre pole\n"); + return -1; + } fseek(subor, 0, SEEK_SET); fread((unsigned char*)pole, 1, velkost, subor); @@ -65,7 +70,7 @@ int poslat_subor(WOLFSSL* ssl, WOLFSSL_CTX* ctx, const char* cesta, nastavenia_a uspech = 0; while(uspech < velkost) { - uspech = wolfSSL_write(ssl, (unsigned char*)pole, velkost); + uspech = wolfSSL_write(ssl, pole, velkost); if(uspech <= 0) { fprintf(stderr, "Nastala chyba pri posielani suboru.\n"); @@ -75,23 +80,17 @@ int poslat_subor(WOLFSSL* ssl, WOLFSSL_CTX* ctx, const char* cesta, nastavenia_a printf("Subor bol uspesne odoslany.\n"); //generovanie a poslanie kontrolneho suctu serveru pre kontrolu - byte* kontrolny_sucet; + unsigned char* kontrolny_sucet; int velkost_kontrolneho_suctu; - kontrolny_sucet = generovat_kontrolny_sucet_suboru(nastavenia, cesta, &velkost_kontrolneho_suctu); + kontrolny_sucet = generovat_kontrolny_sucet_suboru(nastavenia, cesta, velkost, &velkost_kontrolneho_suctu); uspech = 0; while(uspech < velkost_kontrolneho_suctu) { uspech = wolfSSL_write(ssl, kontrolny_sucet, velkost_kontrolneho_suctu); - if(uspech <= 0) - { - fprintf(stderr, "Nastala chyba pri posielani kontrolneho suctu.\n"); - return -1; - } } free(kontrolny_sucet); fclose(subor); - free(pole); return 0; } } @@ -141,27 +140,36 @@ int prijat_subor(WOLFSSL* ssl, WOLFSSL_CTX* ctx, nastavenia_aplikacie* nastaveni //prijem jednotlivych bajtov unsigned char* pole = calloc(velkost, sizeof(unsigned char)); - uspech = 0; - while(uspech < velkost) + if(pole == NULL) { - uspech = wolfSSL_read(ssl, (unsigned char*)pole, velkost); + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre pole\n"); + return -1; + } + unsigned char* pole_uk = pole; + + uspech = 0; + for(int i = 0; i < (velkost/16384) + 1; ++i) + { + uspech = wolfSSL_read(ssl, pole_uk, velkost); + pole_uk += 16384; if(uspech <= 0) - { - fprintf(stderr, "Nastala chyba pri prijatii suboru.\n"); - return -1; - } + { + fprintf(stderr, "Nastala chyba pri posielani suboru.\n"); + return -1; + } } printf("Subor bol uspesne prijaty.\n"); //vypocet vlastneho kontrolneho suctu - byte* kontrolny_sucet; + unsigned char* kontrolny_sucet; int velkost_kontrolneho_suctu; FILE *subor = fopen(cesta, "wb+"); int n = fwrite((unsigned char*)pole, 1, velkost, subor); fclose(subor); - kontrolny_sucet = generovat_kontrolny_sucet_suboru(nastavenia, cesta, &velkost_kontrolneho_suctu); + + kontrolny_sucet = generovat_kontrolny_sucet_suboru(nastavenia, cesta, velkost, &velkost_kontrolneho_suctu); //prijem hashu, ktory vypocital server char* prijaty_kontrolny_sucet = calloc(velkost_kontrolneho_suctu, sizeof(char)); @@ -189,11 +197,7 @@ int prijat_subor(WOLFSSL* ssl, WOLFSSL_CTX* ctx, nastavenia_aplikacie* nastaveni printf("Subor neprisiel v poriadku alebo neboli pouzite rovnake funkcie.\n"); return -1; } - - char*data = calloc(100, sizeof(char)); - uspech = wolfSSL_read(ssl, data, 100); - free(data); - + free(cesta); free(velkost_suboru); free(kontrolny_sucet); @@ -345,8 +349,7 @@ int rs232_odoslat_spravu(int cislo_rozhrania, char* sprava, int velkost_spravy) int odoslane_data = 0; //kontrolne vzory, ktore jednoznacne identifikuju zaciatok a koniec spravy - unsigned char zaciatok_spravy[] = {0xAA, 0xAA, 0xAA, 0xAA}; - unsigned char koniec_spravy[] = {0xBB, 0xBB, 0xBB, 0xBB}; + unsigned char kontrolny_vzor[] = {0xAA, 0xAA, 0xAA, 0xAA}; //vytvorenie bajtov ktore budu niest informaciu o velkosti posielanej spravy unsigned char* velkost_spravy_hex = calloc(4, sizeof(unsigned char)); @@ -354,30 +357,60 @@ int rs232_odoslat_spravu(int cislo_rozhrania, char* sprava, int velkost_spravy) velkost_spravy_hex[1] = (velkost_spravy >> 16) & 0xFF; velkost_spravy_hex[2] = (velkost_spravy >> 8) & 0xFF; velkost_spravy_hex[3] = velkost_spravy & 0xFF; + + //vypocet kontrolneho suctu spravy + unsigned int kontrolny_sucet = crc32(0L, Z_NULL, 0); + if(velkost_spravy < 10) + { + kontrolny_sucet = crc32(kontrolny_sucet, (char*)sprava, velkost_spravy); + } + else + { + kontrolny_sucet = crc32(kontrolny_sucet, (char*)sprava, 10); + } + + //vytvorenie bajtov ktore budu niest informaciu s kontrolnym suctom posielanej spravy + unsigned char* kontrolny_sucet_hex = calloc(4, sizeof(unsigned char)); + kontrolny_sucet_hex[0] = (kontrolny_sucet >> 24) & 0xFF; + kontrolny_sucet_hex[1] = (kontrolny_sucet >> 16) & 0xFF; + kontrolny_sucet_hex[2] = (kontrolny_sucet >> 8) & 0xFF; + kontrolny_sucet_hex[3] = kontrolny_sucet & 0xFF; - //odoslanie kontrolnych vzorov, bajtov s velkostou spravy a samotnych dat na seriove rozhranie - uspech = RS232_SendBuf(cislo_rozhrania, (unsigned char*)zaciatok_spravy, sizeof(zaciatok_spravy)); + //odoslanie kontrolneho vzoru + uspech = RS232_SendBuf(cislo_rozhrania, (unsigned char*)kontrolny_vzor, 4); if(uspech <= 0) { fprintf(stderr, "Nastala chyba pri odoslani kontrolneho vzoru\n"); return -1; } + + //odoslanie velkosti spravy uspech = RS232_SendBuf(cislo_rozhrania, (unsigned char*)velkost_spravy_hex, 4); if(uspech <= 0) { - fprintf(stderr, "Nastala chyba pri odoslani kontrolneho vzoru\n"); + fprintf(stderr, "Nastala chyba pri odoslani velkosti spravy\n"); return -1; } - odoslane_data = (int)RS232_SendBuf(cislo_rozhrania, (unsigned char*)sprava, velkost_spravy); - RS232_SendBuf(cislo_rozhrania, (unsigned char*)koniec_spravy, sizeof(koniec_spravy)); + + //odoslanie kontrolneho suctu + uspech = RS232_SendBuf(cislo_rozhrania, (unsigned char*)kontrolny_sucet_hex, 4); if(uspech <= 0) { - fprintf(stderr, "Nastala chyba pri odoslani kontrolneho vzoru\n"); + fprintf(stderr, "Nastala chyba pri odoslani kontrolneho suctu\n"); + return -1; + } + + //odoslanie dat + odoslane_data = RS232_SendBuf(cislo_rozhrania, (unsigned char*)sprava, velkost_spravy); + if(odoslane_data <= 0 || odoslane_data != velkost_spravy) + { + fprintf(stderr, "Nastala chyba pri odoslani dat\n"); return -1; } free(velkost_spravy_hex); - + free(kontrolny_sucet_hex); + return odoslane_data; } int rs232_prijat_spravu(int cislo_rozhrania, const char* komunikacny_subor) @@ -387,103 +420,124 @@ int rs232_prijat_spravu(int cislo_rozhrania, const char* komunikacny_subor) FILE* subor = fopen(komunikacny_subor, "ab+"); int uspech = 0; - int prebieha_nacitanie = 0; int prebieha_nacitanie_velkosti_spravy = 0; + int prebieha_nacitanie_kontrolneho_suctu = 0; + int prebieha_nacitanie_dat = 0; unsigned char znak; //mnozstvo nacitanych dat int nacitane_data = 0; + //velkost spravy, ktora sa bude prijmat int velkost_spravy = 0; + unsigned char velkost_spravy_hex[4]; //urcuje kolko bajtov z informacie o velkosti spravy //uz bolo prijatych z celkoveho poctu (4) - int velkost_spravy_bajt = 0; - int velkost_spravy_pocet_bajtov = 4; + int velkost_spravy_pozicia = 0; - //kontrolne vzory, ktore jednoznacne identifikuju zaciatok a koniec spravy - unsigned char zaciatok_spravy[] = {0xAA, 0xAA, 0xAA, 0xAA}; - int zaciatok_spravy_pozicia = 0; //aktualna pozicia v kontrolnom vzore - unsigned char koniec_spravy[] = {0xBB, 0xBB, 0xBB, 0xBB}; - int koniec_spravy_pozicia = 0; //aktualna pozicia v kontrolnom vzore - int velkost_kontrolneho_vzoru = sizeof(zaciatok_spravy)/sizeof(zaciatok_spravy[0]); + //kontrolny sucet, ktory sa bude prijimat + int kontrolny_sucet = 0; + unsigned char kontrolny_sucet_hex[4]; + //urcuje kolko bajtov z kontrolneho suctu + //uz bolo prijatych z celkoveho poctu (4) + int kontrolny_sucet_pozicia = 0; + + unsigned char* prijate_data; + + //kontrolny vzor ktory jednoznacne identifikuje zaciatok spravy + unsigned char kontrolny_vzor[] = {0xAA, 0xAA, 0xAA, 0xAA}; + int kontrolny_vzor_pozicia = 0; //aktualna pozicia v kontrolnom vzore + int velkost_kontrolneho_vzoru = sizeof(kontrolny_vzor)/sizeof(kontrolny_vzor[0]); while(1) { uspech = RS232_PollComport(cislo_rozhrania, &znak, 1); if(uspech > 0) { - //ak nacitanie spravy este nezacalo, ale bol najdeny bajt, ktory je sucastou kontrolneho vzoru, - //ktory urcuje zaciatok spravy, posun sa v kontrolnom vzore o jednu poziciu a cakaj ci nebudu - //prichadzat dalsie bajty z tohto kontrolneho vzoru - if(!prebieha_nacitanie && (znak == zaciatok_spravy[zaciatok_spravy_pozicia]) && - (zaciatok_spravy_pozicia < velkost_kontrolneho_vzoru - 1)) + //nacitanie kontrolneho vzoru + if(!prebieha_nacitanie_velkosti_spravy && !prebieha_nacitanie_dat && !prebieha_nacitanie_kontrolneho_suctu && + znak == kontrolny_vzor[kontrolny_vzor_pozicia]) { - zaciatok_spravy_pozicia++; - } - //ak prebehlo nacitanie vsetkych bajtov, ktore su sucastou kontrolneho vzoru urcujuceho zaciatok spravy - //ocakavaj prichod bajtov, ktore budu niest informaciu o velkosti spravy - else if(!prebieha_nacitanie && (znak == zaciatok_spravy[zaciatok_spravy_pozicia]) && - (zaciatok_spravy_pozicia == velkost_kontrolneho_vzoru - 1)) - { - prebieha_nacitanie_velkosti_spravy = 1; - zaciatok_spravy_pozicia = 0; - } - //pokracuj v nacitavani bajtov urcujucich velkost spravy, dokym nie su vsetky nacitane - //a po nacitani vsetkych bajtov moze zacat nacitanie spravy - else if(!prebieha_nacitanie && prebieha_nacitanie_velkosti_spravy) - { - velkost_spravy_bajt++; - if(velkost_spravy_bajt == velkost_spravy_pocet_bajtov) + kontrolny_vzor_pozicia++; + if(kontrolny_vzor_pozicia == 4) { - prebieha_nacitanie = 1; + prebieha_nacitanie_velkosti_spravy = 1; + kontrolny_vzor_pozicia = 0; + } + } + //nacitanie velkosti spravy + else if(!prebieha_nacitanie_dat && prebieha_nacitanie_velkosti_spravy) + { + velkost_spravy_hex[velkost_spravy_pozicia] = znak; + velkost_spravy_pozicia++; + if(velkost_spravy_pozicia == 4) + { + velkost_spravy = (uint32_t)velkost_spravy_hex[0] << 24 | (uint32_t)velkost_spravy_hex[1] << 16 | + (uint32_t)velkost_spravy_hex[2] << 8 | (uint32_t)velkost_spravy_hex[3]; + prebieha_nacitanie_kontrolneho_suctu = 1; + prebieha_nacitanie_velkosti_spravy = 0; + + prijate_data = calloc(velkost_spravy, sizeof(unsigned char)); + if(prijate_data == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre prijate_data\n"); + return -1; + } + } + } + //nacitanie kontrolneho vzoru + else if(!prebieha_nacitanie_dat && prebieha_nacitanie_kontrolneho_suctu) + { + kontrolny_sucet_hex[kontrolny_sucet_pozicia] = znak; + kontrolny_sucet_pozicia++; + if(kontrolny_sucet_pozicia == 4) + { + kontrolny_sucet = (uint32_t)kontrolny_sucet_hex[0] << 24 | (uint32_t)kontrolny_sucet_hex[1] << 16 | + (uint32_t)kontrolny_sucet_hex[2] << 8 | (uint32_t)kontrolny_sucet_hex[3]; + prebieha_nacitanie_dat = 1; prebieha_nacitanie_velkosti_spravy = 0; } } - //ak prebieha nacitanie a bol najdeny bajt, ktory je sucastou kontrolneho vzoru, ktory urcuje koniec spravy, - //posun sa v kontrolnom vzore o jednu poziciu a cakaj ci nebudu prichadzat dalsie bajty z tohto kontrolneho vzoru - else if((prebieha_nacitanie && (znak == koniec_spravy[koniec_spravy_pozicia]) && - (koniec_spravy_pozicia == 0)) || (!prebieha_nacitanie && (znak == koniec_spravy[koniec_spravy_pozicia]) && - (koniec_spravy_pozicia < velkost_kontrolneho_vzoru - 1))) - { - koniec_spravy_pozicia++; - prebieha_nacitanie = 0; - } - //v pripade ak zacalo nacitanie kontrolneho vzoru, ktory urcuje koniec spravy, ale nebol najdeny posledny znak z tohto vzoru - //nacitaj do suboru docasne nezapisane znaky, ktore su sucastou kontrolneho vzoru a zaroven nacitaj aktualny znak - else if(!prebieha_nacitanie_velkosti_spravy && !prebieha_nacitanie && znak != koniec_spravy[koniec_spravy_pozicia]) - { - for(int i = 0; i < koniec_spravy_pozicia; i++) - { - fwrite((char*)&koniec_spravy[i], 1, uspech, subor); - nacitane_data += uspech; - } - fwrite((char*)&znak, 1, uspech, subor); - nacitane_data += uspech; - - koniec_spravy_pozicia = 0; - prebieha_nacitanie = 1; - } - //ak prebehlo nacitanie vsetkych bajtov, ktore su sucastou kontrolneho vzoru urcujuceho koniec spravy - //ukonci nacitanie spravy - else if(!prebieha_nacitanie_velkosti_spravy && !prebieha_nacitanie && (znak == koniec_spravy[0]) && - (koniec_spravy_pozicia == 3)) - { - prebieha_nacitanie = 0; - koniec_spravy_pozicia = 0; - break; - } - //inak prebieha nacitanie, cize zapis aktualny znak (bajt) do suboru + //nacitanie dat else { - if(prebieha_nacitanie && !prebieha_nacitanie_velkosti_spravy) + if(prebieha_nacitanie_dat) { - fwrite((char*)&znak, 1, uspech, subor); + prijate_data[nacitane_data] = znak; nacitane_data += uspech; + if(nacitane_data == velkost_spravy) break; } } } } + + //kontrola integrity prijatej spravy + //vypocet kontrolneho suctu prijatej spravy + unsigned int kontrolny_sucet_ps = crc32(0L, Z_NULL, 0); + if(velkost_spravy < 10) + { + kontrolny_sucet_ps = crc32(kontrolny_sucet_ps, (char*)prijate_data, velkost_spravy); + } + else + { + kontrolny_sucet_ps = crc32(kontrolny_sucet_ps, (char*)prijate_data, 10); + } + + //porovnanie kontrolnych suctov + if(kontrolny_sucet_ps == kontrolny_sucet) + { + //ak sprava prisla v poriadku zapis nacitane data do suboru + fwrite((char*)prijate_data, 1, nacitane_data, subor); + } + else + { + printf("Sprava neprisla v poriadku"); + return -1; + } + + free(prijate_data); fclose(subor); + return nacitane_data; } diff --git a/kniznica/kryptografia.c b/kniznica/kryptografia.c index 757d662..919e9ac 100644 --- a/kniznica/kryptografia.c +++ b/kniznica/kryptografia.c @@ -559,12 +559,12 @@ void zobraz_certifikat(WOLFSSL* ssl) X509_free(certifikat); } -unsigned char* generovat_kontrolny_sucet_suboru(nastavenia_aplikacie* nastavenia, const char* cesta, int* velkost) +unsigned char* generovat_kontrolny_sucet_suboru(nastavenia_aplikacie* nastavenia, const char* cesta, int velkost_suboru, int* velkost) { int pocet_bajtov; FILE* subor = fopen(cesta, "rb"); - unsigned char data[VELKOST_SUBORU]; - memset(data, 0, VELKOST_SUBORU); + unsigned char data[velkost_suboru]; + memset(data, 0, velkost_suboru); unsigned char* vysledok; if(!strcmp(nastavenia->typ_vypoctu, "crc")) { @@ -572,6 +572,11 @@ unsigned char* generovat_kontrolny_sucet_suboru(nastavenia_aplikacie* nastavenia { *velkost = CRC32_VELKOST; vysledok = calloc(CRC32_VELKOST, sizeof(unsigned char)); + if(vysledok == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre vysledok\n"); + return NULL; + } unsigned int crc = crc32(0L, Z_NULL, 0); crc = crc32(crc, data, 10); sprintf(vysledok, "%u", crc); @@ -588,9 +593,14 @@ unsigned char* generovat_kontrolny_sucet_suboru(nastavenia_aplikacie* nastavenia { *velkost = SHA_DIGEST_SIZE; vysledok = calloc(SHA_DIGEST_SIZE, sizeof(unsigned char)); + if(vysledok == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre vysledok\n"); + return NULL; + } Sha sha; wc_InitSha(&sha); - while ((pocet_bajtov = fread (data, 1, VELKOST_SUBORU, subor)) != 0) + while ((pocet_bajtov = fread (data, 1, velkost_suboru, subor)) != 0) wc_ShaUpdate(&sha, data, pocet_bajtov); wc_ShaFinal(&sha, vysledok); } @@ -598,9 +608,14 @@ unsigned char* generovat_kontrolny_sucet_suboru(nastavenia_aplikacie* nastavenia { *velkost = SHA224_DIGEST_SIZE; vysledok = calloc(SHA224_DIGEST_SIZE, sizeof(unsigned char)); + if(vysledok == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre vysledok\n"); + return NULL; + } Sha224 sha; wc_InitSha224(&sha); - while ((pocet_bajtov = fread (data, 1, VELKOST_SUBORU, subor)) != 0) + while ((pocet_bajtov = fread (data, 1, velkost_suboru, subor)) != 0) wc_Sha224Update(&sha, data, pocet_bajtov); wc_Sha224Final(&sha, vysledok); } @@ -608,49 +623,70 @@ unsigned char* generovat_kontrolny_sucet_suboru(nastavenia_aplikacie* nastavenia { *velkost = SHA256_DIGEST_SIZE; vysledok = calloc(SHA256_DIGEST_SIZE, sizeof(unsigned char)); + if(vysledok == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre vysledok\n"); + return NULL; + } Sha256 sha; wc_InitSha256(&sha); - while ((pocet_bajtov = fread (data, 1, VELKOST_SUBORU, subor)) != 0) + while ((pocet_bajtov = fread (data, 1, velkost_suboru, subor)) != 0) wc_Sha256Update(&sha, data, pocet_bajtov); wc_Sha256Final(&sha, vysledok); } else if(nastavenia->h_funkcia == funkcia_SHA384) { *velkost = SHA384_DIGEST_SIZE; - vysledok = calloc(SHA384_DIGEST_SIZE, sizeof(unsigned char)); + if(vysledok == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre vysledok\n"); + return NULL; + } Sha384 sha; wc_InitSha384(&sha); - while ((pocet_bajtov = fread (data, 1, VELKOST_SUBORU, subor)) != 0) + while ((pocet_bajtov = fread (data, 1, velkost_suboru, subor)) != 0) wc_Sha384Update(&sha, data, pocet_bajtov); wc_Sha384Final(&sha, vysledok); } else if(nastavenia->h_funkcia == funkcia_SHA512) { *velkost = WC_SHA512_DIGEST_SIZE; - vysledok = calloc(WC_SHA512_DIGEST_SIZE, sizeof(unsigned char)); + if(vysledok == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre vysledok\n"); + return NULL; + } wc_Sha512 sha; wc_InitSha512(&sha); - while ((pocet_bajtov = fread (data, 1, VELKOST_SUBORU, subor)) != 0) + while ((pocet_bajtov = fread (data, 1, velkost_suboru, subor)) != 0) wc_Sha512Update(&sha, data, pocet_bajtov); wc_Sha512Final(&sha, vysledok); } else if(nastavenia->h_funkcia == funkcia_BLAKE2B) { *velkost = BLAKE2B_VELKOST; - vysledok = calloc(BLAKE2B_VELKOST, sizeof(unsigned char)); + if(vysledok == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre vysledok\n"); + return NULL; + } Blake2b b2b; wc_InitBlake2b(&b2b, BLAKE2B_VELKOST); - while ((pocet_bajtov = fread (data, 1, VELKOST_SUBORU, subor)) != 0) + while ((pocet_bajtov = fread (data, 1, velkost_suboru, subor)) != 0) wc_Blake2bUpdate(&b2b, data, pocet_bajtov); wc_Blake2bFinal(&b2b, vysledok, BLAKE2B_VELKOST); } else if(nastavenia->h_funkcia == funkcia_RIPEMD160) { *velkost = RIPEMD_DIGEST_SIZE; - vysledok = calloc(RIPEMD_DIGEST_SIZE, sizeof(unsigned char)); + if(vysledok == NULL) + { + fprintf(stderr, "Nepodarilo sa dynamicky alokovat pamat pre vysledok\n"); + return NULL; + } RipeMd ripemd; wc_InitRipeMd(&ripemd); - while ((pocet_bajtov = fread (data, 1, VELKOST_SUBORU, subor)) != 0) + while ((pocet_bajtov = fread (data, 1, velkost_suboru, subor)) != 0) wc_RipeMdUpdate(&ripemd, data, pocet_bajtov); wc_RipeMdFinal(&ripemd, vysledok); } diff --git a/kniznica/kryptografia.h b/kniznica/kryptografia.h index 85b97fe..3093fcc 100644 --- a/kniznica/kryptografia.h +++ b/kniznica/kryptografia.h @@ -27,7 +27,6 @@ #include #define VELKOST_BUFFERA 4096 -#define VELKOST_SUBORU 10000 #define CRC32_VELKOST 10 #define BLAKE2B_VELKOST 64 @@ -70,14 +69,15 @@ typedef struct nastavenia_aplikacie { * generovat_kontrolny_sucet_suboru: realizuje vypocet kontrolneho suctu zo suboru, ktoreho lokacia je predana v argumente * @parameter char* funkcia : nazov funkcie pre vypocet kontrolneho suctu * @parameter char* cesta : lokacia suboru - * @parameter int* velkost : uklada velkost kontrolneho suctu, ktoreho hodnota sa dynamicky priradi + * @parameter int velkost_suboru : velkost suboru + * @parameter int* velkost_suctu : uklada velkost kontrolneho suctu, ktoreho hodnota sa dynamicky priradi * na zaklade nazvu funkcie uvedenom v prvom argumente * @vrati smernik na vygenerovany kontrolny sucet * Poznamka: * funkcia dynamicky alokuje pamat o velkosti, ktora zavisi od nastavenej crc/hash funkcie v nastaveniach, * takze tuto pamat je nutne nasledne dealokovat manualne */ -unsigned char* generovat_kontrolny_sucet_suboru(nastavenia_aplikacie* nastavenia, const char* cesta, int* velkost); +unsigned char* generovat_kontrolny_sucet_suboru(nastavenia_aplikacie* nastavenia, const char* cesta, int velkost_suboru, int* velkost_suctu); /** * generovat_ecc_certifikat: realizuje vygenerovania sukromneho kluca, nacitanie sukromneho kluca autority, diff --git a/readme.txt b/readme.txt index 3b0ce8c..95e43d7 100644 --- a/readme.txt +++ b/readme.txt @@ -65,7 +65,7 @@ Externe kniznice Pouzita verzia: 4.4.0 Viac informacii: https://www.wolfssl.com 3. ZLIB - Kniznica napisana v jazyku C, umoznujuca kompresiu a dekompresiu dat. Je to volny software + Kniznica napisana v jazyku C, umoznujuca kompresiu a dekompresiu dat. Je to volny softver s otvorenym zdrojovym kodom. V SSL/TLS knizniciach je casto vyuzivana na kompresiu TLS spojeni, ale v mojej kniznici som ju pouzil na vypocet CRC32 kontrolneho suctu. Pouzita verzia: 1.2.11 diff --git a/rs232_kanal/klient/klient.c b/rs232_kanal/klient/klient.c index 3b67842..e30fa96 100644 --- a/rs232_kanal/klient/klient.c +++ b/rs232_kanal/klient/klient.c @@ -82,7 +82,7 @@ int rs232_zapis(WOLFSSL *ssl, char *buf, int sz, void *ctx) //poslanie dat na seriove rozhranie odoslane_data = rs232_odoslat_spravu(cislo_rozhrania, buf, sz); - if(odoslane_data < 1) + if(odoslane_data <= 0) { fprintf(stderr, "Nastala chyba pri posielani dat\n"); return -1; @@ -98,7 +98,7 @@ int main(int argc, char const *argv[]) char rezim[]={'8','N','1', 0}; //nastavenie rychlosti rozhrania v baudoch - int rychlost = 9600; + int rychlost = 128000; WOLFSSL *ssl; WOLFSSL_CTX *ctx = NULL; diff --git a/rs232_kanal/klient/obr.jpg b/rs232_kanal/klient/obr.jpg deleted file mode 100644 index 127a9a304622bec3d3431526053bf7beea412081..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14242 zcmeHu2T)UA+vg3TgP~)P00Dv&5eY>TYUqUC`(LS2LPQNR_Hc7g11p zm!e3QPy_^|iGXE!-`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@V^Cxoz*|4do}4YdBuju6#ULj*?%W zF!PjFdepA;u3^Hr({*v&SDN9AB8BIf@yjvEJNk0pYwMnO_)0HiufA~oM!+~vZ+m<^ zeF1|1^0MO_7U*XulwM75J{?Vyrek_b-b3cwt@}h=iey1nT@zIeWk`7=+_Pyrww|uZ zlIt1D3-NbBuyo>JD?U!s^;D`-9TF(>ji^ZT&d|H;Io7CbV?*dl#&9pp~rcCbyi}O+Yas9Ff zbA~alytzz8hhU97r}I5t<6zy&c{Gs0#7QWAE$z}aJo0>-ht_A4)2PW{VNjngp1^Uq zX*85Dm~_R3I`pxVaub2$fNx{2{u&N`>lPa7E?D|&I)5a8>?PA}q5jFAy|;^Oktv`3 z7amnc+3k|aVdP2wV5V%O$HVieYrzu9kcig6OZm<{`73r=FaN5}GhnUqUI`xh?tZ7~XLm?5PsBrg;1~X(b%vh;DVfP z6GWKj9w$nt*Rb&Vz+4WWjwD=8`U5JhAw{s4FWO&=dD4pf3EsnPK_!>AwKlogy{> diff --git a/rs232_kanal/klient/spustit_klient.bat b/rs232_kanal/klient/spustit_klient.bat index 7c6a9fd..4566e47 100644 --- a/rs232_kanal/klient/spustit_klient.bat +++ b/rs232_kanal/klient/spustit_klient.bat @@ -13,4 +13,4 @@ :: -s cesta-ku-suboru sluzi na nacitanie cesty k suboru, ktory chceme odoslat ::Priklady spustenia: -klient -port 4 -n rsa -s obr.jpg +klient -port 4 -n rsa -s document.pdf diff --git a/rs232_kanal/server/obr.jpg b/rs232_kanal/server/obr.jpg deleted file mode 100644 index 127a9a304622bec3d3431526053bf7beea412081..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14242 zcmeHu2T)UA+vg3TgP~)P00Dv&5eY>TYUqUC`(LS2LPQNR_Hc7g11p zm!e3QPy_^|iGXE!-`)9kW@mTj{oe2Wc4uey%sg|?z2~`S?(dZ6Ip_DB`)BIUBEYJr zjnxJ~AQ15P^yf1mr4{0N695bi0g1Cm^Z*qG0KjLtziVJXf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1|1^0MO_7U*XulwM75J{?Vyrek_b-b3cwt@}h=iey1nT@zIeWk`7=+_Pyrww|uZ zlIt1D3-NbBuyo>JD?U!s^;D`-9TF(>ji^ZT&d|H;Io7CbV?*dl#&9pp~rcCbyi}O+Yas9Ff zbA~alytzz8hhU97r}I5t<6zy&c{Gs0#7QWAE$z}aJo0>-ht_A4)2PW{VNjngp1^Uq zX*85Dm~_R3I`pxVaub2$fNx{2{u&N`>lPa7E?D|&I)5a8>?PA}q5jFAy|;^Oktv`3 z7amnc+3k|aVdP2wV5V%O$HVieYrzu9kcig6OZm<{`73r=FaN5}GhnUqUI`xh?tZ7~XLm?5PsBrg;1~X(b%vh;DVfP z6GWKj9w$nt*Rb&Vz+4WWjwD=8`U5JhAw{s4FWO&=dD4pf3EsnPK_!>AwKlogy{> diff --git a/rs232_kanal/server/server.c b/rs232_kanal/server/server.c index 4ba0018..7a6b79a 100644 --- a/rs232_kanal/server/server.c +++ b/rs232_kanal/server/server.c @@ -80,7 +80,7 @@ int rs232_zapis(WOLFSSL *ssl, char *buf, int sz, void *ctx) //poslanie dat na seriove rozhranie odoslane_data = rs232_odoslat_spravu(cislo_rozhrania, buf, sz); - if(odoslane_data < 1) + if(odoslane_data <= 0) { fprintf(stderr, "Nastala chyba pri posielani dat\n"); return -1; @@ -96,7 +96,7 @@ int main(int argc, char const *argv[]) char rezim[]={'8','N','1', 0}; //nastavenie rychlosti rozhrania v baudoch - int rychlost = 9600; + int rychlost = 128000; WOLFSSL *ssl; WOLFSSL_CTX *ctx = NULL; @@ -104,8 +104,9 @@ int main(int argc, char const *argv[]) int generovanie_certifikatu = 0; int nacitanie_zo_suboru = 0; nastavenia_aplikacie nastavenia; - + k_subor = open(KOMUNIKACNY_SUBOR, O_RDWR | O_NOCTTY | O_NDELAY); + int uspech; if((ctx = nastavit_ctx_server()) == NULL) @@ -259,6 +260,7 @@ int main(int argc, char const *argv[]) fclose(fopen(KOMUNIKACNY_SUBOR, "wb")); return -1; } + cas = clock() - cas; printf("Cas prenosu suboru: %f sekund\n", (double)cas/CLOCKS_PER_SEC); diff --git a/tcpip_kanal/klient/obr.jpg b/tcpip_kanal/klient/obr.jpg deleted file mode 100644 index 127a9a304622bec3d3431526053bf7beea412081..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14242 zcmeHu2T)UA+vg3TgP~)P00Dv&5eY>TYUqUC`(LS2LPQNR_Hc7g11p zm!e3QPy_^|iGXE!-`)9kW@mTj{oe2Wc4uey%sg|?z2~`S?(dZ6Ip_DB`)BIUBEYJr zjnxJ~AQ15P^yf1mr4{0N695bi0g1Cm^Z*qG0KjLtziVJXf4}}WZ2tED#6_Klgcd9t8ZNh%j7ONbE9NT1?{VB_UxMO_{5T$`}mhqO`WY zmWm!)6{GyON+B!Pz{q_b%5y>FqNtd-gq-}wOAyQjCWe{6hW^25iePt%{5D9bCWYhTtkcK7xV4!_MbxbZ@~ULu4#Z73_9yPFdLu>e76%T#54YX`G2+z1hEG3)aJvh*L(`8;Z<#S!=pGs6Q-u`l&qzz zp1_Mr#8@ay*T5 zNYb13v9>1gxJLm_%Y=s06!U*XkV$kZ6DN1g@z^gkz)i2F6s{Mw_h5M~?IUHB>p0xy zt)6MkJ%vke`V(`@M#HS#s;&!&5O*?l5W6D{ehMk$p}$?4H3VmAWs?nv4JWE%@HN?&tA9Sk)6uthVYV-IF8meogUh*_+J`({Y7t1HKxXmmaaZ6OfLA(w+_WV+R7dv zoJEZ*wM^ED#cLm(eiSUyEBD<_@36G&cs1a-sek%NM68N)@$Q;@XJ54Zt8s4|;-SQ~ zQeWk|`PLL;Z+zv|N%Ol$e}F@4mWoc{T)fhiT@W_r;Q-kmD<3pf?;5MG_Mr_EoBld~!Zts)KL|-qxm7iDqKaj5G%d$vm$;=Q=fA*^+ zlEZU0E@^JZpUp4n|I{|T_1s9e(0XsQkwLhCZ=<@agS#V1OtWfx>2{P%z;rwp8rAj(IrU(D}yg9O0HKcuFQ;;LlGyH0;QMDU?X<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Uc9Uz+*O z8d`@D^l;??9OBt@9;wyf>YVc6C9Tb`^VJvN98h?$^2;R>)=X5**Z%U6i`MMc0acZ~ z&Gk9f4wWu8Sl!RD{DLoU9<10~DL8Orj`aruaRW`06&dzigW-lUtH;+I&etV1OZVWH zqwD9A4g_+2?4~r_8N1Fr2Qj%Q=4{L#RjR2Ua5i`%;9Z=i2LGrB`Jd`l{xxNP^>0y<;`~=%VJX&#wn)bL#YB1zCL%Q$J9@V^Cxoz*|4do}4YdBuju6#ULj*?%W zF!PjFdepA;u3^Hr({*v&SDN9AB8BIf@yjvEJNk0pYwMnO_)0HiufA~oM!+~vZ+m<^ zeF1|1^0MO_7U*XulwM75J{?Vyrek_b-b3cwt@}h=iey1nT@zIeWk`7=+_Pyrww|uZ zlIt1D3-NbBuyo>JD?U!s^;D`-9TF(>ji^ZT&d|H;Io7CbV?*dl#&9pp~rcCbyi}O+Yas9Ff zbA~alytzz8hhU97r}I5t<6zy&c{Gs0#7QWAE$z}aJo0>-ht_A4)2PW{VNjngp1^Uq zX*85Dm~_R3I`pxVaub2$fNx{2{u&N`>lPa7E?D|&I)5a8>?PA}q5jFAy|;^Oktv`3 z7amnc+3k|aVdP2wV5V%O$HVieYrzu9kcig6OZm<{`73r=FaN5}GhnUqUI`xh?tZ7~XLm?5PsBrg;1~X(b%vh;DVfP z6GWKj9w$nt*Rb&Vz+4WWjwD=8`U5JhAw{s4FWO&=dD4pf3EsnPK_!>AwKlogy{> diff --git a/tcpip_kanal/klient/spustit_klient.bat b/tcpip_kanal/klient/spustit_klient.bat index 2160004..7f2562b 100644 --- a/tcpip_kanal/klient/spustit_klient.bat +++ b/tcpip_kanal/klient/spustit_klient.bat @@ -12,4 +12,4 @@ :: -s cesta-ku-suboru sluzi na nacitanie cesty k suboru, ktory chceme odoslat ::Priklady spustenia: -klient -ip 127.0.0.1 -port 8080 -n rsa -s obr.jpg +klient -ip 127.0.0.1 -port 8080 -n rsa -s document.pdf diff --git a/tcpip_kanal/server/obr.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