@@ -347,7 +347,7 @@ static int km_dh_decode_secret(const u8 * buf, unsigned int len,
347347
348348 if (secret .len != expected_len ) {
349349 #ifdef WOLFKM_DEBUG_DH
350- pr_err ("%s: km_dh_decode_secret: got %d, expected %zu" ,
350+ pr_err ("%s: km_dh_decode_secret: got %d, expected %zu\n " ,
351351 WOLFKM_DH_DRIVER , secret .len , expected_len );
352352 #endif /* WOLFKM_DEBUG_DH */
353353 return - EINVAL ;
@@ -413,7 +413,7 @@ static int km_dh_alloc_keys(struct km_dh_ctx * ctx)
413413alloc_keys_end :
414414 if (err ) {
415415 #ifdef WOLFKM_DEBUG_DH
416- pr_err ("%s: km_dh_alloc_keys failed: %d" ,
416+ pr_err ("%s: km_dh_alloc_keys failed: %d\n " ,
417417 WOLFKM_DH_DRIVER , err );
418418 #endif
419419 km_dh_clear_keys (ctx );
@@ -478,7 +478,7 @@ static int km_dh_set_secret(struct crypto_kpp *tfm, const void *buf,
478478
479479 if (km_dh_decode_secret (buf , len , & params ) < 0 ) {
480480 #ifdef WOLFKM_DEBUG_DH
481- pr_err ("%s: dh_set_secret: decode secret failed: %d" ,
481+ pr_err ("%s: dh_set_secret: decode secret failed: %d\n " ,
482482 WOLFKM_DH_DRIVER , params .key_size );
483483 #endif /* WOLFKM_DEBUG_DH */
484484 err = - EINVAL ;
@@ -488,15 +488,15 @@ static int km_dh_set_secret(struct crypto_kpp *tfm, const void *buf,
488488 /* the key, p, and g, must all be provided for normal dh. */
489489 if (!params .key || !params .key_size || !params .p_size || !params .g_size ) {
490490 #ifdef WOLFKM_DEBUG_DH
491- pr_err ("%s: dh_set_secret: empty params" , WOLFKM_DH_DRIVER );
491+ pr_err ("%s: dh_set_secret: empty params\n " , WOLFKM_DH_DRIVER );
492492 #endif
493493 err = - EINVAL ;
494494 goto dh_secret_end ;
495495 }
496496
497497 if (params .key_size > params .p_size || params .g_size > params .p_size ) {
498498 #ifdef WOLFKM_DEBUG_DH
499- pr_err ("%s: dh_set_secret: invalid params" , WOLFKM_DH_DRIVER );
499+ pr_err ("%s: dh_set_secret: invalid params\n " , WOLFKM_DH_DRIVER );
500500 #endif
501501 err = - EINVAL ;
502502 goto dh_secret_end ;
@@ -518,7 +518,7 @@ static int km_dh_set_secret(struct crypto_kpp *tfm, const void *buf,
518518
519519 if (err ) {
520520 #ifdef WOLFKM_DEBUG_DH
521- pr_err ("%s: wc_DhSetKey failed: %d" , WOLFKM_DH_DRIVER , err );
521+ pr_err ("%s: wc_DhSetKey failed: %d\n " , WOLFKM_DH_DRIVER , err );
522522 #endif
523523 err = - EINVAL ;
524524 goto dh_secret_end ;
@@ -530,7 +530,7 @@ static int km_dh_set_secret(struct crypto_kpp *tfm, const void *buf,
530530
531531 if (err ) {
532532 #ifdef WOLFKM_DEBUG_DH
533- pr_err ("%s: wc_DhImportKeyPair failed: %d" , WOLFKM_DH_DRIVER , err );
533+ pr_err ("%s: wc_DhImportKeyPair failed: %d\n " , WOLFKM_DH_DRIVER , err );
534534 #endif
535535 err = - EINVAL ;
536536 goto dh_secret_end ;
@@ -585,7 +585,7 @@ static int km_ffdhe_set_secret(struct crypto_kpp *tfm, const void *buf,
585585
586586 if (err ) {
587587 #ifdef WOLFKM_DEBUG_DH
588- pr_err ("%s: ffdhe_set_secret: decode secret failed: %d" ,
588+ pr_err ("%s: ffdhe_set_secret: decode secret failed: %d\n " ,
589589 WOLFKM_DH_DRIVER , params .key_size );
590590 #endif /* WOLFKM_DEBUG_DH */
591591 err = - EINVAL ;
@@ -595,7 +595,7 @@ static int km_ffdhe_set_secret(struct crypto_kpp *tfm, const void *buf,
595595 /* p_size and g_size should be 0 for ffdhe. */
596596 if (params .p_size || params .g_size ) {
597597 #ifdef WOLFKM_DEBUG_DH
598- pr_err ("%s: ffdhe_set_secret: unexpected p, g params: %d, %d" ,
598+ pr_err ("%s: ffdhe_set_secret: unexpected p, g params: %d, %d\n " ,
599599 WOLFKM_DH_DRIVER , params .p_size , params .g_size );
600600 #endif /* WOLFKM_DEBUG_DH */
601601 err = - EINVAL ;
@@ -616,7 +616,7 @@ static int km_ffdhe_set_secret(struct crypto_kpp *tfm, const void *buf,
616616 if (!params .key_size ) {
617617 /* generate the ffdhe key pair*/
618618 #ifdef WOLFKM_DEBUG_DH
619- pr_info ("ffdhe gen key pair" );
619+ pr_info ("ffdhe gen key pair\n " );
620620 #endif
621621 PRIVATE_KEY_UNLOCK ();
622622 err = wc_DhGenerateKeyPair (ctx -> key , & ctx -> rng ,
@@ -626,7 +626,7 @@ static int km_ffdhe_set_secret(struct crypto_kpp *tfm, const void *buf,
626626
627627 if (err ) {
628628 #ifdef WOLFKM_DEBUG_DH
629- pr_err ("%s: wc_DhGenerateKeyPair failed: %d" ,
629+ pr_err ("%s: wc_DhGenerateKeyPair failed: %d\n " ,
630630 WOLFKM_DH_DRIVER , err );
631631 #endif
632632 err = - EINVAL ;
@@ -641,7 +641,7 @@ static int km_ffdhe_set_secret(struct crypto_kpp *tfm, const void *buf,
641641 if (ctx -> pub_len < (ctx -> nbits / WOLFSSL_BIT_SIZE )) {
642642 word32 pad_len = ctx -> nbits / WOLFSSL_BIT_SIZE - ctx -> pub_len ;
643643 #ifdef WOLFKM_DEBUG_DH
644- pr_info ("info: km_ffdhe_set_secret: pub key padding %d" , pad_len );
644+ pr_info ("info: km_ffdhe_set_secret: pub key padding %d\n " , pad_len );
645645 #endif
646646
647647 memmove (ctx -> pub_key + pad_len , ctx -> pub_key , ctx -> pub_len );
@@ -660,7 +660,7 @@ static int km_ffdhe_set_secret(struct crypto_kpp *tfm, const void *buf,
660660
661661 if (err ) {
662662 #ifdef WOLFKM_DEBUG_DH
663- pr_err ("%s: wc_DhImportKeyPair failed: %d" ,
663+ pr_err ("%s: wc_DhImportKeyPair failed: %d\n " ,
664664 WOLFKM_DH_DRIVER , err );
665665 #endif
666666 err = - EINVAL ;
@@ -783,7 +783,7 @@ static int km_ffdhe_init(struct crypto_kpp *tfm, int name, word32 nbits)
783783 }
784784
785785 #ifdef WOLFKM_DEBUG_DH
786- pr_info ("info: exiting km_dh_init: name %d, nbits %d" ,
786+ pr_info ("info: exiting km_dh_init: name %d, nbits %d\n " ,
787787 ctx -> name , ctx -> nbits );
788788 #endif /* WOLFKM_DEBUG_DH */
789789 return 0 ;
@@ -874,7 +874,7 @@ static int km_dh_gen_pub(struct kpp_request *req)
874874
875875 if (ctx -> pub_len > req -> dst_len ) {
876876 #ifdef WOLFKM_DEBUG_DH
877- pr_err ("error: dst_len too small: %d" , req -> dst_len );
877+ pr_err ("error: dst_len too small: %d\n " , req -> dst_len );
878878 #endif /* WOLFKM_DEBUG_DH */
879879 req -> dst_len = ctx -> pub_len ;
880880 return - EOVERFLOW ;
@@ -885,7 +885,7 @@ static int km_dh_gen_pub(struct kpp_request *req)
885885 err = 0 ;
886886
887887 #ifdef WOLFKM_DEBUG_DH
888- pr_info ("info: exiting km_dh_gen_pub: %d" , ctx -> pub_len );
888+ pr_info ("info: exiting km_dh_gen_pub: %d\n " , ctx -> pub_len );
889889 #endif /* WOLFKM_DEBUG_DH */
890890 return err ;
891891}
@@ -921,7 +921,7 @@ static int km_dh_compute_shared_secret(struct kpp_request *req)
921921
922922 if (req -> src_len <= 0 || req -> src_len > (ctx -> nbits / WOLFSSL_BIT_SIZE )) {
923923 #ifdef WOLFKM_DEBUG_DH
924- pr_err ("error: got src_len %d, expected %d" , req -> src_len ,
924+ pr_err ("error: got src_len %d, expected %d\n " , req -> src_len ,
925925 (ctx -> nbits / WOLFSSL_BIT_SIZE ));
926926 #endif /* WOLFKM_DEBUG_DH */
927927 err = - EINVAL ;
@@ -2903,7 +2903,7 @@ static int linuxkm_test_kpp_driver(const char * driver,
29032903
29042904 dst_buf = malloc (dst_len );
29052905 if (dst_buf == NULL ) {
2906- pr_err ("error: allocating out buf failed" );
2906+ pr_err ("error: allocating out buf failed\n " );
29072907 test_rc = MEMORY_E ;
29082908 goto test_kpp_end ;
29092909 }
@@ -2917,20 +2917,20 @@ static int linuxkm_test_kpp_driver(const char * driver,
29172917
29182918 err = crypto_kpp_generate_public_key (req );
29192919 if (err ) {
2920- pr_err ("error: crypto_kpp_generate_public_key returned: %d" , err );
2920+ pr_err ("error: crypto_kpp_generate_public_key returned: %d\n " , err );
29212921 test_rc = BAD_FUNC_ARG ;
29222922 goto test_kpp_end ;
29232923 }
29242924
29252925 if (memcmp (expected_a_pub , sg_virt (req -> dst ), pub_len )) {
2926- pr_err ("error: crypto_kpp_generate_public_key: wrong output" );
2926+ pr_err ("error: crypto_kpp_generate_public_key: wrong output\n " );
29272927 test_rc = WC_KEY_MISMATCH_E ;
29282928 goto test_kpp_end ;
29292929 }
29302930
29312931 src_buf = malloc (src_len );
29322932 if (src_buf == NULL ) {
2933- pr_err ("error: allocating in buf failed" );
2933+ pr_err ("error: allocating in buf failed\n " );
29342934 test_rc = MEMORY_E ;
29352935 goto test_kpp_end ;
29362936 }
@@ -2945,13 +2945,13 @@ static int linuxkm_test_kpp_driver(const char * driver,
29452945
29462946 err = crypto_kpp_compute_shared_secret (req );
29472947 if (err ) {
2948- pr_err ("error: crypto_kpp_compute_shared_secret returned: %d" , err );
2948+ pr_err ("error: crypto_kpp_compute_shared_secret returned: %d\n " , err );
29492949 test_rc = BAD_FUNC_ARG ;
29502950 goto test_kpp_end ;
29512951 }
29522952
29532953 if (memcmp (shared_secret , sg_virt (req -> dst ), shared_s_len )) {
2954- pr_err ("error: shared secret does not match" );
2954+ pr_err ("error: shared secret does not match\n " );
29552955 test_rc = BAD_FUNC_ARG ;
29562956 goto test_kpp_end ;
29572957 }
0 commit comments