octx->ivlen = arg;
return 1;
- case EVP_CTRL_OCB_SET_TAGLEN:
- /* Tag len must be 0 to 16 */
- if (arg < 0 || arg > 16)
- return 0;
-
- octx->taglen = arg;
- return 1;
-
case EVP_CTRL_SET_TAG:
+ if (!ptr) {
+ /* Tag len must be 0 to 16 */
+ if (arg < 0 || arg > 16)
+ return 0;
+
+ octx->taglen = arg;
+ return 1;
+ }
if (arg != octx->taglen || c->encrypt)
return 0;
memcpy(octx->tag, ptr, arg);
# define EVP_CTRL_SET_IVLEN EVP_CTRL_GCM_SET_IVLEN
# define EVP_CTRL_GET_TAG EVP_CTRL_GCM_GET_TAG
# define EVP_CTRL_SET_TAG EVP_CTRL_GCM_SET_TAG
-# define EVP_CTRL_OCB_SET_TAGLEN 0x1c
/* GCM TLS constants */
/* Length of fixed part of IV derived from PRF */
test1_exit(11);
}
if ((mode == EVP_CIPH_OCB_MODE) &&
- !EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_OCB_SET_TAGLEN, tn, NULL))
- {
+ !EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_TAG, tn, NULL)) {
fprintf(stderr, "Tag length set failed\n");
ERR_print_errors_fp(stderr);
test1_exit(15);
test1_exit(11);
}
if ((mode == EVP_CIPH_OCB_MODE) &&
- !EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_OCB_SET_TAGLEN, tn, NULL))
- {
+ !EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_TAG, tn, NULL)) {
fprintf(stderr, "Tag length set failed\n");
ERR_print_errors_fp(stderr);
test1_exit(15);