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
 #include <gpxe/crypto.h>
4
 #include <gpxe/crypto.h>
5
 #include <gpxe/aes.h>
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
 	AES_CTX *aesctx = ctx;
8
 	AES_CTX *aesctx = ctx;
9
 	AES_MODE mode;
9
 	AES_MODE mode;
10
 
10
 
23
 	return 0;
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
 	AES_CTX *aesctx = ctx;
27
 	AES_CTX *aesctx = ctx;
28
 
28
 
29
 	memcpy ( aesctx->iv, iv, sizeof ( aesctx->iv ) );
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
 	AES_CTX *aesctx = ctx;
34
 	AES_CTX *aesctx = ctx;
35
 
35
 
36
 	AES_cbc_encrypt ( aesctx, data, dst, len );
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
 	AES_CTX *aesctx = ctx;
41
 	AES_CTX *aesctx = ctx;
42
 
42
 
43
 	AES_cbc_decrypt ( aesctx, data, dst, len );
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
 	.ctxsize	= sizeof ( AES_CTX ),
48
 	.ctxsize	= sizeof ( AES_CTX ),
49
 	.blocksize	= 16,
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
 
3
 
4
 struct crypto_algorithm;
4
 struct crypto_algorithm;
5
 
5
 
6
-extern struct crypto_algorithm aes_algorithm;
6
+extern struct crypto_algorithm aes_cbc_algorithm;
7
 
7
 
8
 #endif /* _GPXE_AES_H */
8
 #endif /* _GPXE_AES_H */

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

486
 	switch ( cipher_suite ) {
486
 	switch ( cipher_suite ) {
487
 	case htons ( TLS_RSA_WITH_AES_128_CBC_SHA ):
487
 	case htons ( TLS_RSA_WITH_AES_128_CBC_SHA ):
488
 		key_len = ( 128 / 8 );
488
 		key_len = ( 128 / 8 );
489
-		cipher = &aes_algorithm;
489
+		cipher = &aes_cbc_algorithm;
490
 		digest = &sha1_algorithm;
490
 		digest = &sha1_algorithm;
491
 		break;
491
 		break;
492
 	case htons ( TLS_RSA_WITH_AES_256_CBC_SHA ):
492
 	case htons ( TLS_RSA_WITH_AES_256_CBC_SHA ):
493
 		key_len = ( 256 / 8 );
493
 		key_len = ( 256 / 8 );
494
-		cipher = &aes_algorithm;
494
+		cipher = &aes_cbc_algorithm;
495
 		digest = &sha1_algorithm;
495
 		digest = &sha1_algorithm;
496
 		break;
496
 		break;
497
 	default:
497
 	default:

Loading…
Cancelar
Guardar