lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 4 Oct 2018 05:12:40 +1000 (AEST)
From:   James Morris <jmorris@...ei.org>
To:     David Howells <dhowells@...hat.com>
cc:     denkenz@...il.com, keyrings@...r.kernel.org,
        linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 04/22] KEYS: Make the X.509 and PKCS7 parsers supply the
 sig encoding type

On Wed, 5 Sep 2018, David Howells wrote:

> diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
> index b6cabac4b62b..991f4d735a4e 100644
> --- a/crypto/asymmetric_keys/x509_cert_parser.c
> +++ b/crypto/asymmetric_keys/x509_cert_parser.c
> @@ -199,35 +199,32 @@ int x509_note_pkey_algo(void *context, size_t hdrlen,
>  
>  	case OID_md4WithRSAEncryption:
>  		ctx->cert->sig->hash_algo = "md4";
> -		ctx->cert->sig->pkey_algo = "rsa";
> -		break;
> +		goto rsa_pkcs1;
>  
>  	case OID_sha1WithRSAEncryption:
>  		ctx->cert->sig->hash_algo = "sha1";
> -		ctx->cert->sig->pkey_algo = "rsa";
> -		break;
> +		goto rsa_pkcs1;
>  
>  	case OID_sha256WithRSAEncryption:
>  		ctx->cert->sig->hash_algo = "sha256";
> -		ctx->cert->sig->pkey_algo = "rsa";
> -		break;
> +		goto rsa_pkcs1;
>  
>  	case OID_sha384WithRSAEncryption:
>  		ctx->cert->sig->hash_algo = "sha384";
> -		ctx->cert->sig->pkey_algo = "rsa";
> -		break;
> +		goto rsa_pkcs1;
>  
>  	case OID_sha512WithRSAEncryption:
>  		ctx->cert->sig->hash_algo = "sha512";
> -		ctx->cert->sig->pkey_algo = "rsa";
> -		break;
> +		goto rsa_pkcs1;
>  
>  	case OID_sha224WithRSAEncryption:
>  		ctx->cert->sig->hash_algo = "sha224";
> -		ctx->cert->sig->pkey_algo = "rsa";
> -		break;
> +		goto rsa_pkcs1;
>  	}
>  
> +rsa_pkcs1:
> +	ctx->cert->sig->pkey_algo = "rsa";
> +	ctx->cert->sig->encoding = "pkcs1";
>  	ctx->algo_oid = ctx->last_oid;
>  	return 0;
>  }

Perhaps I'm missing something here but why do you need the gotos vs. just 
breaking to this code?


-- 
James Morris
<jmorris@...ei.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ