Explorar el Código

[crypto] Rename aes_algorithm to aes_cbc_algorithm

tags/v0.9.7
Michael Brown hace 15 años
padre
commit
991f907d5b
Se han modificado 3 ficheros con 15 adiciones y 15 borrados
  1. 12
    12
      src/crypto/axtls_aes.c
  2. 1
    1
      src/include/gpxe/aes.h
  3. 2
    2
      src/net/tls.c

+ 12
- 12
src/crypto/axtls_aes.c Ver fichero

@@ -4,7 +4,7 @@
4 4
 #include <gpxe/crypto.h>
5 5
 #include <gpxe/aes.h>
6 6
 
7
-static int aes_setkey ( void *ctx, const void *key, size_t keylen ) {
7
+static int aes_cbc_setkey ( void *ctx, const void *key, size_t keylen ) {
8 8
 	AES_CTX *aesctx = ctx;
9 9
 	AES_MODE mode;
10 10
 
@@ -23,32 +23,32 @@ static int aes_setkey ( void *ctx, const void *key, size_t keylen ) {
23 23
 	return 0;
24 24
 }
25 25
 
26
-static void aes_setiv ( void *ctx, const void *iv ) {
26
+static void aes_cbc_setiv ( void *ctx, const void *iv ) {
27 27
 	AES_CTX *aesctx = ctx;
28 28
 
29 29
 	memcpy ( aesctx->iv, iv, sizeof ( aesctx->iv ) );
30 30
 }
31 31
 
32
-static void aes_encrypt ( void *ctx, const void *data, void *dst,
33
-			  size_t len ) {
32
+static void aes_cbc_encrypt ( void *ctx, const void *data, void *dst,
33
+			      size_t len ) {
34 34
 	AES_CTX *aesctx = ctx;
35 35
 
36 36
 	AES_cbc_encrypt ( aesctx, data, dst, len );
37 37
 }
38 38
 
39
-static void aes_decrypt ( void *ctx, const void *data, void *dst,
40
-			  size_t len ) {
39
+static void aes_cbc_decrypt ( void *ctx, const void *data, void *dst,
40
+			      size_t len ) {
41 41
 	AES_CTX *aesctx = ctx;
42 42
 
43 43
 	AES_cbc_decrypt ( aesctx, data, dst, len );
44 44
 }
45 45
 
46
-struct crypto_algorithm aes_algorithm = {
47
-	.name		= "aes",
46
+struct crypto_algorithm aes_cbc_algorithm = {
47
+	.name		= "aes_cbc",
48 48
 	.ctxsize	= sizeof ( AES_CTX ),
49 49
 	.blocksize	= 16,
50
-	.setkey		= aes_setkey,
51
-	.setiv		= aes_setiv,
52
-	.encode		= aes_encrypt,
53
-	.decode		= aes_decrypt,
50
+	.setkey		= aes_cbc_setkey,
51
+	.setiv		= aes_cbc_setiv,
52
+	.encode		= aes_cbc_encrypt,
53
+	.decode		= aes_cbc_decrypt,
54 54
 };

+ 1
- 1
src/include/gpxe/aes.h Ver fichero

@@ -3,6 +3,6 @@
3 3
 
4 4
 struct crypto_algorithm;
5 5
 
6
-extern struct crypto_algorithm aes_algorithm;
6
+extern struct crypto_algorithm aes_cbc_algorithm;
7 7
 
8 8
 #endif /* _GPXE_AES_H */

+ 2
- 2
src/net/tls.c Ver fichero

@@ -486,12 +486,12 @@ static int tls_select_cipher ( struct tls_session *tls,
486 486
 	switch ( cipher_suite ) {
487 487
 	case htons ( TLS_RSA_WITH_AES_128_CBC_SHA ):
488 488
 		key_len = ( 128 / 8 );
489
-		cipher = &aes_algorithm;
489
+		cipher = &aes_cbc_algorithm;
490 490
 		digest = &sha1_algorithm;
491 491
 		break;
492 492
 	case htons ( TLS_RSA_WITH_AES_256_CBC_SHA ):
493 493
 		key_len = ( 256 / 8 );
494
-		cipher = &aes_algorithm;
494
+		cipher = &aes_cbc_algorithm;
495 495
 		digest = &sha1_algorithm;
496 496
 		break;
497 497
 	default:

Loading…
Cancelar
Guardar