Răsfoiți Sursa

!1 use aes
Merge pull request !1 from 3swordman/master

rain 4 ani în urmă
părinte
comite
9cb938ecda
4 a modificat fișierele cu 17 adăugiri și 11 ștergeri
  1. 1 3
      Makefile
  2. 13 5
      crypt.c
  3. 1 1
      include/vcc/config.h
  4. 2 2
      include/vcc/version.h

+ 1 - 3
Makefile

@@ -1,5 +1,5 @@
 VCC_MAJOR 		= 1
-VCC_MINOR 		= 28
+VCC_MINOR 		= 29
 VCC_PATCH 		= 0
 VCC_STR 		= -rc 
 
@@ -61,5 +61,3 @@ clean :
 	@$(MAKE) -C libs/ clean
 	@$(MAKE) -C plugins/ clean
 
-w :
-	@echo 1

+ 13 - 5
crypt.c

@@ -37,11 +37,7 @@
  * ****ing ****ing, that you can't know what you're doing. */
 
 
-/* i tried aes256 but sometimes i get something garbled. then i 
- * tried des, that traditional alghrithm created by ibm and 
- * it really works. */
-
-#define CIPHER_ALGO 	GCRY_CIPHER_DES
+#define CIPHER_ALGO 	GCRY_CIPHER_AES256
 #define show_err(err) 	fprintf(stderr, "error: %s: %s\n", \
 		gcry_strsource(err), gcry_strerror(err))
 
@@ -112,6 +108,12 @@ int encrypt(char *msg) {
 		return 1;
 	}
 
+	if (unlikely((err = gcry_cipher_reset(hd)))) {
+		show_err(err);
+
+		return 1;
+	}
+
 	if (unlikely((err = gcry_cipher_encrypt(hd, msg, msgsize, NULL, 0)))) {
 		show_err(err);
 
@@ -130,6 +132,12 @@ int decrypt(char *msg) {
 
 		return 1;
 	}
+	
+	if (unlikely((err = gcry_cipher_reset(hd)))) {
+		show_err(err);
+
+		return 1;
+	}
 
 	if (unlikely((err = gcry_cipher_decrypt(hd, msg, msgsize, NULL, 0)))) {
 		show_err(err);

+ 1 - 1
include/vcc/config.h

@@ -1 +1 @@
-#define INSTALL_PATH "/root/vcc"
+#define INSTALL_PATH "/home/ubuntu/vcc"

+ 2 - 2
include/vcc/version.h

@@ -1,2 +1,2 @@
-#define VCC_VERSION "VCC 1.28.0 Fri Jun 10 09:45:04 PM CST 2022 root"
-#define VCC_SEMVER "vcc 1.28.0-rc "
+#define VCC_VERSION "VCC 1.29.0 Sun 12 Jun 2022 02:07:09 PM CST ubuntu"
+#define VCC_SEMVER "vcc 1.29.0-rc "